7027 Commits

Author SHA1 Message Date
Aras Pranckevicius
facb17b0e3 Cleanup: BLI ENUM_OPERATORS cleanup/robustness
BLI code for enums that are meant to be used as "bit flags" defined
an ENUM_OPERATORS macro in BLI_utildefines.h. This cleans up things
related to said macro:

- Move it out into a separate BLI_enum_flags.hh header, instead of
  "random bag of things" that is the current place,
- Update it to no longer need manual indication of highest individual
  bit value. This originally was added in a31a87f89 (2020 Oct), in
  order to silence some UBSan warnings that were coming
  from GPU related structures (looking at current GPU code, I don't
  think this is happening anymore). However, that caused actual
  user-visible bugs due to incorrectly specified max. enum bit value,
  and today 14% of all usages have incorrect highest individual
  bit value spelled out.
    - I have reviewed all usages of operator ~ and none of them are
      used for directly producing a DNA-serialized value; all the
      usages are for masking out other bits for which the new ~
      behavior that just flips all bits is fine.
- Make the macro define flag_is_set() function to ease check of bits
  that are set in C++ enum class cases; update existing cases to use
  that instead of three other ways that were used.

Pull Request: https://projects.blender.org/blender/blender/pulls/148230
2025-10-17 12:57:50 +02:00
Julian Eisel
2e76bb47bb Refactor: BKE: Move icon header to C++
Was trying to use a C++ type (`blender::Span`) in the header but
couldn't. I would rather not use a less safe raw pointer to a buffer.

Pull Request: https://projects.blender.org/blender/blender/pulls/148214
2025-10-16 17:45:26 +02:00
Campbell Barton
bff7d49945 Merge branch 'blender-v5.0-release' 2025-10-16 22:05:17 +11:00
Campbell Barton
31035ae19f Fix #148189: linking relative paths fails to resolve path
Resolve regression in [0] which would attempt to use `//` when loading library files.

Expand the directories before use.

Ref !148193

[0]: 7bc7b7743b
2025-10-16 10:40:32 +00:00
John Kiril Swenson
8baf294b0d Merge branch 'blender-v5.0-release' 2025-10-15 18:58:21 -05:00
John Kiril Swenson
60d0cfdfe4 Fix #147701: VSE: Can't select markers when scene and sequencer scene differ
Add a simple check to the Marker keymap poll. Since there's no `bContext`
passed to the function we can reconstruct it from the workspace.

We can exit early if there is no sequencer scene (when no markers are
guaranteed). View layer can remain the same since it only applies in the
`SPACE_ACTION` case.

Pull Request: https://projects.blender.org/blender/blender/pulls/147903
2025-10-16 01:51:01 +02:00
Campbell Barton
3349b97987 Core: add --no-window-frame command line option
Add a command line option to load Blender without a window frame.

Currently this is only used on Wayland, enabled for WITH_UI_TESTS since
attempting to load LIBDECOR caused the tests to crash on start on Fedora.
For tests there is no need to use LIBDECOR, so disable the window frame.
This can also be used by users who don't want to use the X11 fallback if
LIBDECOR can't be found.

Ref !147716
2025-10-13 09:47:07 +00:00
Campbell Barton
729251ebac Cleanup: pass const arguments 2025-10-12 01:12:47 +00:00
Campbell Barton
c4b2c1c19e Cleanup: spelling (check_spelling_*), trailing spaces in comments 2025-10-12 12:12:46 +11:00
Damien Picard
30ee6a27df I18n: Translate a single custom report in quit dialog
Reported by Ye Gui in #43295.
2025-10-09 12:09:56 +02:00
Hans Goudey
a68d39e9d9 Cleanup: Formatting
Run `make format` after the library update in the previous commit.
2025-10-02 12:55:42 -04:00
Campbell Barton
b78c5fadf3 Cleanup: various non functional changes for C++ 2025-10-01 23:22:44 +00:00
hogan.mastanduno
dde9d21b91 OpenXR: VR Advanced Locomotion Phase 1
Includes the following changes to the existing Locomotion system for VR Scene Inspection:
 * new VR Navigation Preferences and VR Session Settings
 * changes to XR raycast logic and its visualization
 * new XR vignette that appears when moving
 * snap turning

