Age | Commit message (Collapse) | Author |
|
This line looks a mistake and it's not needed.
|
|
Needed for clang formatting to workaround bug/limit, see: T53211
|
|
|
|
|
|
Helps separate variable names from descriptive text.
Was already used in some parts of the code,
double space and dashes were used elsewhere.
|
|
Applying the effect of bone parent is much more complicated than
simple matrix multiplication because of the various flags like
Inherit Scale. Thus it is reasonable to provide access to this
math from Python for complicated rest pose related manipulations.
The simple case of this is handled by Object.convert_space, so
the new method is only needed for complex tasks.
Differential Revision: https://developer.blender.org/D4053
|
|
|
|
|
|
Use BKE_pchan_bbone prefix.
|
|
B-Bone shape is a non-trivial computation, so access to
the results would be useful for Python scripts working with
B-Bones, e.g. rig generation.
This exposes both final segment matrices, and the tangent
vectors computed from the custom handle bones.
Since the handle tangents use the axis+roll orientation math
of edit bones, add matrix conversion static methods to Bone.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3983
|
|
Computing the shape of a B-Bone is a quite expensive operation, and
there are multiple constraints that can access this information in
a variety of useful ways. This means computing the shape once per
bone and saving it is good for performance.
Since the shape may depend on the position of up to two other bones,
often in a "cyclic" manner, this computation has to be a separate
node with its own dependencies.
Reviewers: sergey
Differential Revision: https://developer.blender.org/D3975
|
|
|
|
|
|
|
|
Previously each of the objects which has armature modifier will
request deformation matricies from bbones. Thing is, all those
deformations are the same and do not depend on object which is
being modified. What's even worse is that this calculation is
not cheap.
This change makes it so bbones deformation is calculated once
and stored in the armature object. After this armature modifiers
simply use it.
With a rigs we've got here dependency graph evaluation time
goes down from 0.02 sec to 0.012 sec.
Possible further optimization is to make bbone deformation
calculated at the time when bone is calculated. This will avoid
an extra threaded loop over all bones.
|
|
|
|
|
|
|
|
|
|
@jpbouza was rather upset these were made read-only, and unlike
parents, it's not that hard to allow changing these Bone fields:
all is needed is to carefully refresh the matching fields in the
relevant bPoseChannel objects and properly tag update.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3870
|
|
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D3802
|
|
|
|
This also fixes a stability problem with the start handle
due to an incorrect matrix multiplication order.
|
|
Both original handle types are based on location, and Absolute uses it
in a weird way: the Start handle uses the head, while End uses the tail.
This makes controlling the shape of the B-Bone via control bone rotation
really non-intuitive, especially if trying to add a single control for
the tangent in the middle of a B-Bone chain.
To remedy this, add a new custom handle type that uses the orientation
of the control bone, while completely ignoring location. It is even
possible to control both ends of one B-Bone with the same handle bone,
resulting in an S shape.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3769
|
|
Specifically, it should always use the position of the custom handle
bone head, even when affecting the handle at the tail of the main bone,
and shouldn't apply the special handling for joining two B-Bones.
This handle type was unusably broken before a bug fix included in
recent changes, so it should be safe to break backward compatibility.
|
|
The rest shape of B-Bones is actually affected by custom handles or
the default connected parent/child mechanism. Ignoring these effects
thus leads to the edit mode shape being different from the actual
rest pose.
This splits the b_bone_spline_setup function that is used to compute
the correct rest and pose shape from pose channels into two parts,
and applies the data structure independent half to edit mode.
In order to access the custom handle settings in Edit Mode, they are
moved to Bone and EditBone, while the bPoseChannel fields are downgraded
in status to a cache for performance. Also, instead of flags, introduce
an enum to specify the handle operation modes, so that new ones could
be added later.
Reviewers: aligorith, brecht
Differential Revision: https://developer.blender.org/D3588
|
|
Custom handle settings actually affect the B-Bone rest shape,
so they should be changed in Edit mode rather than Pose mode.
This is necessary to be able to display the correct rest shape
of the bone in Edit Mode.
Also, instead of flags, introduce an enum to specify the handle
operation modes, so that new ones could be added later.
Differential Revision: https://developer.blender.org/D3588
|
|
|
|
If the point had several weights, the result could be wrongly accumulated.
|
|
Differential Revision: https://developer.blender.org/D3719
|
|
Terms get/set don't make much sense when casting values.
Name macros so the conversion is obvious,
use common prefix for easier completion.
- GET_INT_FROM_POINTER -> POINTER_AS_INT
- SET_INT_IN_POINTER -> POINTER_FROM_INT
- GET_UINT_FROM_POINTER -> POINTER_AS_UINT
- SET_UINT_IN_POINTER -> POINTER_FROM_UINT
|
|
|
|
The armature was using only weight 1 or 0, but not the real value.
Also removed unused parm in UI panel.
|
|
This commit adds a new armature modifier for grease pencil. The deformations are done reusing the mesh deform routines.
There is also a new operator in weight paint mode to help the artist to generate weights base on armatures. This operator is required because 2D animation workflow is not equal to meshes when parent an object to armatures.
In the drawing engine has been added the option to handle the Fade object parameter used in armatures to see the strokes while move the bones.
When rename bones, all related data of grease pencil is renamed too. This not only affect new armature code, but also layers parented and hook modifiers.
Thanks @aligorith for his review and help.
|
|
|
|
Some constraints have an option to take the final bezier shape of
the target B-Bone into account. This shape usually depends on two
other bones in addition to the target itself, so the graph should
include the relevant dependencies.
Reviewers: sergey
Differential Revision: https://developer.blender.org/D3591
|
|
This solves wrong user counter of custom shape when duplicating bone
few times and then undoing all the duplications.
|
|
`BKE_pose_rebuild()` should (ideally) always trigger a rebuild of the
depsgraph, since it can add or remove posechannels.
This function now takes a Main parameter to ensure that related
depsgraphes are tagged as dirty (kept it optional, for some corner cases).
We should also probably double-check calls to that function, think in
theory it should only be called from depsgraph itself? But for now...
|
|
|
|
|
|
|
|
Differential Revision: https://developer.blender.org/D3438
|
|
No idea why that was working this morning, now we do not get CoW tag
anymore (which kind of makes sense since it's set *after* copying
happens...), so just resorting to using the NO_MAIN flag instead.
|
|
broken-used-as-feature one from 2.7.
Locked bones of proxies should not be editable, at all. But lack of
update from linked rest pose in 2.7 allows to pose and animate locked
bones (not to pose them without animation though, or you'd lose your
pose on next file save & reload).
this is used by artists to always lock all their bones in a rig, so that
proxies fully update when lib rig is modified...
For now, restore that broken behavior in 2.8 by not updating proxies
against lib armature in CoW context (makes sense anyway, we are
currently doing a lot of useless thing when copying data for depsgraph
evaluation!).
|
|
|
|
The mesh parameter of armature_deform_verts() is now const, to indicate
that it's safe to pass ob->data to it directly.
|
|
While the feature is interesting, it's not much from what we can tell.
Retargeting is an important feature but needs
to fit in better with typical animation work-flows.
See: T52809
|
|
The depsgraph was always created within a fixed evaluation context. Passing
both risks the depsgraph and evaluation context not matching, and it
complicates the Python API where we'd have to expose both which is not so
easy to understand.
This also removes the global evaluation context in main, which assumed there
to be a single active scene and view layer.
Differential Revision: https://developer.blender.org/D3152
|
|
- Undo that changes modes currently asserts,
since undo is now screen data.
Most likely we will change how object mode and workspaces work
since it's not practical/maintainable at the moment.
- Removed view_layer from particle settings
(wasn't needed and complicated undo).
|
|
|