Commit Graph

149580 Commits

Author SHA1 Message Date
Sergey Sharybin
9d4b236d13 Fix: Class memory access on the color management tear-down
Pull Request: https://projects.blender.org/blender/blender/pulls/138670
2025-05-09 16:22:57 +02:00
Hans Goudey
1c21de6f77 Cleanup: Formatting 2025-05-09 10:14:44 -04:00
Jacques Lucke
d9b91c73e3 Core: use template for BKE_id_new
This is the same change as e09ccc9b35 but for `BKE_id_new`.

Pull Request: https://projects.blender.org/blender/blender/pulls/138667
2025-05-09 16:13:25 +02:00
Alaska
ba38a2257e Release notes tools: Improve grammar in list of backported commits
This commit improves the grammar when reporting which versions of
Blender a commit was backported to in the "bug fixes per major release"
script if it was backported to 3 or more verisons of Blender.

Before:
- Backported to 3.6.22 & 4.2.9 & 4.4.1

After:
- Backported to 3.6.22, 4.2.9, and 4.4.1

Along with this change, I now use the word "and" rather than the
symbol "&".

Pull Request: https://projects.blender.org/blender/blender/pulls/138500
2025-05-09 15:52:43 +02:00
Alaska
d3c0cf87cb Release note tools: Don't cache commits with unknown modules
The script for collecting bug fixes per release have a caching feature
to speed up frequent re-running of the script by triagers to sort
commits.

This commit changes the script so that fix commits that don't have a
known module are no longer cached.

This is done because part of the sorting of commits is making sure
they're assigned to the right module. This typically means checking
on commits with "Unknown" modules and giving them a module label.

However due to caching, triagers running the script won't see those
changes until they clear their cache. To fix this, we no longer cache
commits with unknown modules.

Pull Request: https://projects.blender.org/blender/blender/pulls/138503
2025-05-09 15:51:38 +02:00
Omar Emara
a84de8067b Compositor: Remove Offset from Scale node
This patch removes the translation Offset from the Scale node. The
reasoning is that it is easy to insert a Translate node afterwards to
perform any necessary translation. And since we are moving options to
inputs, it doesn't seem worth it to provide those offsets as inputs in
the process.

Pull Request: https://projects.blender.org/blender/blender/pulls/138668
2025-05-09 15:46:41 +02:00
Sebastian Parborg
6d442ca4f1 Build: Make Linux Lib building reproducible
There are two parts for this PR. One is to change some of our build pipeline to make certain libs reproducible. For this part I want to clarify two things:

1. Why change python to use `--disable-optimizations`?
This is because `--enable-optimizations` turns on PGO (Profile Guided Optimization). PGO is sadly not deterministic and will create different binaries on every recompile. So to create reproducible build this needs to be turned off. This also seems to only have been turned on for Linux specifically(?) on our side. So on Windows and Mac our python build already doesn't have PGO.