Pull Request: https://projects.blender.org/blender/blender/pulls/144241
2025-10-01 22:16:12 +02:00
Campbell Barton
2107bd7326 Cleanup: rename as_needed -> if_needed
Follow the naming convention used elsewhere in the code.
2025-10-01 16:01:48 +10:00
Julian Eisel
90f723bdd4 UI: Follow HIG for view item selecting/activating
Makes selecting/activating view items (tree and grid view items) behave
as wanted by the guidelines, consistent with many other editors:
https://developer.blender.org/docs/features/interface/human_interface_guidelines/selection/#select-tweaking

Noteworthy:
- View items activate on press again, not on release
- Pose library still only activates poses on click (releasing mouse
  before moving cursor), so dragging can be used to blend poses
- New: Clicking on empty space in a view deselects all
- Redundant activation in interface handlers code is removed

Pull Request: https://projects.blender.org/blender/blender/pulls/146569
2025-09-26 11:26:34 +02:00
Jacques Lucke
4e4976804e Core: Add packed linked data-blocks
This adds support for packed linked data. This is a key part of an improved
asset workflow in Blender.

Packed IDs remain considered as linked data (i.e. they cannot be edited),
but they are stored in the current blendfile. This means that they:
* Are not lost in case the library data becomes unavailable.
* Are not changed in case the library data is updated.

These packed IDs are de-duplicated across blend-files, so e.g. if a shot
file and several of its dependencies all use the same util geometry node,
there will be a single copy of that geometry node in the shot file.

In case there are several versions of a same ID (e.g. linked at different
moments from a same library, which has been modified in-between), there
will be several packed IDs.

Name collisions are averted by storing these packed IDs into a new type of
'archive' libraries (and their namespaces). These libraries:
* Only contain packed IDs.
* Are owned and managed by their 'real' library data-block, called an
  'archive parent'.

For more in-depth, technical design: #132167
UI/UX design: #140870

Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/133801
2025-09-26 10:53:40 +02:00
Sean Kim
327a1925cf Paint: Rename curve and curve_preset
This commit renames the following DNA fields and corresponding RNA
properties to better represnt usage:

* `Brush.curve` to `Brush.curve_distance_falloff`
* `Brush.curve_preset` to `Brush.curve_distance_falloff_preset`

Pull Request: https://projects.blender.org/blender/blender/pulls/146254
2025-09-25 11:54:53 +02:00
Aaron Carlisle
18d0532915 UI: Movie Clip Editor: Add Overlays Support
Move several clip and mask display options into a common Overlays popover,
consistent with other editors. Includes a global toggle (Shift-Alt-Z) to
show/hide all overlays at once.

Also adds the missing annotations toggle, cursor visibility toggle, and moves mask display options in
the Image Editor into the Overlays popover due to shared code paths.

See PR for images.

Pull Request: https://projects.blender.org/blender/blender/pulls/145895
2025-09-24 23:51:06 +02:00
Falk David
9aba62667a Fix: VSE: Missing updates when active scene differs from sequencer scene
This was caused by the fact that the sequencer scenes depsgraph was not
active.
There was no reason to not make it active, the original
PR (!140271) just missed this.

The issue became more apparent with !139634.

Pull Request: https://projects.blender.org/blender/blender/pulls/146605
2025-09-22 18:57:04 +02:00
Dalai Felinto
851e5b55af VSE: Story Tools: Add Scene Strip Menu improvements
- Show unassigned scene assets directly under Assets.
- Use Icons for Assets label.
- Only show "Scenes" when there are Assets.
- Don't show scene assets on the "Scenes" list.

The design about changing the operator default behaviour will be
addressed separately. This patch only changes the UI.

