Commit Graph

122530 Commits

Author SHA1 Message Date
Philipp Oeser
7acdef1bd1 Fix #129241: AssetBrowser "display mode" Reset Default sets wrong mode
The Asset Browser (as opposed to other Filebrowser) is restricted to
either FILE_HORIZONTALDISPLAY / FILE_IMGDISPLAY, as noted in https://
projects.blender.org/blender/blender/issues/103563#issuecomment-82835
the UI isnt polished enough for FILE_VERTICALDISPLAY it seems. However,
resetting to default would leave us with exactly that.

To resolve, control the default dynamically via an
`RNA_def_property_enum_default_func` (and set it to FILE_IMGDISPLAY for
the Asset Browser).

Pull Request: https://projects.blender.org/blender/blender/pulls/144917
2025-08-22 20:04:06 +02:00
Brecht Van Lommel
33c722481b Color Management: Make per-view look filtering work with AgX HDR
Consider the part of the view name before the dash to be the prefix that
we expect the look to have. So that both "AgX" and "AgX - HDR" match
looks starting with "AgX -".

Pull Request; https://projects.blender.org/blender/blender/pulls/142758
2025-08-22 19:21:17 +02:00
Sergey Sharybin
628f53a28c Refactor: Consolidate baking settings into BakeData
Almost all settings were duplicated between BakeData and RenderData.
The only missing field was the bake type, which is stored as a custom
property in Cycles.

This change:
- Removes unused bake_samples and bake_biasdist.
- Migrates settings like bake_margin to BakeData.
- Switches multires baker to use bake_margin.
- Introduces bake type in the BakeData, the same way how it was
  defined in RenderData::bake_mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/144984
2025-08-22 19:18:03 +02:00
Sergey Sharybin
8348438cae Multires bake: Rework baking high-res displacement
This change makes it so baking displacement to the high-resolution mesh
(Use Low Resolution Mesh option is OFF, displacement is calculated
between top multi-resolution level and subdivided viewport level mesh)
uses texture UVs and tangent space from the high-res mesh.

This matches intended use-case when object baked with such configuration
have subdivision surface applied to them bringing overall resolution to
the same level as the highest multi-resolution level.

The issue was simple to see when baking high-res displacement for an
object which uses "Keep Corners, Junctions" UV smoothing.

The unfortunate aspect is increased memory usage due to calculation of
the grid index and grid UV mapping, but it is not too bad (12 bytes per
loop, so is like 48Mb per million face). Feels like there is a way to
optimize it by utilizing knowledge that high-res mesh faces are created
in a specific order, but also feels it is not that important at this
moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/144935
2025-08-22 18:24:57 +02:00
Sergey Sharybin
e0154de320 Rework Bake from Multires
The main idea is to switch Bake from Multires from legacy DerivedMesh
to Subdiv. On the development side of things this change removes a lot
of code, also making it easier easier to rework CustomData and related
topics, without being pulled down by the DerivedMesh.

On the user level switch to Subdiv means:

- Much more closer handling of the multi-resolution data: the derived
  mesh code was close, but not exactly the same when it comes to the
  final look of mesh.

  Other than less obvious cases (like old DerivedMesh approach doing
  recursive subdivision instead of pushing subdivided vertices on the
  limit surface) there are more obvious ones like difference in edge
  creases, and non-supported vertex creases by the DerivedMesh.

- UV interpolation is done correctly now when baking to non-base level
  (baking to multi-resolution level >= 1).

  Previously in this case the old derived mesh interpolation was used
  to interpolate face-varying data, which gives different results from
  the OpenSubdiv interpolation.

- Ngon faces are properly supported now.

A possible remaining issue is the fact that getting normal from CCG
always uses smooth interpolation. Based on the code it always has been
the case, so while it is something to look into it might be considered
a separate topic to dig into.
2025-08-22 17:59:27 +02:00
Sergey Sharybin
a56922099e ImBuf: Change rounding for byte buffer in IMB_rectfill()
It matches the behavior of IMB_rectfill_area() with opaque alpha now.

