This PR adds support for 2 additional USD Prim Shape Schemas :
* Cylinder_1
* Capsule_1
Additional tests will be added afterwards but a simple test is simply to
import the resulting file:
```python
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateNew('shapes.usda')
UsdGeom.Xform.Define(stage, '/world')
UsdGeom.Cylinder_1.Define(stage, '/world/cylinder_1')
UsdGeom.Capsule_1.Define(stage, '/world/capsule_1')
stage.GetRootLayer().Save()
```
Linked issue : https://projects.blender.org/blender/blender/issues/134138
Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134944
USD identifiers cannot start with a digit and, like all unsupported
characters, they will be turned into an `_`. This is a bit unfortunate
since object names like "1" or "2" both become "_" in the output file.
This not only generates a naming collision, which is not currently
handled, but it needlessly loses information even when there is no
collision.
Treat leading digits separately and turn names like "1" and "2" into
"_1" and "_2" respectively. This will allow us to eventually enable the
`light_tree_node_subtended_angle` render test which uses such names for
the lights. Another recent test required investigation and then rework
due to the same problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/134595
* Slightly changes naming to be more explicit in some places
* Updates comments
* Adds const where possible
* Reduces scope of variables
* Uses references where possible
Pull Request: https://projects.blender.org/blender/blender/pulls/134891
This shared state between original data and depsgraphs was added in
98a0bcd425. Other physics systems also share
the pointcache, but not the simulation state to this extent, which leads
to this kind of crash.
The mutex lock is not a great solution, you don't really want both render and viewport to be filling the same cache in parallel. However
this kind of problem also exists in other physics systems, and solving
that is certainly beyond the scope of 4.4, and probably needs to wait
for a bigger physics rewrite. In general the recommendation is to bake
everything before rendering.
Pull Request: https://projects.blender.org/blender/blender/pulls/134779
The issue was that in the macro used, the wrong ID was passed into
the rename function. Since nodetrees are a separate embedded ID,
the rename function couldn't resolve the RNA path and thus failed.
This broke keys and drivers when renaming nodes.
Not only for the compositor, but all node trees.
This was caused by 1c7c1829b6
Pull Request: https://projects.blender.org/blender/blender/pulls/134936
The previous fix 8f00f068ad
doesn't work as the printf buffer gets recreated.
Ensure render boundaries at lower level and do the printf
flush manually.
Subdivision shaders currently fail to compile using Metal as it doesn't recognize
packed_float3 as an internal data type. This PR includes packed_float3 as an
internal data type.
Without this `blender --debug-gpu-compile-shaders` will fail as it includes a namespace.
```
ERROR (gpu.shader): subdiv_normals_accumulate Compute Shader:
|
| source/blender/gpu/metal/mtl_shader_generator.mm:971:9: Error: no type named 'packed_float3' in 'MTLShaderComputeImpl'; did you mean simply 'packed_float3'?
|
| device MTLShaderComputeImpl::packed_float3* normals[[buffer(MTL_storage_buffer_base_index+4)]],
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| packed_float3
|
| /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/32023/Libraries/lib/clang/32023.196/include/metal/metal_packed_vector:145:58: Note: 'packed_float3' declared here
|
| typedef __attribute__((__packed_vector_type__(3))) float packed_float3;
| ^
```
Pull Request: https://projects.blender.org/blender/blender/pulls/134925
This adds three new functions to find the first 0 or 1 bit in an arbitrarily
long bit span:
```cpp
blender::bits::find_first_0_index(BitSpan) -> std::optional<int64_t>
blender::bits::find_first_1_index(BitSpan) -> std::optional<int64_t>
blender::bits::find_first_1_index_expr(Expr, BitSpans...) -> std::optional<int64_t>
```
The two first ones are implemented in terms of the third. The `*_expr` variant
allows e.g. finding the first set bit when ORing two bit spans together without
computing the entire intermediate result first. Or it can be used to find the
first index where two bit spans are different.
Pull Request: https://projects.blender.org/blender/blender/pulls/134923
This happend for meshes without UVs.
The call to `texpaint_request_active_uv` in
`DRW_mesh_batch_cache_get_surface_edges` is from 9c010c44f4.
Looks like this is not needed (assumed to be copy paste error).
Pull Request: https://projects.blender.org/blender/blender/pulls/134856
In the Vertex Weights panel of the 3D Viewport sidebar, allow for
normalization of vertex groups when any number of vertex groups are
locked.
As with other normalization operators that handle locked vertex groups,
locked weights are summed, and whatever space is left between that sum
and 1.0 is used to normalize the unlocked weights.
Pull Request: https://projects.blender.org/blender/blender/pulls/134535
Make `action_channelbag_ensure()` and `action_fcurve_ensure()` return a
reference. Earlier it returned pointer that should never be `nullptr`,
but in certain cases (which would indicate a bug, as the function's
preconditions aren't met) could technically still be a `nullptr`.
Instead, the preconditions are checked with `BLI_assert()`, and a
release build will simply assume that they are met. This simplifies the
code of the functions themselves, as well as the callers.
For reference: this was discussed in !134866.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/134918
Over time the `FCurveDescriptor` class has grown, and some concern was
raised (!134866) about the performance impact of passing it by value.
It's now passed by const reference instead.
No functional changes. I did find some non-`const` uses that are now
also `const`.
Pull Request: https://projects.blender.org/blender/blender/pulls/134913
Subdiv shader library contains an optional part that shaders can include.
As we are migrating each shader at a time there are now multiple PRs doing
the same thing. Best to add the changes to main already so it doesn't add
confusion during review.
Pull Request: https://projects.blender.org/blender/blender/pulls/134906
This commit contains the following changes:
* Reduces scope of variables where possible, joining declaration and
assignment where necessary.
* Uses const for parameters and local variables where possible.
* Uses static_cast or reinterpret_cast where possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/130487
* Reduces scope of variables
* Joins declaration and assignment where possible
* Uses static_cast and reinterpret_cast instead of C-style cast
* Uses const where possible
* Uses reference instead of pointer where possible
Pull Request: https://projects.blender.org/blender/blender/pulls/134816
The `BKE_fcurve_bezt_shrink()` function had an artificial limitation to
only allow shrinking the `bezt` array. That limitation is now removed,
and therefore the function renamed to `BKE_fcurve_bezt_resize()`.
A note was added to the documentation that newly added array elements
should be initialized by the caller.
Pull Request: https://projects.blender.org/blender/blender/pulls/134864
Split the majority of `animrig::action_fcurve_ensure()` into a new
function `action_channelbag_ensure()`. This ensures that the Action has
a layer, keyframe strip, action slot, and channelbag for the given ID.
`animrig::action_fcurve_ensure()` now just calls into that function, and
then ensures that there is an F-Curve in that channelbag.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/134864
Followup to 48e26c3afe, and discussions in !134771 about keeping
'C-style' and 'C++ template type-safe style' implementations of our
guardedalloc separated. And it makes `MEM_freeN<T>` code simpler.
Also skip type-checking in `MEM_freeN<T>` only with MSVC, as clang-cl on
windows-arm64 does work fine with DNA structs using
`DNA_DEFINE_CXX_METHODS`.
Pull Request: https://projects.blender.org/blender/blender/pulls/134861
Hydra's viewport and final engines conflict on whether the rendering loop
is internal or external. The old approach works for Hydra Delegates that
converge with a single sample (hdStorm) but causes engines relying on sample
accumulation (hdEmrbee) to become stuck.
This minimal change retains compatibility with delegates like Storm while
replicating the behavior of the viewport engine in the final engine.
Pull Request: https://projects.blender.org/blender/blender/pulls/134804
The Grease Pencil extrusion operator didn't transfer the vertex group names
from the old `CurvesGeometry` to the new one, resulting in the `gather_attributes`
function not transferring the vertex group weights correctly. This PR adds
`BKE_defgroup_copy_list` to the operator to remedy this.
Pull Request: https://projects.blender.org/blender/blender/pulls/134695
This patch adds support for vector outputs in the Image node.
Previously, only float and color outputs were supported, and vector
outputs were implicitly treated as color ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/134501
The interpolation tool is using stroke length to map points between strokes with
uneven number of points. This fails when a source stroke has zero length (all points
in the same location).
Added a special case check to ensure uniform mapping by index is used in this case.
Segment mapping has been moved to a separate function for clarity.
Pull Request: https://projects.blender.org/blender/blender/pulls/134849
Previously, the vector type in the compositor had 4-components to
accommodated float4 types, while the last component was ignored for the
rest of the vector types. But now that we have a dedicated type for
float4 in #134486. We can reduce that vector type to 3-components.
Pull Request: https://projects.blender.org/blender/blender/pulls/134570