Design ref: #145522
Ref: !146574
2025-09-22 17:19:03 +02:00
Brecht Van Lommel
8f7569f6e0 Fix: Don't show working space change popup when not changing the space
Pull Request: https://projects.blender.org/blender/blender/pulls/146509
2025-09-20 16:27:35 +02:00
Campbell Barton
4a6268e092 Cleanup: various non functional changes for C++ 2025-09-20 16:28:02 +10:00
Clément Foucault
9d0fe5573b GPU: FrameBuffer: Remove GPUFrameBuffer wrapper opaque type
This is the first step into merging DRW_gpu_wrapper.hh into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/146372
2025-09-16 17:50:48 +02:00
Clément Foucault
680fec144c Cleanup: GPU: Remove prefix 'e' from enum types
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/146034
2025-09-15 15:11:02 +02:00
Sean Kim
090b6efb62 Fix: Avoid potential crash when reading old blendfiles
Various runtime fields were being accessed before the runtime struct
itself was created in a newly allocated ID block. Additionally, the
call to `BKE_reports_init` is already handled by the
`WindowManagerRuntime` constructor.

Pull Request: https://projects.blender.org/blender/blender/pulls/146258
2025-09-15 11:30:52 +02:00
Eitan Traurig
a9a54c88b9 UV: add pack to custom region option to "Pack Islands" operator
This commit implements the design task #78398

- Box region
  - Set Custom UV Region (Ctrl-B).
  - Disabled with Custom Region checkbox in the menu or (Ctrl-Alt-B).
- Box Select (Pinned) changed to (Alt-B).
- When the Custom Region enum is chosen the islands are packed
  into the bounding box of the drawn region.

Ref !140020
2025-09-14 05:23:47 +00:00
Habib Gahbiche
bef15f0ec1 Fix #145633: Revert "Fix #144526: Crash on exit with Video_Editing template"
The fix introduced a high severity bug where exiting Blender after
working with the GPU compositor crashes Blender. We consider #144526 to
be less severe than the newly introduced bug, hence the revert for now.

This reverts commit b2b23e3619.

Pull Request: https://projects.blender.org/blender/blender/pulls/146096
2025-09-11 18:08:52 +02:00
Jeroen Bakker
c50c3275be Vulkan: Acquire/release swapchain images
`GHOST_SwapWindowBuffers` doesn't fit well when using swapchains. In
that case an approach where swap chain images are acquired and released
would map better. This PR introduces `GHOST_SwapWindowBufferAcquire`
and `GHOST_SwapWindowBufferRelease` to be more in line with vulkan swap
chains.

Previous implementation would first record all GPU commands based on
the last used swap chain. In case a swapchain needed to be recreated
(window resize, move to other monitor) the recorded commands would
not match the swap chain and could lead to artifacts.

OpenGL only implements the release functions as they don't
have a mechanism to acquire a swap chain image. (Need to validate with
the Metal API how this is working and adapt is needed).

Currently when starting blender on a HDR capable display the first frame
would be based on an sRGB surface and presented on an extended RGB
(or other) surface. As these don't match the first frame could be incorrect and
also lead to UBs as another surface is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/145728
2025-09-11 07:51:30 +02:00
Campbell Barton
77c76ccdb8 Cleanup: sort files 2025-09-11 12:41:33 +10:00
Pratik Borhade
42e70f10b5 Fix #146003: Autosave keeps re-saving even when file is already saved
If file is already saved, skip writing/overwritting auto-save file.

Pull Request: https://projects.blender.org/blender/blender/pulls/146005
2025-09-10 12:00:27 +02:00
Sybren A. Stüvel
d1962be44c Anim: remove deprecated SpaceAction::action pointer
Other code that needs to operate on "the Action that's shown in the
Dope Sheet" now accesses the newly-added
`bAnimContext::active_action`, which is now also used by
`context.active_action`. I've also added
`bAnimContext::active_action_user` in case the ID that is animated by
this Action is needed. That's either the active `Object` or the active
`Key`, again depending on the mode of the Dope Sheet editor.

