Commit Graph

116098 Commits

Author SHA1 Message Date
Christoph Lendenfeld
c3e5d15c2e Anim: Make pose library code aware of slots
This patch makes the internal functions for the pose library aware of action slots.
* Allows to apply poses with more than 1 slot.
* The slot is chosen based on a best guess, with a fallback to the first slot.

Not in this patch:

There is no straightforward way to create multi slot pose assets yet. That will come later.
It is possible to manually tag an action with more than 1 slot as an asset though.

When applying poses, only the active object is modified. Multi object editing support will come later.

Part of Design #131840

Pull Request: https://projects.blender.org/blender/blender/pulls/132161
2025-01-02 15:27:06 +01:00
Aras Pranckevicius
4546367bb3 Cleanup: Add ibuf channel expectation asserts in VSE code
Whole of VSE assumes that all images are always 4 channels. Add
asserts in several places to more clearly indicate that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132546
2025-01-02 14:33:52 +01:00
Omar Emara
0ec7edf411 Cleanup: Compositor: Omit default case for ResultType
Explicitly list all result types to make it easier to add new result
types.
2025-01-02 14:42:44 +02:00
Omar Emara
b6be52c2b2 Refactor: Compositor: Reduplicate type conversion code 2025-01-02 14:02:13 +02:00
Brecht Van Lommel
841ae6e8ab Fix part of #131933: Crash with playback of deforming subdivision surface
The `ForeachContext` in `deform_coarse_vertices` does not use TLS but still has
a `func_free` callback set. Change the task API to allow this.

Pull Request: https://projects.blender.org/blender/blender/pulls/132498
2025-01-02 12:21:56 +01:00
Omar Emara
159038ce7c Cleanup: Compositor: Deduplicate single value setters 2025-01-02 10:20:17 +02:00
Campbell Barton
f00661614f Cleanup: remove vector CLAMP macros
This can be done using functions to avoid multiple argument
instantiations.
2025-01-02 15:11:23 +11:00
Campbell Barton
f417c7ad2c Cleanup: sort cmake file lists 2025-01-02 15:11:21 +11:00
Campbell Barton
dca0996777 Cleanup: various non-functional changes for C++ 2025-01-02 15:11:20 +11:00
Campbell Barton
5c515e26bb Cleanup: remove trailing space, ensure a newline at EOF 2025-01-02 15:11:18 +11:00
Campbell Barton
dfef060ea4 Cleanup: spelling in comments (make check_spelling_*)
Also use doxy-code blocks for inlined TEX to avoid
them being interpreted as English.
2025-01-02 15:11:17 +11:00
Campbell Barton
1b0cef86fa Fix UNIX crash on startup when HOME isn't set
Regression in [0] which re-introduced #2931.

Accessing environment variables must always null check the result.

Resolve by checking the result as well as replacing $HOME
access with a function that falls back to `passwd::pw_dir`.

Also add code-comments to to clarify the current behavior.

[0]: b308b360eb
2025-01-02 14:46:55 +11:00
YimingWu
d53d7a42df Fix #132449: Crash converting empty curves to mesh
Caused by b3a06149bb.

`curve_to_mesh` returns null for empty meshes.
This fix guards access to the result with a null check.

Pull Request: https://projects.blender.org/blender/blender/pulls/132453
2025-01-01 20:21:30 +01:00
Pratik Borhade
25febbbb32 Fix #100264: Outliner icon overlap when filter collection is off
In Outliner (View Layer mode) when filter "Collections" is off the icon
of the object mode overlaps with "arrow" icon (if "Show Mode Column" is
enabled). To fix this, add offset for this specific case and also when
"All View Layers" is off.

Pull Request: https://projects.blender.org/blender/blender/pulls/132339
2025-01-01 20:15:14 +01:00
Pratik Borhade
ae90d0defd Fix #108987: Remove exclamation from bake fluid message
Exclamation looks unnecessary for info message that is generated after
completing the bake job. This PR removes the exclamation points.

Pull Request: https://projects.blender.org/blender/blender/pulls/132009
2025-01-01 19:39:26 +01:00
Sean Kim
3c5b2c3b9f Fix #132414: Dyntopo smooth brush doesn't work with face set automasking
Previously, in 4.2, the `has_face_set` method always returned `true` for
whether or not a given vert had a given face set with dyntopo enabled.
This logic was updated to be more complete in 4.3, but the fallback
logic for when a mesh didn't have any face set data was not.