This is important as the function is used in baking, where the neutral
0.5 is expected to be mapped to 128.
2025-08-22 17:17:35 +02:00
Sergey Sharybin
c9a87558d4 Refactor: Mass Mesh as const to multires displacement
The only annoying part is that for the external MDISPS the mesh
needs to be cast to non-const.

Arguably it is semantically correct behavior as the details of
how external data is read is kind of implementation details.
2025-08-22 17:15:06 +02:00
Sergey Sharybin
0c3136de84 Refactor: Use float2 in the multires baker
Shortens some formulas, and reduces the number of arguments.
Also reduce the variables scope.

No functional changes expected.
2025-08-22 17:15:06 +02:00
Sergey Sharybin
1e4764a9a5 Refactor: Simplify subdiv utilities
- Return evaluated points as function return value.
  Used in cases when only limit or final point is requested, without
  partial derivatives.

- Re-order function argument list and use default argument values to
  simplify usage in the simple/typical cases.

No functional changes expected.
2025-08-22 17:15:06 +02:00
Jeroen Bakker
e24e58f293 Vulkan: Recycle descriptor pools
This PR adds recycling of descriptor pools. Currently descriptor pools
are discarded when full or context is flushed. This PR allows
descriptor pools to be discarded for reuse.
It is also more conservative and only discard
Descriptor pools when they are full or fragmented.

When using the Vulkan backend a small amount of descriptor memory can leak. Even
when we clean up all resources, drivers can still keep data around on the
GPU. Eventually this can lead to out of memory issues depending on how
the GPU driver actually manages descriptor sets.

When the descriptor sets of the descriptor pool aren't used anymore
the VKDiscardPool will recycle the pools back to its original VKDescriptorPools.
It needs to be the same instance as descriptor pools/sets are owned by
a single thread.

Pull Request: https://projects.blender.org/blender/blender/pulls/144992
2025-08-22 17:11:26 +02:00
Eqkoss / T1NT1N
5658b408df Lights: Rename Spot Size to Beam Angle in UI
This is more consistent with other naming of angles in the user interface,
and more clear.

The identifier has not changed, so no API compatibility is broken.

Fix #144527

Pull Request: https://projects.blender.org/blender/blender/pulls/144661
2025-08-22 16:47:50 +02:00
Campbell Barton
41b2ab6b40 Cleanup: check the blend-file path isn't empty before comparing
While harmless in these cases, it can cause problems (see [0]) if the
other path happen to be an empty string.

[0]: ffbd078c55
2025-08-23 00:37:30 +10:00
Campbell Barton
420d45ceb4 BLI_noise: suppress signed int overflow warnings for hash_pcg2d_*
Ref !144986
2025-08-22 14:33:24 +00:00
Campbell Barton
40e876ab37 Fix #144716: Crash showing menus that referenced panels that don't exist
Unregistering panels could cause popups to crash if those were
referenced. Now fallbacks, non popover behavior is used instead.
2025-08-23 00:19:27 +10:00
Clément Foucault
8ee6bc2c01 EEVEE: Change barriers in the raytracing pipeline
Found when debugging the test regressions on the bot.

Pull Request: https://projects.blender.org/blender/blender/pulls/144985
2025-08-22 15:50:15 +02:00
Aras Pranckevicius
6d1c30fad7 Fix: VSE preview wrong ImBuf variable used
get_texture_colorspace_name accessed byte_buffer instead of
float_buffer; introduced in 18110744a2. In practice VSE seems to
always fill colorspaces, so does not cause a very visible bug.
2025-08-22 16:27:03 +03:00
Aras Pranckevicius
47925fcb69 Cleanup: VSE scopes drawing number typo
"-.0f" was a typo in VSE preview area drawing, was meant to be 1.0f
(introduced in 18110744a2)
2025-08-22 16:27:03 +03:00
Miguel Pozo
f8d61f0735 Fix #144932 : BLI_assert failed: DRW_lock_start(), at 'locked'
Avoid trying to bind the same context twice.

