Commit Graph

116109 Commits

Author SHA1 Message Date
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Harley Acheson
72a9990779 Fix #92998: Allow UI List Reversed Alpha Sort
UI Lists has some buttons at the bottom related to sorting. One button
sorts in alphabetical order, the other reverses sort order. But when
both buttons are enabled you don't get reserved alpha. Contrary to what
the buttons show, enabling "reversed" turns off alpha sorting so you
just get a reversal of the natural order. This button fixes that so you
can reverse both natural and alpha sorted lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/132578
2025-01-03 02:28:51 +01:00
Iliya Katueshenock
fa8574b80b Fix: Geometry Nodes: Triangulate Mesh node assertion case
Typo from ea875f6f32.
A range of triangles is pushed into the mask, but _last_ instead of _end_
was  used. This was found in #132333 report, but this PR does not fix a
reported issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132405
2025-01-03 01:42:39 +01:00
Charles Wardlaw
0c544974d1 USD: option to convert the scene's meters per unit value
This rescales the whole scene by its root transform to match the same
visual size while not forcing the user to wait for scale to be applied to
each object.

This is requested by studios whose main applications / USD scenes are
in CM, because referencing and payloading scenes from disparate scales
can cause issues at resolution time.

If "Apply Unit Scale Conversion" is unchecked on import, the user now
has the ability to bring the objects in with a scale factor of 1.0, so that the
objects may be edited as if Blender's scene units matches the imported
stage's.

At export time, a "Stage Meters Per Unit" value can be chosen from a list
of common measurements, as well as setting a custom value.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122804
2025-01-02 22:04:58 +01:00
Hans Goudey
64087c70d5 Cleanup: Move some mesh normals functions to C++ API
Use C++ namespace, reference instead of pointer, and span instead
of raw pointers, mainly to make these functions easier to use in a
few more places.

Pull Request: https://projects.blender.org/blender/blender/pulls/132561
2025-01-02 20:32:47 +01:00
Ray Molenkamp
5783950ac5 Revert: 0dc484f9cc bf_rna modernisation
This caused build errors on the docs builder, I can't seem to reproduce
locally, so revert for now and have another look at some point in the
future.

Sadly as these changes usually go, this took 5c515e26bb and
2f0fc7fc9f with it as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/132559
2025-01-02 19:56:24 +01:00
Sean Kim
37c3c70150 Fix #122078: Color Filter redo panel doesn't work occasionally
When a file is initially loaded or when the redo panel is used, the PBVH
may be null on an object. Because this filter requires the PBVH to check
the underlying mesh representation to prevent execution on Dyntopo &
Multires, we need to ensure that the PBVH is built.

This commit changes the `pbvh_get` call into a `pbvh_ensure` call and
moves some variable declarations around to avoid holding onto runtime
data that may get wiped out by requesting the evaluated depsgraph.

Pull Request: https://projects.blender.org/blender/blender/pulls/132048
2025-01-02 18:42:21 +01:00
Hans Goudey
3dab0b94eb Fix #131883: Animating particle system hair segment count causes crash
This property should not be animateable; there are fundamental limitations
in the design of the system that makes it disfunctional.

Pull Request: https://projects.blender.org/blender/blender/pulls/132557
2025-01-02 17:51:27 +01:00
Omar Emara
4ad1537ff7 Fix: Compositor: Conversion code might fall through
The recently added switch statements in conversion code might fall
through due to missing breaks. Fix that by adding needed breaks.
2025-01-02 17:43:09 +02:00
Christoph Lendenfeld
2d1fc1bcdd Fix #132195: Unable to key mesh attributes
The issue is that certain RNA paths cannot be generated to come
from an ID and `RNA_path_from_ID_to_property` will return no value.
We are using that function in the keyframing code to allow passing
in a pointer to a bone and a path relative to that bone.
Since there is currently no good way to find the path from the ID to an arbitrary
struct pointer (see #122427), this patch is a workaround that uses
the struct_pointer IF that happens to be an ID pointer.
Of course that still has the core limitation in place but until a
better solution is available on the RNA side this is the best we can do.

Pull Request: https://projects.blender.org/blender/blender/pulls/132552
2025-01-02 16:39:21 +01:00
Sean Kim
3c7041c11e Fix #132528: Mask by color crashes when used outside of mesh
Caused by a0e6e16da5

In cases where the cursor is not over the mesh, the operator needs to
check for and prevent further operation to avoid accessing incorrect
variant data.

In prior versions, while this operator did not crash, it would read
other custom layer data.

Pull Request: https://projects.blender.org/blender/blender/pulls/132538
2025-01-02 16:35:10 +01:00
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