To fix this, if the corresponding BMesh doesn't have the face set
attribute, we check whether or not thet requested face set is
`SCULPT_FACE_SET_NONE`

Pull Request: https://projects.blender.org/blender/blender/pulls/132523
2025-01-01 18:50:20 +01:00
Omar Emara
f90572c688 Cleanup: Compositor: Remove typed single value getters 2025-01-01 18:20:58 +02:00
Aras Pranckevicius
c26db69f58 VSE: Simplify and optimize effect multi-threading
Cleanup (and make slightly faster as a side effect) the way VSE effects
do multi-threading. Previously (some of them) were using
IMB_processor_apply_threaded with C-like machinery (which internally
uses a task pool), switch that over to a helper apply_effect_op
(which internally uses a parallel for). Based on profiling, parallel
for is slightly more efficient (task pool takes a bit until all the
tasks are "pushed" into the pool). Note however that some VSE effects
were already doing parallel for internally; these are not affected.

VSE scene at 4K resolution, with four 4K resolution PNG images blended
over each other, time it takes to do render_strip_stack:
- Ryzen 5950X (Win/VS2022): 38.9ms -> 34.7ms
- Mac M4 Max: 21.9ms -> 19.8ms

Now that all VSE effects are internally threaded via parallel for,
there's no need for the init_execution and execute_slice machinery,
so remove all that.

You might also notice that half of "over drop" effect code is gone.
It was accidentally not doing anything whatsoever for the last 18 years
(since 2.42), and currently observed behavior matches documentation
and "internet knowledge", so let's  accept it as correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/132380
2025-01-01 11:11:49 +01:00
Jesse Yurkovich
95be928c5e Fix: MaterialX: Use correct output node type
The output node types were seemingly incorrect since the initial commit
and would produce incorrect MaterialX documents[1]. When MaterialX is
upgraded to 1.38.10 this will now fail material creation in Hydra.

Use the node type directly instead of setting things to their default
`color3` output type.

[1] See PR for an example.

Pull Request: https://projects.blender.org/blender/blender/pulls/132362
2024-12-31 23:39:20 +01:00
Hans Goudey
6bfb6399ea Fix #132075: Realize instances crash with vertex group inputs
Caused by 84c7684871.

Previously we could count on adding the attributes to the result mesh
not failing. Now, since the vertex group names are copied, they might
fail because a name would cause the attribute to already exist with a
float type on the point domain, which might not match the most
complex domain/type we'd use otherwise.

The fix is to only create attributes as vertex groups if the domain and
type combination from all the input meshes is correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/132506
2024-12-31 22:16:29 +01:00
Hans Goudey
11e97bd593 Fix: Assert for material span size after recent cleanup
Caused by 6871fe8415.

The assert was harmless, the array of null pointers was just longer
than necessary.
2024-12-31 15:13:56 -05:00
Ray Molenkamp
2f0fc7fc9f Cleanup: CMake: clean sequencer's CMakeLists.txt
- Remove animrig include, replace with lib dependency
- mark internal include as private

Pull Request: https://projects.blender.org/blender/blender/pulls/132502
2024-12-31 21:07:54 +01:00
Ray Molenkamp
0dc484f9cc Cleanup: CMake: Modernize bf_rna dependencies
Pretty straightforward

- Remove any bf_rna paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132413
2024-12-31 18:23:25 +01:00
Hans Goudey
455326fd67 Fix #132488: Crash drawing edge attribute in sculpt mode 2024-12-31 09:44:16 -05:00
Hans Goudey
39f7c506b5 Refactor: Tweak draw_pbvh.cc code organization
With the goal of removing the type and custom data domain from
the attribute requests, tweak the order of the calls to ensure that
each vertex buffer is allocated until after we know about the source
mesh data format. After that, it makes more sense to have the loop
over BVH nodes inside each extraction function.

