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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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.