Pull Request: https://projects.blender.org/blender/blender/pulls/144939
2025-08-22 15:22:13 +02:00
Campbell Barton
f28850144d Fix: resolve memory leak in previous fix for #144958
Instead of matching regions, free all popups using
UI_popup_handlers_remove_all which also calls the remove callback
that frees the uiPopupBlockHandle.
2025-08-22 22:23:01 +10:00
Campbell Barton
311231a31c Fix #144958: Crash changing screens with a menu open
Deleting or changing the screen with a popup (error report in this case)
wasn't removing the popup, it would attempt to display using it's
region which had been freed when changing the screen.
2025-08-22 10:45:00 +00:00
Campbell Barton
ffbd078c55 Fix: failure to append with an unsaved blend file
Regression in [0] an unsaved file would be an empty string which could
be equal to "libname" causing them to be considered equal, resulting
in an error thatthe file was linking in itself.

Resolve by only performing this check on saved files.

fa29d28d73
2025-08-22 20:11:24 +10:00
Campbell Barton
4c35ef7a7f Cleanup: rename function for removing handlers, use typed area argument 2025-08-22 19:40:29 +10:00
Jeroen Bakker
0ea1feabd9 Vulkan: HDR support for Windows
This PR adds HDR support for Windows for `VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT`
on `VK_FORMAT_R16G16B16A16_SFLOAT` swapchains .

For nonlinear surface formats (sRGB and extended sRGB) the back buffer is blit into the swapchain,
When VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT is used as surface format a compute shader
is used to flip and invert the gamma.

SDR white level is updated from a few window event changes, but actually
none of them immediately respond to SDR white level changes in the system.
That requires using the WinRT API, which we don't do so far.

Current limitations:
- Intel GPU support
- Dual GPU support

In the future we may add controls inside Blender for absolute HDR nits,
across different platforms. But this makes behavior closer to macOS.

See !144565 for details

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/144717
2025-08-22 10:11:55 +02:00
Jeroen Bakker
366eba1d04 Fix: EEVEE: Memory leak when drawing Volume objects
Pool of VolumeInfo was never reset. Detected when stress testing
the vulkan backend using tree_creature.blend where the world
volume was converted to a volume object.

Pull Request: https://projects.blender.org/blender/blender/pulls/144967
2025-08-22 09:49:56 +02:00
Campbell Barton
addc9db67d Fix #144916: Transform crash pressing tab disabling axis constraint
When disabling cursor constraint NumInput::idx_max was set to -1.
This looks to be the behavior since 2.4x, however more recently
the modulo of `idx_max + 1` was used to cycle the axis when pressing
tab (crashing when `idx_max` is -1).

Resolve by setting `NumInput::idx_max` to the number of axes since
this is the state when transform is initialized.
2025-08-22 07:37:30 +00:00
Campbell Barton
e964f078b5 PyDoc: correct use of back ticks for literal text 2025-08-22 15:10:29 +10:00
Campbell Barton
78c9d16919 PyDoc: correct types, consistent formatting for doc-strings in C++
Correct some types, ensure multi-line docs end with a newline,
sentences end with a full stop.
2025-08-22 14:05:28 +10:00
Andrej730
e41fdebf3a PyDoc: UILayout.introspect(), add missing return value type
Ref !143353
2025-08-22 03:42:34 +00:00
Campbell Barton
db3db2876f Cleanup: quiet compiler warning 2025-08-22 13:42:28 +10:00
Sebastian Parborg
a126ddc5d6 VSE: Clear cache when toggling meta strips
This makes sure that the cache we have is not outdated as going in and
out of meta strips effectily hides/unhides strips from the timeline.

Pull Request: https://projects.blender.org/blender/blender/pulls/144800
2025-08-21 19:36:37 +02:00
Sebastian Parborg
db0486c5e8 Revert "Fix #141768: VSE: Tabbing in/out of metastrips does not update strip cache"
This reverts commit 08ec4602a2.
2025-08-21 19:36:36 +02:00
Sybren A. Stüvel
50876d9b26 Fix #143697: UI freezes with lots of Action slots (in the Outliner)
Only create an outliner tree element for all Action slots in specific
modes of the outliner. The "object-hierarchical" modes (Scene, View
Layer) show the Action underneath each user of that Action; in these
cases, only the assigned slot is shown now.

Previously all slots would be shown, in all modes of the Outliner. This
meant quadratic complexity, as each Action is included in the tree for
each of its users, and then each of those tree items would show all
slots. This means the number of tree items for the slots was multiplied
by the number of users.

