New functionality to export armatures and shape keys as USD
skeletons and blend shapes.
Added "Armature", "Only Deform Bones" and "Shape Key" USD export options.
Added USDArmatureWriter class.
Extended USDMeshWriter to write skinned meshes for binding
with skeletons and 'neutral' meshes with blend shape targets.
Specifically, when exporting an armature, a skinned mesh is written
in its pre-modified rest position. When exporting to blend shapes,
a mesh with shape keys is saved with its vertices in the shape key
basis shape position.
Added USDHierarchyIterator::process_usd_skel() function to
finish processing skeleton and blend shape export after the
writer instances completed writing. This is necessary because
some of the export operations require processing multiple prims
at once.
Extended USDTransformWriter::do_write() to write transforms
sparsely, to avoid saving redundant transform values when exporting
armatures.
Added a create_skel_roots() function, called on the stage at the
end of the export. This function attempts to ensure that skinned
prims and skeletons are encapsulated under SkelRoot primitives,
which is required in USD for correct skinning behavior.
When exporting blend shape animations for multiple meshes bound
to a single skeleton, we need to merge the blend shape time samples
of the different meshes into a single animation primitive at the end
of the export. This requires some tricky book keeping, where the weight
time samples for a given mesh are initially saved by the mesh writer to a
temporary attribute on the mesh and are later copied to the animation
primitive as one of the final steps.
When writing blend shapes and skinned meshes, the pre-modified mesh
is exported. This is to ensure that the number of blend shape offsets
matches the number of points, and so that the skinned mesh is saved in
its rest position.
Because the pre-modified mesh must be exported, modifiers in addition
to Armature modifiers will not be applied. This still allows the round trip
UsdSkel -> Blender -> UsdSkel, but some additional setup might be
required to export to UsdSkel when there are multiple modifiers (for
example, applying mirroring modifiers that precede the armature
modifier).
Exporting bendy bones or absolute shape keys isn't currently
supported.
Co-authored-by: Charles Wardlaw <charleswardlaw@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/111931
Fixes an issue where triangles (and possibly lights) would not be added
to the light tree if the only visibility option it has enabled is volumetric
scattering.
This would lead to an assert during forward sampling because the light
would be treated as if it was in the light tree, and a light index
outside the light tree array would be sampled, which would trigger
the assert.
Pull Request: https://projects.blender.org/blender/blender/pulls/116703
Add a read-only property `bone_collection.parent` to RNA that returns
the parent bone collection.
This performs two scans of the array (one to find the bone collection's
index, and the other to find the parent index). This might look bad, but
as long as `Object.children` still loops, in Python, over all of
`bpy.data.objects`, this should also be acceptable.
This adds some `#line` directive between the
source file injection so that the log parser knowns
which file the errors originated from.
This is then followed by a scan over the combined
source to find out the real row number.
This needed some changes in the `Shader::plint_log`
to skip lines to avoid outputing redundant information.
Now that we only redraw (and push undo steps for) changed PBVH nodes,
we need to do that for the case where everything is visible and we
remove the face set attribute. Extract that to a separate function in
order to keep the optimization to only do work for changed PBVH nodes.
All curves are drawn cyclic despite "Cyclic" state in redo panel if at
least one was created cyclic. Also patch adds support of "Cyclic" in
redo panel for "Poly" curves. It is ignored in "old curve" draw tool.
Pull Request: https://projects.blender.org/blender/blender/pulls/116638
Using a non-null background brush does remove an initial white flash
while the program is loading and before we start painting. But this
results in some extra and unnecessary redraws. Default WM_ERASEBKGND
behaviour is to do nothing if this is brush is null, so if non-null we
get erased and must redraw. Suppressing WM_ERASEBKGND will not give us
that initial paint, so no benefit in keeping the brush added in #115968.
Pull Request: https://projects.blender.org/blender/blender/pulls/116642
Caused by 2a1ac6145a
If the attribute creation failed, the modifier would try to fill in a
null UV map. The combination of CustomData and attribute API functions
was a bit confusing, so restore the old behavior more explicitly using
just the attribute API (including the slightly weird "Float2" default
name. That could be changed later.)
Simplifies the code in this area, makes it work better with other C++
code. The max length argument isn't used anymore. But at that point we
wouldn't necessarily have a unique name anyway, which opens up for other
failures.
Followup to #114755. Initialize operation results explicitly if the input is constant. This patch unifies the size inference behavior of the following nodes/operation:
- Flip node
- Kuwahara (classic)
- Lens distortion
- Tonemap node
Pull Request: https://projects.blender.org/blender/blender/pulls/115733
Add custom properties to Action Bake.
objects will bake all animatable custom properties. Armatures will bake all bone custom properties,
as well as object (armature) custom properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/113208
Horizotal blur is achieved when ratio is `< 1` but it's not possible
to slide below 1. So make softmin=hardmin (0.01) to give more control
in user interface.
Pull Request: https://projects.blender.org/blender/blender/pulls/116625
Add a Python unit test that covers some of the armature/bone collections.
Some of these tests cover the same functionality as the C++ tests, albeit
via the Python/RNA API.
Another test was added to check that joining armatures works as expected.
The armature join operation should preserve custom properties,
as described in the comment in the code. Previously this was
achieved by reusing the collection instances from the armature
being joined, but it was changed to create a new instance. However,
property copying was not implemented, which breaks Rigify.
This fix adds property copying behavior back.
Pull Request: https://projects.blender.org/blender/blender/pulls/116626
This adds option to bypass the raytracing pipeline
entirely and use a cheaper evaluation option.
This reuse the same evaluation as the Blended materials.
This exhibits some artifacts on Apple hardware due to
synchronization issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/116622
In the last couple places, avoid retrieving the mask attribute per
vertex. Use existing attribute data pointers instead. This also avoids
function calls and branches for every vertex, since there is no PBVH
type switch at the lowest level of the loop anymore.
The cloth filter accesses the vertex mask for every length constraint.
Previously that used a cached pointer, but that was removed, and then
the access was changed to use the attribute API, which is slower since
it isn't designed to be accessed for every element. The solution is
to just let the PBVH type abstraction "leak" when accessing mask data.
Avoid the `PBVHVertRef` abstraction which is unnecesarily costly for
such a simple thing as copying data. Instead we can use abstractions
specific to each PBVH type (currently only `VArray` for meshes).
Previously they shared the same implementation with a check per vertex
for whether to smooth the mask or the positions. Though it adds a bit
of duplication for now, everything else becomes simpler if the brush
implementations are split.
Added support for importing USD instanceable primitives into Blender
as collection instances.
Added a new USDInstanceReader class for importing USD
instances as Blender objects that instance collections containing
prototype data.
Extended the USDStageReader to read USD prototype prims into
collections that are instanced on the objects created by the instance
readers.
Removed the "Import Instance Proxies" import option.
Importing instances is enabled with a new "Scene Instancing" import
option, which is true by default. If this option is off, instances will be
imported as copies (which is the functionality previously enabled by
the "Import Instance Proxies" option).
Removed calls to UsdSkelBindingAPI::Apply() in the skeleton and
blend shape import code, as these calls were unnecessary and were
generating errors when importing instance prototypes with UsdSkel
data.
Nested instancing and animated prototypes are supported.
Pull Request: https://projects.blender.org/blender/blender/pulls/115076
Make it possible to nest bone collections. The data structure on the
armature is still a flat array. It is organised as follows:
- Sibling collections (i.e. ones with the same parent) are stored
sequentially in the array.
- Each bone collection keep track of the number of children, and the
index of the first child.
- Root collections (i.e. ones without parent) are stored as the first
elements in the array.
- The number of root collections is stored on the Armature.
This commit also contains the following:
- Replaced the flat UIList of bone collections with a tree view.
- Updated the M/Shift+M operators (move/assign to collection) to work
with hierarchical bone collections.
- Updated RNA interface to expose only root collections at
`armature.collections`. All collections are available on
`armature.collections.all`, and children at `bonecollection.children`.
- Library override support. Only new roots + their subtrees can be added
via overrides.
See https://projects.blender.org/blender/blender/issues/115934
Co-authored with @nathanvegdahl and @nrupsis.
Pull Request: https://projects.blender.org/blender/blender/pulls/115945
Instead of `Collections`, describe a section as `Collection Properties`.
Otherwise it's ambiguous whether it's about that or specifically bone
collections.
No functional changes.
Remove the `OPTYPE_REGISTER` flag, to ensure the operators do not pop up
their redo panel. The flag is removed where the operator properties are
set by Python code, instead of chosen by the user. For example, it doesn't
make much sense to change which bone collection is used by the operator by
typing the name of another bone collection.
This could be revisited when Blender supports "nested enum" properties,
to make it possible to choose an item in an entire hierarchy.
Rename `bonecoll_find_index` to `armature_bonecoll_find_index` (because
it takes a `bArmature*` parameter), and move it from a static function into
the `blender::animrig` namespace. It will be used externally in upcoming
commits.
No functional changes.