Commit Graph

144921 Commits

Author SHA1 Message Date
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
Sean Kim
9e78f1c840 Paint: Rename 'Frame Selected' Menu operator to 'Frame Last Stroke'
This commit better aligns the naming of this operator to what it does in
Sculpt, Vertex Paint, Weight Paint, and Texture Paint

Ref: #84044

Pull Request: https://projects.blender.org/blender/blender/pulls/132248
2025-01-02 18:11:39 +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
Brecht Van Lommel
0ae67b798b Fix: OptiX kernel build does not respect CUDA_HOST_COMPILER option 2025-01-02 17:03:58 +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
Brecht Van Lommel
a3a104f97a Clang Tidy: Ignore some newer readability warnings
These patterns are very common throughout the Blender codebase, which makes
the clang-tidy output and using clangd in an IDE quite noisy. They were introduced
in LLVM version 18 and 19.

* readability-math-missing-parentheses
* readability-avoid-nested-conditional-operator
* readability-enum-initial-value
* readability-avoid-unconditional-preprocessor-if

Pull Request: https://projects.blender.org/blender/blender/pulls/132462
2025-01-02 16:22:44 +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
Christophe Hery
ddbb3d673c Cycles: Optimize out default normals setups in case of OPENSUBDIV Catmull-Clark
Simple local optimization: not doing the rather expensive normals setups
(face and vertex) for Catmull-Clark subsivisions (which do not make use of
these normals and regenerate them internally).

Pull Request: https://projects.blender.org/blender/blender/pulls/132469
2025-01-02 15:20:57 +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
Sybren A. Stüvel
426d1683ee Import: explicitly create & assign action slots when importing BVH/FBX
Explicitly create & assign an action slot when importing animation data
from BHV and FBX files.

Ideally this fix wouldn't be necessary, and it's still my wish to have
stronger backward compatibility of the Python API. When/if we have that,
this commit could be reverted.

Fixes: #131305

Co-authored-by: Philipp Oeser <philipp@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/131360
Pull Request: https://projects.blender.org/blender/blender/pulls/131380
Pull Request: https://projects.blender.org/blender/blender/pulls/132549
2025-01-02 14:11:39 +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
b109f26e05 Fix #131814: Cycles bake crash with geometry nodes instances
Don't rely on object name matching, this is not reliable when there
can be multiple instances with the same name.

Pull Request: https://projects.blender.org/blender/blender/pulls/132496
2025-01-02 12:48:21 +01: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
94917bfd58 Cleanup: correct typo in class name 2025-01-02 19:15:42 +11:00
Campbell Barton
0b0fddb614 Cleanup: use type hints for the QtCreator project generator
Also resolve some warnings for project_info.py.
2025-01-02 17:06:56 +11:00
Campbell Barton
bb0fd51b3c Fix project_qtcreator generator
Correction to [0] which looks to have missed
relocating some scripts.

Also revert Python 3.6 compatibility as it's not required for tools.

[0]: e83d87f588
2025-01-02 17:03:10 +11:00
Campbell Barton
7516614c2b Fix source checking tools using project_source_info
Moving files in [0] caused the module not to be found.

Also revert Python 3.6 compatibility changes.

[0] 2c9ab53273
2025-01-02 16:57:51 +11:00
Campbell Barton
030f367c33 Tools: remove project_netbeans
Remove the script that converted an eclipse project to netbeans,
it seems unlikely this was widely used since it wrote to an old/outdated
project file format.

Since this was written, most IDE's (including NetBeans) have improved
their CMake support.
2025-01-02 16:01:17 +11: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
7481355397 Cleanup: scripts, unused variables & re-declaring built-ins 2025-01-02 15:11:15 +11:00
Campbell Barton
d64bd41ee9 Cleanup: wrap long lines 2025-01-02 15:11:14 +11:00
Campbell Barton
54e655f06a PyDoc: correct unbalanced back-tick 2025-01-02 15:03:54 +11:00
Campbell Barton
5fbd22ea67 CMake: mark non WITH_* variables as advanced
Also correct case for Tiff_DIR variable which wasn't being
marked as advanced.
2025-01-02 15:03:52 +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
Alaska
6d7b0c56c9 Fix: Texture Coordinate Object output referencing a object is incorrect in the world shader with OSL
The Texture Coordinate node has a "Object" output that can be
derived from the object being sampled, or a reference object.

With Cycles OSL, the "Object" output of the Texture Coordinate
would not use the reference object if one was active, and the
node was used on a world shader.

This commit fixes this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132515
2025-01-02 03:41:38 +01:00
Alaska
0bfb6e41f2 Fix: Texture Coordinate normals are not normalized in Cycles OSL
The output normals of the Texture Coordinate node when using the OSL
backend were not normalized, leading to incorrect values in
some situations.

This commit fixes this issue by normalizing the normals in this situation.

Pull Request: https://projects.blender.org/blender/blender/pulls/132514
2025-01-02 03:40:55 +01: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
nutti
848ec77911 Fix: PyDocs: Title inconsistency on bpy.types.USDHook
Due to 8285d2d, titles "Inherited Properties" and "Inherited Functions" become hidden.
This PR fixes this issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132481
2025-01-01 07:40:37 +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
Brecht Van Lommel
6a15f301ef Revert "Fix: Missing super().__del__() in Cycles and Hydra render engine"
This is leading to "'super' object has no attribute '__del__'" errors
in some situations. As explained in #132476 this is only for future
proofing, so don't do it yet.

This reverts commit f301952b6a.
2024-12-31 19:30:39 +01:00