The active Action can also be obtained via
`ANIM_active_action_from_area(scene, view_layer, area)`. This is a
faster method than the usual `ANIM_animdata_get_context(C, &ac)` and
it doesn't need the entire `bContext`.

The "Stash Action" and "Push Down Action" to the NLA were also
implemented by writing to `SpaceAction::action` via RNA. They now use
`ANIM_animdata_get_context()` to get the active action owner ID, and a
direct call to `blender::animrig::assign_action()` instead.

The remaining use of `SpaceAction::action` was for display &
manipulation of Scene/Action markers. This required some work to get
addressed, as there was quite a bit of spaghetti and duplicate logic
to churn through. More can be improved there, but I had to limit the
time I spent on this.

Python code that was still using `context.space_data.action` to find
the currently-showing Action has been migrated to
`context.active_action`.

Related: #119626
Pull Request: https://projects.blender.org/blender/blender/pulls/145672
2025-09-08 18:12:18 +02:00
Sybren A. Stüvel
6bf8685628 Anim: drop versioning code for pre-2.50 animation
Drop all support for animation data from Blender versions 2.49 and
older.

- The `IPO` DNA struct is deleted, as is the `IDType_ID_IP` type
  definition.
- Versioning code has been removed in its entirety.
- Loading a pre-2.50 blend file will issue a warning, stating that any
  animation data that was there is now lost, and that the file should
  be loaded & re-saved with Blender 4.5 to properly port the data.

Note that versioning of Action assignments (as in, picking a slot)
still uses the tagging + updating all tagged assignments as a
post-processing step. This is necessary because picking the right slot
is only possible after all Actions (also those from libraries) have
been versioned. We might be able to address this as well, by upgrading
legacy → slotted Actions "on the fly" versioning these Action
assignments. If we do that, I think that would be better in a separate
PR though, as it could introduce issues by itself.

Ref: #134219
Pull Request: https://projects.blender.org/blender/blender/pulls/145188
2025-09-08 14:09:21 +02:00
John Kiril Swenson
b67d44fc70 Fix #145808: Video Editing workspace does not set default tool
When a new workspace is appended into the current file, code tries to
set the active tool. As of #140271, an added check meant that if there
was no sequencer scene yet, no tool would be initialized with
`WM_toolsystem_update_from_context`.

In actuality, the scene and view layer that are passed into this
function are only used by the View3D space in
`WM_toolsystem_mode_from_spacetype`, so we don't need a special case at
all. Just revert to previous behavior to fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/145860
2025-09-07 18:33:11 +02:00
Damien Picard
f2b61b0874 UI: Fix and improve a few messages
- "grease pencil" -> "Grease Pencil": title case.
- "Display type" -> "Display Type": title case for property name.
- "Bezier" -> "Bézier": proper noun.
- "Mem:%dM, Peak %dM" -> "Mem:%dM, Peak: %dM": missing colon.
- "cannot save image while rendering" -> "Cannot": Sentence case.
- "Linked data cannot text-space transform" -> "Cannot create
  transform on linked data": rephrase strange sentence.
- "Unsupported object type for text-space transform" -> "... for
  texture space transform": unnecessary abbreviation.
- "Cannot write to asset %s:  %s": remove double space.
- "Failed to set tmpact" -> "temporary action": unclear abbreviation.
- "luminance at which the midetones of the image" -> "midtones: typo.
- "Line angle where the image should be split." -> trailing full stop.
- "... instances all the children in the collection" -> "... instances
  of all the children...": missing "of".
- "Curves to generated rounded corners on" -> "generate": typo.
- "Instances that converted to a point per instance" -> "Instances to
  convert to points": rephrase unclear sentence.
- "Great Pencil to set the depth order of" -> "Grease Pencil": typo.
- "Description to set the smoothness of" -> "Geometry to set the
  smoothness of": typo.
- "A cannot use current file as library" -> "cannot use...": typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/145840
2025-09-07 00:26:31 +02:00
Campbell Barton
3c7f4edd92 Cleanup: spelling in comments & string
Also back-tick quote literals in CMakeLists files.
2025-09-06 09:27:54 +10:00
Pablo Vazquez
eae4585177 UI: Accessibility: Reduce Motion
Add "Reduce Motion" option to a new `Accessibility` panel under
Preferences, User Interface.