Pull Request: https://projects.blender.org/blender/blender/pulls/144864
2025-08-21 18:16:59 +02:00
Sean Kim
eea22743c1 Weight Paint: Change default 'Zero Weights' setting to 'Active'
This commit changes the default setting from 'None' to 'Active' so that
the difference between a very small weight value and a value of 0 is
more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/144699
2025-08-21 17:07:10 +02:00
Hans Goudey
7430915bb4 Fix: Assert in curves sculpt mode
Mistake in 072d251b8e
2025-08-21 10:30:11 -04:00
Philipp Oeser
07365bad87 Fix #129065: Linked material can be modified from the Properties Editor
In the Node Editor itself, you cannot edit a linked Nodetree (add nodes,
drag from a socket etc., so basically no actions allowed).
In the Properties Editor (Material tab) however, where we display the
Nodetree differently (via `uiTemplateNodeView`) and while editing
properties themselves was already disabled, you could still edit node
**links** (thus **adding** nodes to the tree).
This would all be lost on file reload though, so better prevent this.

To resolve, just disable the socket / NodeLink button when looking at a
linked Nodetree.

NOTE: the "not in a linked nodetree" disabled hint is not showing yet,
something I intend to fix in an upcoming PR (it is also not showing this
for properties generally in the node editor).

Pull Request: https://projects.blender.org/blender/blender/pulls/144930
2025-08-21 16:15:16 +02:00
Miguel Pozo
13bbf3ba44 Depsgraph: Expose helper functions for manual dupli iteration
Refactor some internal DEG_iterator code into public functions.
This shouldn't cause any functional change, but it's required for
#140378.

Pull Request: https://projects.blender.org/blender/blender/pulls/140674
2025-08-21 15:47:29 +02:00
Brecht Van Lommel
7d7562e849 Color Management: Support for saving wide gamut images
* Bundled ICC profiles for display spaces supported by Blender, and
  embed them in the image file when saving.
* Verified to work for PNG, TIFF, JPEG and WebP, but not all file
  formats support this.
* No ICC profile is written for sRGB currently. It would be a matter
  of adding an icc file, however this may be a breaking change for
some use cases.
* Fix save as render of EXR files not properly changing the image
  colorspace to match.

Uses CC0 licensed ICC files from the Compact ICC Profiles project.

This does not include support for saving HDR images. While there exist
ICC profiles for PQ, they are not well supported and the preferred method
for HDR is to write CICP tags. However OpenImageIO support for this is
still under development.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:21 +02:00
Brecht Van Lommel
1f9f1d0b6e Color Management: Improve wide gamut color buttons and pickers
These should at least show the correct colors and gamut now, following the
color picking space in the OpenColorIO config.

However the ACES config use sRGB as the color_picking role, which means
that the color picker only shows a limited a gamut. There is apparently is
not agreement on the interpretation of this role, so we might have to stop
using it.

Additionally, if you set the color_picking role to something like ACEScg +
sRGB transfer function, the widgets do show all the colors in the gamut,
however the gamut is probably too large to be practical for most uses. So
we need some UI solution for this regardless.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:15 +02:00
Brecht Van Lommel
13e1c222ee Color Management: Add some heuristics to match display and view names
To improve compatibility when switching between Blender and ACES 2.0 config,
and when there is no exact matching view name when switching displays.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:13 +02:00
Brecht Van Lommel
c826b0630d Color Management: Group SDR and HDR displays in menu
This helps users discover that they should use Rec.2100 PQ for HDR.

And drop redundant "- Display" suffix from ACES config, makes the menu look
more clean.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:09 +02:00
Brecht Van Lommel
b0d52c528b Color Management: Remove "High Dynamic Range" setting
This was a temporary solution until we had proper HDR displays.

* Auto detect from the display + view transform if they are HDR, and
  enable it automatically. This is based on encoding hdr-video in the config.
* If a HDR transform is selected and there is no HDR display support, an
  info message will be shown in the color management panel.
* It is now possible to view HDR images in the image editor, without
  needing to use "View as Render".
* There is no versioning to switch to a HDR display, because that also
  affects image saving. So users will have to manually select the
  "Rec.2100 PQ" display to see HDR colors again.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:06 +02:00