Pull Request: https://projects.blender.org/blender/blender/pulls/132467
2024-12-31 01:06:00 +01:00
Brecht Van Lommel
7e9a48eb98 Cleanup: ATTR_RADIUS unused warning with clang 2024-12-31 00:50:43 +01:00
Hans Goudey
6871fe8415 Cleanup: Use Span for GPU batch array
Pull Request: https://projects.blender.org/blender/blender/pulls/132464
2024-12-30 18:55:23 +01:00
Hans Goudey
7366dc1edb Cleanup: Remove unused draw cache function declarations 2024-12-30 12:12:23 -05:00
Hans Goudey
2f0d1a52f9 Cleanup: Formatting 2024-12-30 11:37:25 -05:00
Hans Goudey
e8adf05b1b Cleanup: Move data transfer enum to more specific header 2024-12-30 11:18:39 -05:00
Hans Goudey
645624130d Cleanup: Simplify creation of mesh for particle system conversion 2024-12-30 11:13:47 -05:00
Hans Goudey
e8db6b9966 Cleanup: Use attribute API for Alembic crease import 2024-12-30 11:13:47 -05:00
Hans Goudey
dacc9455ba Cleanup: Remove unused color math functions
Unused for at least 14 years.
2024-12-30 11:13:47 -05:00
Omar Emara
9baa10f2ae Compositor: Add default accessors for single value results
Add an accessor for single value results that can return a default value
for non single value results.
2024-12-30 18:08:33 +02:00
Hans Goudey
973fb062a0 Cleanup: Move data_transfer_intern.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/132461
2024-12-30 17:03:48 +01:00
Bastien Montagne
694fd3bf4b Fix Alembic importer generating invalid edge crease values.
Conversion from [0-1] float value ranges to [0-255] integer char ones
was left in Alembic importer, when the internal Blender storage for
these values was converted from a char in the old `MEdge` struct to a
regular float attribute.
2024-12-30 16:25:30 +01:00
Jesse Yurkovich
eb39d81afa Fix #132396: Orbit Gizmo navigation used wrong math operation
Regression from 3d0988a719 where two adds
were accidentally changed to subtracts.

Pull Request: https://projects.blender.org/blender/blender/pulls/132440
2024-12-30 02:55:52 +01:00
Ray Molenkamp
de3accb68a Cleanup: CMake: Modernize bf_draw dependencies
Pretty straightforward

- Remove any bf_draw paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132411
2024-12-28 21:38:19 +01:00
Ray Molenkamp
95c1a5e4fe Cleanup: CMake: Modernize bf_imbuf_movie dependencies
Not entirely straightforward, some manual edits were done since when
this library was created, some of the work was already done.

- Remove any bf_imbuf_movie paths from INC
- Add a dependency though LIB when missing
- Add public dependency to bf_imbuf in bf_imbuf_movie since it uses the
  imbuf headers in its public headers.
- Fix namespace not to have underscores

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132407
2024-12-28 20:53:18 +01:00
Ray molenkamp
10c5493746 Cleanup: CMake: Modernize bf_geometry dependencies
Pretty straightforward

- Remove any bf_geometry paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132375
2024-12-28 19:58:14 +01:00
Alaska
8efd41271d Compositor: Add OIDN Quality to denoise node
This commit exposes the "Quality" option of the Open Image Denoiser
to the user for the denoise node in the compositor.

There are a few quality modes:
- High - Highest quality, but takes the longest to process.
- Balanced - Slightly lower quality, but usually halves
the processing time compared to High.
- Fast - Further reduce the quality, for a small increase in
speed over Balanced.

Along with that there is a `Follow Scene` option which will use the
quality set in the scene settings.

This allows users that have multiple denoise nodes
(E.g. For multi-pass denoising), to quickly switch all nodes between
different quality modes.

Performance (denoising time):
High: 13 seconds
Balanced: 6 seconds
Fast: 5 seconds

Test setup:
CPU: AMD Ryzen 9 5950X
Denoising a 3840x2160 render

---

Follow ups:
Ideally the "Denoise Nodes" UI panel in the render properties panel
would be hidden if the compositor setup does not contain any
denoise nodes.

However implementing this efficiently can be difficult and so it was
decided this task was outside the scope of this commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/130252
2024-12-28 01:44:49 +01:00
Gerard Taulats
02b1e5a48f Fix #94152 #97677: Fix cursor update over UI buttons
Use window->tag_cursor_refresh rather than WM_cursor_set when changing
cursor for numerical inputs. This works better since this allows a
change directly to a region-specified cursor rather than always to
default first.