"Reduce Motion" avoids non-essential animation effects, especially
useful for those experiencing motion sickness/vertigo.

It affects:
* Region open/close.
* Pie menus animation.
* Smooth views.

This panel in the future could host common accessibility settings such
as "Increase Contrast" or font size and weight controls that currently
are part of themes.

See PR for details and screenshots.

Co-authored-by: Harley Acheson <harley.acheson@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/140873
2025-09-05 21:12:52 +02:00
Brecht Van Lommel
6a083a5464 Color Management: Add working color space for blend files
* Store scene linear to XYZ conversion matrix in each blend file, along
  with the colorspace name. The matrix is the source of truth. The name
  is currently only used for error logging about unknown color spaces.
* Add Working Space option in color management panel, to change the
  working space for the entire blend file. Changing this will pop up
  a dialog, with a default enabled option to convert all colors in
  the blend file to the new working space. Note this is necessarily only
  an approximation.
* Link and append automatically converts to the color space of the main
  open blend file.
* There is builtin support for Rec.709, Rec.2020 and ACEScg working spaces,
  in addition to the working space of custom OpenColorIO configs.
* Undo of working space for linked datablocks isn't quite correct when going
  to a smaller gamut working space. This can be fixed by reloading the file
  so the linked datablocks are reloaded.

Compatibility with blend files saved with a custom OpenColorIO config
is tricky, as we can not detect this.

* We assume that if the blend file has no information about the scene
  linear color space, it is the default one from the active OCIO config.
  And the same for any blend files linked or appended. This is effectively
  the same behavior as before.
* Now that there is a warning when color spaces are missing, it is more
  likely that a user will notice something is wrong and only save the
  blend file with the correct config active.
* As no automatic working space conversion happens on file load, there is
  an opportunity to correct things by changing the working space with
  "Convert Colors" disabled. This can also be scripted for all blend files
  in a project.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:04:47 +02:00
Brecht Van Lommel
a4e9e4869d Refactor: Add foreach_working_space_color to ID type
Left for future work:
* Freestyle modifiers, dynamic paint, legacy texture mapping
* Editor colors: should be changed to sRGB?
* Studio light preferences: also sRGB, though less clear

Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:03:32 +02:00
Brecht Van Lommel
099ad9aee6 Refactor: Operator: Support properties dialog with message
Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:03:19 +02:00
Ramon Klauck
b910e04a2a VSE: Implement Lasso Select
This feature works like the select lasso in other editors. In preview
the user can draw a region they want to select and when a strips origin
is in this lasso region the strip gets selected.

In timeline the user can do the same and the strip gets selected when
the strip is in the lasso or some part of the lasso is in the strip.

The tool can be accessed through in the toolbar or via shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/143391
2025-09-05 17:53:13 +02:00
Brecht Van Lommel
ffa4f8c7ad Refactor: Split off lighter BLI_color_types.hh from BLI_color.hh
Functions for convert between the color types and ostream support are
now outside the classes.

Many files were changed to fix cases where direct includes for headers
were missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/145756
2025-09-05 11:11:32 +02:00
Brecht Van Lommel
9d2058eb1e Color Management: Warn when OpenColorIO config for blend file is likely missing
If any display, view or colorspace is not found, these would be changed to an
existing one and show warnings in the console. Now also warn about this in the
user interface using the same mechanism as loading new blend files in older Blender
versions, with a warning in the status bar and on file save.

Ref #145476

Pull Request: https://projects.blender.org/blender/blender/pulls/145756
2025-09-05 11:11:32 +02:00
Harley Acheson
91997ea89f UI: Save Temp Window Sizes & Positions
Allow temporary windows (like File Browser, Preferences, Render,
Drivers, Info) to open at their last positions and sizes.