Brecht Van Lommel
62485a760f Color Management: Wide gamut display
* Change meaning of display device to be the device that we are trying
  to emulate, not the monitor configuration.
* The display transform is now:
 * User specified view and display transform
 * Clamp to 0 to limit colors to gamut
 * Inverse untonemapped display transform
 * Convert to extended sRGB
* When using the display space in the color management API, it now needs to
  be specified if it's for drawing (with emulation) or file output or color
  inspection (without).

Like HDR, this only works on macOS and Linux + Wayland + Vulkan currently.
Support for Windows/Vulkan is under development in #144717.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:25:01 +02:00
Brecht Van Lommel
ff52b7eef4 Color Management: Base color space interpretation on interop ID
For display and image saving, we need to know certain properties of displays
and view transforms that OpenColorIO does not explicitly provide. In the
upcoming OpenColorIO 2.5 there will be an interop ID for color spaces that
adds more information. This moves towards that design, with heuristics for
configs that don't have the interop IDs.

* Try to use the first colorspace alias as the interop ID. This is used in
  some existing configs, and now the Blender config as well.
* Improve ACES 2.0 config compatibility by interpreting some aliases like
  srgb_display as interop IDs.
* Detect is_srgb and is_wide_gamut through display colorspace interop ID.
  These are now per view rather than per display.
* Detect is_extended where we can't clamp to 0..1 through interop ID.

* Detect untonemapped view as config wide default view transform for converting
  between reference and display space, if "Standard" or "Un-tone-mapped" can
  not be found.
* Detect which display and view transform combination is HDR by checking for
  "hdr-video" encoding on the display colorspace in the OpenColorIO config.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:24:56 +02:00
Brecht Van Lommel
235fdc6356 Color Management: Fix wrong use of display color space
* PROP_COLOR_GAMMA is sRGB, not display space
* Hex colors are always sRGB
* Image byte buffers are in byte_buffer.colorspace

Fixes for sequencer text, image painting, render stamp and tooltips.
The default display space is sRGB, so this change will not be noticed
in most files.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/144565
2025-08-21 15:24:40 +02:00
W_Cloud
24308a9f21 Nodes: Inherit color tag when grouping a single node
The `Ctrl + G` make group operator now inherits the color_tag
from the selected node when only one node is selected.

Pull Request: https://projects.blender.org/blender/blender/pulls/144861
2025-08-21 14:50:19 +02:00
Campbell Barton
fc7141f582 Fix #142137: Dynamic paint crashes when evaluating poses
DEG_add_collision_relations was only adding relationships for objects in
the brush collection, however dynamic paint also updates parent objects
and armature poses which weren't accounted for. Failing to include these
relations meant the evaluating the depsgraph could evaluate a pose
object from multiple threads at once - causing a crash.

Resolve by sharing logic between DEG_add_collision_relations &
BKE_object_modifier_update_subframe so depsgraph relationships match
objects the dynamic-paint modifier updates as part of its evaluation.

Ref !144844
2025-08-21 22:13:18 +10:00
Campbell Barton
cc553739d8 Cleanup: various minor changes BKE_object_modifier_update_subframe
- Rename `parent_recursion` to `parent_recursion_limit`.
- Use a define for the recursion default.
- Use const arguments.
2025-08-21 22:13:18 +10:00
Sybren A. Stüvel
f5ba4dbfe6 Python: Fix parameter name in error message from bpy.data.file_path_map()
When `bpy.data.file_path_map(subset=X)` is called, where `X` has the
wrong type, it now correctly shows `subset` as the erroneous parameter.

Pull Request: https://projects.blender.org/blender/blender/pulls/144914
2025-08-21 14:11:26 +02:00
Sybren A. Stüvel
a7cf8963da Cleanup: better documentation for the Bone struct
Improve the documentation for the Bone coordinate spaces and these struct fields:

- `head` & `tail`
- `bone_mat`
- `arm_head` / `arm_tail`
- `dist`

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/143729
2025-08-21 14:10:25 +02:00
Jeroen Bakker
bca70c85e7 Cleanup: struct initializers 2025-08-21 12:27:19 +02:00