Pull Request: https://projects.blender.org/blender/blender/pulls/132185
2024-12-27 23:50:27 +01:00
Jesse Yurkovich
da7e7a0e80 Fix: Handle null Action during armature export
Regressed during fix for [1]. A null action is possible so we need to
provide a default name when this happens.

[1] 69c63311fa

Pull Request: https://projects.blender.org/blender/blender/pulls/132381
2024-12-27 21:46:48 +01:00
Jonas Holzman
b99497bf21 macOS: Fix path icon not being cleared when creating a new file
This commit fixes a small bug where the macOS native titlebar file path
icon (often referred to as proxy icon) wouldn't be cleared when creating
a new blank file and would instead retain its previous state. This was
caused by the GHOST setPath() function being short-circuited by the
&& operator, since `has_filepath` was false. The GHOST WindowCocoa
setPath() function was also simplified to remove unneeded exception
handling.

Pull Request: https://projects.blender.org/blender/blender/pulls/132359
2024-12-27 18:15:23 +01:00
Ray Molenkamp
ebb7bdd922 Cleanup: CMake: Modernize bf_sequencer dependencies
Pretty straightforward

- Remove any bf_sequencer paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/132358
2024-12-27 17:44:02 +01:00
Aras Pranckevicius
2720bd529d Refactor: split off VSE effects code into separate files
Part of #130975: split off overly large VSE effects.cc (almost 4000
lines) into separate source files. No behavior changes.

- Add / Subtract / Multiply all go into one source file,
- Blend Over / Blend Under / Over Drop / other blend modes all go
  into one source file,
- Cross and Gamma Cross go into one source file,
- All others go into their own files.

Pull Request: https://projects.blender.org/blender/blender/pulls/132323
2024-12-27 12:52:38 +01:00
Omar Emara
d4008562dd Fix #131552: Backdrop has a wrong size of 256x256
The compositor backdrop in certain files always have a size of 256x256
regardless of the actual size of the viewer image. That's because the
compositor writes its result to a different image buffer than the one
the image engine reads its image buffer from. And the image engine
assumes a default size of 256x256. The reason is a bit involved.

For non multi-view images, the image module uses the special cache index
value of IMA_NO_INDEX for the compositor backdrop, which works fine if
the image was detected as a non multi-view image in the first place.
However, this detection fails because the compositor may still write
multi-view images even for non multi-view renders.

In particular, before the compositor writes its viewer image, it ensures
correct views by calling BKE_image_ensure_viewer_views, which first
checks if we need to recreate the views of the viewer image if they
don't match the render views. And in the case of non multi-view image,
that check fails in one case.

Functions like BKE_image_is_multiview checks if a single unnamed view
exists in the image, unnamed being the keyword here. The root issue is
that BKE_image_ensure_viewer_views only checks that a single view
exists, while it should also check that it is unnamed. Which happens
when the user enabled multi-view, added only one view, then disabled
multi-view again.

To fix this, we add a check for the name of the view in case of non
multi-view images. And additionally pull the view matching code into its
own documented utility function for clarity.

Pull Request: https://projects.blender.org/blender/blender/pulls/132348
2024-12-27 12:09:41 +01:00
Iliya Katueshenock
b3762d5820 Fix #124499: improve maximum instance recursion error message
Mentioning the object and geometry name can help track down the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/124976
2024-12-27 12:03:03 +01:00
Omar Emara
ca2462ef2a Fix: Legacy Cryptomatte asserts with invalid inputs
The Legacy Cryptomatte node asserts when its inputs are not valid,
that's because it is specialized for image inputs and invalid inputs are
single values. To fix this, make sure only valid Cryptomatte layers are
considered.
2024-12-27 09:51:06 +02:00
Philipp Oeser
9759e532d2 Fix #132264: Vertex Edge slide wrong
Caused by 580e0af309

The above commit fixed the condition that caused the hang in #128702 but
it also changed the `while` loop to a `do while`.
The do while loop executes the content of the loop once before checking
the condition of the while.
Whereas a while loop will check the condition first before executing the
content.

As a consequence, we could (falsely) enter the loop and return with a
(false) best direction.

To resolve, keep the check from 580e0af309 but go back to a `while`
loop (instead of the `do while).

Needs to go into 4.2 LTS

Pull Request: https://projects.blender.org/blender/blender/pulls/132270
2024-12-27 07:07:44 +01:00