Pull Request: https://projects.blender.org/blender/blender/pulls/104727
2025-09-05 00:05:50 +02:00
Ramon Klauck
098be390ca VSE: Implement Select Circle
This feature works like the select circle in any other modes. The user
can press "C" in preview or timeline and then select or deselect strips
by pressing the left or middle mouse button.

It’s an enhancement for the VSE preview because:
1. It makes it more similar to other editors in Blender
2. This behavior makes it easier to select specific overlapping strips
in preview, that is because the select circle only checks for the
origin of the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/141422
2025-09-03 17:57:00 +02:00
Bart van der Braak
a80b4ce22b Fix #145566: Crash in GPU_shader_builtin_warm_up when unbound GL context
glCreateProgram was called without a valid OpenGL context after
DRW_gpu_context_create unbound it. Rebind context before GPU_init
to prevent crash.

Fixes #145566

Pull Request: https://projects.blender.org/blender/blender/pulls/145606

Co-Authored-By: Miguel Pozo <pragma37@gmail.com>
2025-09-03 12:39:29 +02:00
Jeroen Bakker
a400b1d268 Cleanup: Mark unused variable
Pull Request: https://projects.blender.org/blender/blender/pulls/145504
2025-09-01 14:13:21 +02:00
Jeroen Bakker
c215ecfda9 Fix: Compilation error on Windows
1e523e2f5d was based on an earlier
version and this compilation error slipped to the cracks.
2025-09-01 13:51:01 +02:00
Christoph Neuhauser
1e523e2f5d Fix #143653: Add use of Quality of Service (QoS) API on Windows
This PR adds code for setting the Quality of Service (QoS) level of the
process on Windows. This can, e.g., make sure that on hybrid systems
P-cores are utilized even when the app window is out of focus.

In the following cases, it is adjusted from the default behavior:
- In wm_jobs.cc the QoS level is raised while a priority job is running.
- The command line option `--qos [high|eco|default]` can be used to
  change the QoS level of the process.
- By default, the QoS level is raised for the EEVEE performance tests,
  as they check viewport rendering performance and would otherwise be
  reliant on never going out of focus to not get a downgraded QoS level.
  By default, they are created with an out of focus window at the time
  of landing this PR. This PR makes sure that they actually measure the
  animation replay performance attainable during real-world use.

Pull Request: https://projects.blender.org/blender/blender/pulls/144224
2025-09-01 11:19:17 +02:00
Sean Kim
8188dbd246 Paint: Change brush size values to represent diameter
This commit changes the internal storage and user-facing representation
of the brush size values (`size` and `unprojected_size`) from radius
to diameter.

This has a number of benefits:
* While the radius is more helpful for many internal operations, it is
  more natural to estimate the size of a brush by the diameter
* Because the pixel size is stored as an integer, users are currently
  unable to make brushes that have an odd numbered diameter, notably
  preventing the ability to make single pixel brushes.

Internally, the `Brush` and `UnifiedPaintSettings` size values are
versioned to double their on-disk values. The relevant `BKE` functions
that access the data return the radius at runtime, and any internal
`struct`s that stored radius continue to do so.

The 'Radius' text for brushes is changed to 'Size' and all references
to it in descriptions are changed to 'size' as well.

Resolves #134204

Pull Request: https://projects.blender.org/blender/blender/pulls/142495
2025-08-30 00:18:41 +02:00
Julian Eisel
5669adf7e6 Fix #145388: Pose library breaks double-click in file browser
The pose library registered a double-click keymap item for the file
browser keymap, because that was the only way to add keymap items to the
asset browser (which is just the file browser under the hood). Since
450f428434, the pose library apply & blend operators are available in
more contexts, since their check for an active asset was moved from the
operator poll to the operator execution. So the pose apply operator
would end up triggering.

The poll function could be adjusted somehow to return false in this
case, e.g. by checking if it's executed from a file browser (not an
asset browser).

However, the operator should be independent of where it's called from.
So instead this registers a separate keymap for the asset browser, so
the pose library operators can be registered exclusively for the asset
browser.
2025-08-29 14:58:40 +02:00