2. Why split out cython and zstandard from site-packages?
Sadly pip does not seem to respect `SOURCE_DATE_EPOCH`. It also creates temporary folders with random hashes in them that is then recorded into the Cython libraries (I'll touch on this again later). I've looked at the discussions about this upstream and sadly the pip maintainers do not really want people to use pip as a reproducible build system pipeline and instead directs users to other solutions if they want reproducible builds.

The other part is about setting up our pipeline to not introduce any random hashes or build timestamps into our libraries. Here I do two things:

1. We need to set the `SOURCE_DATE_EPOCH` environmental variable to a specific date that will not change.
This is needed as the compile time date is recorded in certain libraries and files. (So hard coding it with this env var will make the end result reproducible)

2. We need to strip the created static and shared libraries. This is because the static libraries are not created in a deterministic way. For shared libraries some of our libraries includes debug symbols which contains paths to temporary files with random hashes. To solve this without stripping in post, we would need to either patch the linker on Rocky8 or patch a lot of our libraries. I think it is better to just do this as a post build step. (This seems to be what most linux distributions do as well).

With all this, we can make our Linux library builds is almost 100% reproducible. (At least on my machine where I tested)
By almost, I mean that there is sadly a catch in that certain libraries like Cython saves the source code path in their libraries for error messages. However now the builds are reproducible if the folder path is the same.
IE if the libraries are always built in `/home/builder/build_linux/deps_x64`, then they should now be reproducible.

Pull Request: https://projects.blender.org/blender/blender/pulls/134221
2025-05-09 15:25:16 +02:00
Omar Emara
fd3ca68b5e Compositor: Turn Bokeh Blur options to inputs
This patch turns the options of the Bokeh Blur node into inputs.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138664
2025-05-09 14:15:14 +02:00
Sergey Sharybin
8a6951a986 Cleanup: Use Blender::Mutex in OpenColorIO integration 2025-05-09 14:05:04 +02:00
Sergey Sharybin
7ceb4495c5 Refactor: OpenColorIO integration
Briefly about this change:
- OpenColorIO C-API is removed.
- The information about color spaces in ImBuf module is removed.
  It was stored in global ListBase in colormanagement.cc.
- Both OpenColorIO and fallback implementation supports GPU drawing.
- Fallback implementation supports white point, RGB curves, etc.
- Removed check for support of GPU drawing in IMB.

Historically it was implemented in a separate library with C-API, this
is because way back C++ code needed to stay in intern. This causes all
sort of overheads, and even calls that are strictly considered bad
level.

This change moves OpenColorIO integration into a module within imbuf,
next to movie, and next to IMB_colormanagement which is the main user
of it. This allows to avoid copy of color spaces, displays, views etc
in the ImBuf: they were used to help quickly querying information to
be shown on the interface. With this change it can be stored in the
same data structures as what is used by the OpenColorIO integration.
While it might not be fully avoiding duplication it is now less, and
there is no need in the user code to maintain the copies.

In a lot of cases this change also avoids allocations done per access
to the OpenColorIO. For example, it is not needed anymore to allocate
image descriptor in a heap.

The bigger user-visible change is that the fallback implementation now
supports GLSL drawing, with the whole list of supported features, such
as curve mapping and white point. This should help simplifying code
which relies on color space conversion on GPU: there is no need to
figure out fallback solution in such cases. The only case when drawing
will not work is when there is some actual bug, or driver issue, and
shader has failed to compile.

The change avoids having an opaque type for color space, and instead
uses forward declaration. It is a bit verbose on declaration, but helps
avoiding unsafe type-casts. There are ways to solve this in the future,
like having a header for forward declaration, or to flatten the name
space a bit.

There should be no user-level changes under normal operation.
When building without OpenColorIO or the configuration has a typo or
is missing a fuller set of color management tools is applies (such as the
white point correction).

Pull Request: https://projects.blender.org/blender/blender/pulls/138433
2025-05-09 14:01:43 +02:00
Jeroen Bakker
40af2b7be4 Vulkan: Add debug name for pipeline layouts 2025-05-09 13:40:46 +02:00
Campbell Barton
837703e585 Fix: failure to start on Wayland/GNOME with monitors at different scales
With two or more monitors of different scales, Blender would fail to
start in some cases when it opened on a monitor at a size that wasn't
a multiple of the monitors scale.

This seemed only to cause problems with LIBDECOR however the buffer size
should always be a multiple of the buffer scale, so ensure its always
valid.

See #135764 for details (a closely related bug).
2025-05-09 21:36:12 +10:00
Jacques Lucke
4acd6d46d4 UI: rename Tooltip Label to Quick Tooltip
Change the mentions of "tooltip label" to "quick tooltip" to make this feature more
universally useful. The new name was suggested in #138583.

Pull Request: https://projects.blender.org/blender/blender/pulls/138639
2025-05-09 13:34:35 +02:00
Omar Emara
f3275f5d12 Compositor: Remove Max Blur option from Bokeh Blur node
This patch removes the Max Blur option from the Bokeh Blur node. The
reasoning is as follows.

- The option was unused in case of non-variable sized blur, which was
  the default, so the option did nothing for the default case of the
  node.
- The option was originally introduced to define the search window of
  variable size blur. This is no longer the case, since we compute the
  search window dynamically from the input using parallel reduction,
  which is now very fast. So currently, it only works as an upper limit.
- The node options will be exposed as inputs, so the user will see two
  inputs that control the radius, which can be confusing for users that
  are not experienced.
- The plan is to make the node take absolute pixel sizes in the future,
  instead of the arbitrary relative size now in place, which would make
  it very easy for the user to impose such limits manually.

It is difficult to version this change, since the size is relative to
the image size, while max blur is in pixels. But we assume the user
chose a sufficiently large max blur for the node to be useful, so the
composite should not be expected to be drastically different.

Pull Request: https://projects.blender.org/blender/blender/pulls/138659
2025-05-09 12:47:27 +02:00
Nathan Vegdahl
0b97a13eaa Cleanup: Use libfmt functions in path template code
The use of `sprintf()` was causing compiler warnings on Apple's version
of Clang. This replaces those uses with `fmt::format_to_n()` from
libfmt, which is safer and silences those warnings.

Additionally, the format string given to `printf()` in debugging
functions for the path template unit tests was also causing warnings due
to type mismatch (long long vs long). This replaces those with
`fmt::print()`, which infers the correct type on its own, silencing
those warnings.

Pull Request: https://projects.blender.org/blender/blender/pulls/138660
2025-05-09 12:45:52 +02:00
Sergey Sharybin
191f395cac Fix: Dead-lock when opening image from the Image compositor node
An oversight in the #138551
2025-05-09 11:55:53 +02:00
Pratik Borhade
3b1b05ded8 UI: Outliner: Show Grease Pencil vertex groups
GP vertex group been missing in outliner. It seems we just need to adjust
the condition to include them.

Pull Request: https://projects.blender.org/blender/blender/pulls/138474
2025-05-09 11:53:48 +02:00
Jacques Lucke
eea2c6b00b Fix: Nodes: missing name escaping when constructing RNA paths
This also adds a version of `BLI_str_escape` that returns an std::string,
because it's much easier to use in C++ code.
2025-05-09 11:09:00 +02:00
Jesse Yurkovich
eb82c4edf1 Format: use fmt::format correctly with runtime format strings
Starting with C++20, `fmt::format` will process the format string at
compile time by default. We need to opt out in the cases where this is
not possible by using `fmt::runtime(...)`, like, for example, when using
our various translation utilities.

This mirrors prior commit e62aa986b2 and
fixes 2 cases that have slipped back in.

Pull Request: https://projects.blender.org/blender/blender/pulls/138640
2025-05-09 06:43:48 +02:00
Jacques Lucke
efefb16d4b Nodes: draw frame outline over zone backgrounds
Previously, the outline of frames was sometimes unexpectedly invisible.
The solution is to draw the frame outlines together with the zone outlines
after all the zone and frame backgrounds have been drawn already.

Pull Request: https://projects.blender.org/blender/blender/pulls/138645
2025-05-09 05:47:30 +02:00
Campbell Barton
b9d4b3b9a4 Cleanup: unused import 2025-05-09 13:36:18 +10:00
Campbell Barton
cab63d272c Cleanup: rename str_len to str_maxncpy
By convention str_len excludes the nil terminator.

Also assert the increment is a single unit as larger numbers aren't
supported (or needed currently).
2025-05-09 12:34:41 +10:00
Campbell Barton
2cd2f2ea4d Cleanup: quiet missing parenthesis & unused function warnings 2025-05-09 02:13:33 +00:00
Jacques Lucke
a03d0fd512 Nodes: show node errors tooltip faster
The idea here is to use `UI_but_func_tooltip_label_set` which has a shorter
duration until the tooltip shows (besides also being easier to use). It does
seem like it makes sense to use it here, because the only purpose of the error
icon is to hover over it. Therefore, one shouldn't have to wait for long until
the tooltip shows.

Pull Request: https://projects.blender.org/blender/blender/pulls/138583
2025-05-09 04:07:54 +02:00
Jacques Lucke
4a760c1a70 Nodes: show link errors directly on link
Previously, we had shown link errors on the target node as part of the node
warning system. While better than not showing any information about invalid
links (as was the state before that), it's still not ideal because it's easy to
miss when just looking at the link.

This patch adds an error icon in the middle of the invalid link. When hovering
over it, it shows the error text. When the middle of the link is not in view but
part of the link is, then the error icon will also stay visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/138529
2025-05-09 04:06:00 +02:00
Jacques Lucke
fb86bf0367 Nodes: support searching for color blend modes in Add menu
This is a follow up to #138534. It adds support for searching for all color blend
operations. It's supported in Geometry Nodes, Compositor and Shader Nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138581
2025-05-09 04:02:50 +02:00
Mattias Fredriksson
f9d3235291 Cleanup: Detect knot mode cyclic
Moving the cyclic mode check into a separate function simplifies the
code. Avoiding an additional local variable to track the result, and
better encapsulates the behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138375
2025-05-09 03:44:28 +02:00
Guillermo Venegas
38c08b515f UI: Allow drag multiple files from Blender File Browser
After c00c8b1b37 its possible to handle drag-n-drop with multiple
paths, this commit enables Blender internal File Browser to have
support to start drag events with multiple files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116474
2025-05-08 23:56:38 +02:00
Sean Kim
631c329d19 Fix: Incorrect versioning of brush tip_scale_x
The old versioning code was not guarded in a `MAIN_VERSION_FILE_ATLEAST`
check and the RNA hard minimum was not updated to prevent setting this
to an invalid value.

Pull Request: https://projects.blender.org/blender/blender/pulls/138572
2025-05-08 22:35:48 +02:00
Harley Acheson
40b64f7cb9 UI: Adjust Hitsize for Properties NavBar Region Edge
Recent increases in region edge hit sizes, to work better with tablet
pens, made the hitspace for Properties NavBar encroach into the tab
space. This PR just narrows it and moves it away from the tabs.

Pull Request: https://projects.blender.org/blender/blender/pulls/138622
2025-05-08 21:47:02 +02:00
Hans Goudey
be2f772a2d Fix: Build error after recent UI layout refactor
Also add an include that was missing (presumably not noticed because
of unity builds).
2025-05-08 15:29:21 -04:00
Clément Foucault
a68ad1b676 Fix: GPU: C++ GLSL stubs: Swizzle in wrong list 2025-05-08 20:55:24 +02:00
Guillermo Venegas
dafdced6ab Refactor: UI: Replace uiItemR with class method uiLayout::prop
This converts the public `uiItemR` function to an object oriented
API (`uiLayout::prop`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138617
2025-05-08 20:45:37 +02:00
Miguel Pozo
140d0df2b8 Fix: EEVEE: Static Viewport Animation Render
Fix viewport animation renders where there has been no scene updates
between frames.
2025-05-08 20:23:56 +02:00
Miguel Pozo
66796ef9d4 Fix: Workbench: Static Viewport Animation Render
Fix viewport animation renders where there has been no scene updates
between frames.
2025-05-08 20:13:16 +02:00
Harley Acheson
9741ced8c0 UI: Hover Increment/Decrement For Strings & Toggles
This is loosely related to #136285, which allows changing numerical
values while in text entry mode. Outside of that, just hovering over
numerical inputs we are currently able to increment and decrement by
Ctrl + Mouse Wheel. This works for integers, floats, sliders. Current
code also allows cycling through expanded enums. This PR extends that
so Ctrl + Mouse Wheel also changes toggles and checkboxes and also
changes values inside of strings.

Pull Request: https://projects.blender.org/blender/blender/pulls/138344
2025-05-08 19:52:56 +02:00
Alexandre-Cardaillac
921c2b9d61 Shader: New Volume Coefficients Shader
Add a new shader node to control volume coefficients (scattering,
absorption and emission) directly, making it easier to model existing
volumes with measured data.

Pull Request: https://projects.blender.org/blender/blender/pulls/136287
2025-05-08 19:19:35 +02:00
Hans Goudey
d018c12b61 Cleanup: Draw: Use StringRef for function argument 2025-05-08 13:09:06 -04:00
Philipp Oeser
75f55a9e8e Fix #138493: Placeholders and Renders filenames dont match
... if only a single view is enabled

Logic for touching placeholder files in `RE_RenderAnim` uses
`BKE_scene_multiview_filepath_get` (no matter if only a single view is
enabled), but logic in `BKE_image_render_write` falls back to using the
"regular" filepath (once gotten from `BKE_image_path_from_imformat`) if
there are less than two views.

That would also break the behavior of "Skip Overwrite".

Digging in git history is a bit hard, so not exactly sure why this was
added, but this PR changes behavior so that
`BKE_scene_multiview_filepath_get` is always used (even for a single
(non-empty) view. Done by implementing `RE_ResultIsMultiView`

Pull Request: https://projects.blender.org/blender/blender/pulls/138507
2025-05-08 18:37:44 +02:00
Philipp Oeser
c86f5c2a64 Fix #138545: Grease Pencil connected proportional editing wrong
It would not use topological distances.

This was the case for Grease Pencil, Curves were right though (even
though both use the same code `curve_populate_trans_data_structs` /
`calculate_curve_point_distances_for_proportional_editing`)

So that calculation is actually right, the thing that made it fail for
Grease Pencil was that `init_proportional_edit` was calling
`set_prop_dist` with the `with_dist` argument as `true` [this would
overwrite the already calculated dist with the "plain", "non-
topological" distance again... leading to wrong values being used in
`calculatePropRatio`]

So to resolve, skip the `set_prop_dist` alltogether if T_PROP_CONNECTED
is used. Done for both Curves and Grease Pencil and move into own block.
Legacy Curve get their own codeblock (with a comment where their
topological distances are calculated).

Pull Request: https://projects.blender.org/blender/blender/pulls/138588
2025-05-08 18:37:19 +02:00
Miguel Pozo
992e7c95a7 GPU: Converge ShaderCompiler implementations
Part of #136993.

Share as much of the ShaderCompiler implementations as possible.
Remove the ShaderCompiler/ShaderCompilerGeneric split and make most of
its functions non virtual.
Move the `get_compiler` function from `Context` to `GPUBackend` and
creation/deletion to `GPUBackend::init/delete_resources`.
Add a `batch_cancel` function to `ShaderCompiler` (needed for the
GPUPass refactor).

As a nice extra, the multithreaded OpenGL compilation has become faster
too.
The barbershop materials + EEVEE static shaders have gone from 27s to
22s.

I have not observed any performance difference on Vulkan or Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/136676
2025-05-08 18:16:47 +02:00
Hans Goudey
12decaf13c Fix: Use after free after recent image pool lock cleanup
Caused by 9a5a5c35c7.
We need to release the lock before freeing it.
2025-05-08 11:46:22 -04:00
Julian Eisel
9128348e48 Fix: Tools: Commit hashes not shortened in weekly report script
Broken since 53d076612a.
2025-05-08 17:28:29 +02:00
Jordan Henshaw
499eb133d7 Fix: Graph Editor with View Selected on 1 key
Expand the already-existing safety margin to correct for the implosion
scenario, by a factor of 100x. That way it doesn't zoom in too much,
and makes it easy for an animator to zoom out again if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/138235
2025-05-08 17:21:39 +02:00
Guillermo Venegas
e5dcd0de99 Refactor: UI: Replace uiItemL with class method uiLayout::label
This converts the public `uiItemL` function to an object oriented
API (`uiLayout::label`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138608
2025-05-08 17:21:08 +02:00
Ray Molenkamp
f2b9dd3462 CMake: Windows: Use release libs of shaderc for debug builds.
While shaderc is a c++ library that normally requires debug libs
for ABI reasons, shaderc only exports a C interface, so it will
link release mode libs just fine even for debug builds.

This drops the time required for GPU_shader_compile_static in a
debug build from 5 mins to 3 sec for @pragma37

no changes for release configurations.
2025-05-08 09:14:03 -06:00
Hans Goudey
b21cb20eeb Refactor: Remove layer index from draw attribute request struct
The goal is to separate the draw attribute request from the
CustomData implementation. For the layer index this was
already started a while ago; it's only used in a couple places
and lookups are mostly name based anyway.

Conceptually the attribute request is just a request that the
extraction system create a buffer for a certain attribute name.
Information about where the attribute is stored doesn't fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/138570
2025-05-08 16:55:23 +02:00
Christoph Lendenfeld
d30d4c0c04 Anim: Show action slots in the outliner
Add Slots to the outliner.
Slots can be renamed from the outliner.

Pull Request: https://projects.blender.org/blender/blender/pulls/126839
2025-05-08 16:09:31 +02:00
Nathan Vegdahl
e0beb7afe6 Templates for render output paths
This adds basic templating support to render output paths. By putting
"{variable_name}" in the path string, it will be replaced by the named
variable's value when generating the actual output path. This is similar
to how "//" is already substituted with the path to the blend file's
current directory.

This templating system is implemented for both the primary render output
path as well as the File Output node in the compositing nodes. Support
for using templates in other places can be implemented in future PRs.

In addition to the "{variable_name}" syntax, some additional syntax is
also supported:

- Since "{" and "}" now have special meaning, "{{" and "}}" are now
  escape sequences for literal "{" and "}".
- "{variable_name:format_specifier}", where "format_specifier" is a
  special syntax using "#", which allows the user to specify how numeric
  variables should be formatted:
  - "{variable_name:###}" will format the number as an integer with at
    least 3 characters (padding with zeros as needed).
  - "{variable_name:.##}" will format the number as a float with
    precisely 2 fractional digits.
  - "{variable_name:###.##}" will format the number as a float with at
    least 3 characters for the integer part and precisely 2 for the
    fractional part.

For the primary render output path: if there is a template syntax error,
a variable doesn't exist, or a format specifier isn't valid (e.g. trying
to format a string with "##"), the render that needs to write to the
output path fails with a descriptive error message.

For both the primary and File Output node paths: if there are template
syntax errors the field is highlighted in red in the UI, and a tooltip
describes the offending syntax errors. Note that these do *not* yet
reflect errors due to missing variables. That will be for a follow-up
PR.

In addition to the general system, this PR also implements a limited set
of variables for use in templates, but more can be implemented in future
PRs. The variables added in this PR are:

- `blend_name`: the name of the current blend file without the file
  extension.
- `fps`: the frames per second of the current scene.
- `resolution_x` and `resolution_y`: the render output resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134860
2025-05-08 15:37:28 +02:00
Jeroen Bakker
d648ffb0f1 Fix #138140: Vulkan: Disable swapchain maintenance1
There are issues with our implementation.
- X11 can flip image incorrectly.
- VVL complains of incorrect usage.

Disabling the extension for now until it is more clear what is not
correct.
2025-05-08 15:36:45 +02:00