Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2022-01-10 21:09:03 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-01-11 18:07:56 +0300
commit4cd7c8fc05d080588abf40ab3cdee68238e5fa27 (patch)
treec522d6357ab274988834374747d301e7204bdbb1 /rigify/rigs/limbs/limb_rigs.py
parented42feaed565f5d21f10b05eee1f985a14f3cf11 (diff)
Rigify: refactor leg to make modifying the foot roll mechanism easier.
Diffstat (limited to 'rigify/rigs/limbs/limb_rigs.py')
-rw-r--r--rigify/rigs/limbs/limb_rigs.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/rigify/rigs/limbs/limb_rigs.py b/rigify/rigs/limbs/limb_rigs.py
index 2e6fe538..ddcccd4d 100644
--- a/rigify/rigs/limbs/limb_rigs.py
+++ b/rigify/rigs/limbs/limb_rigs.py
@@ -1026,32 +1026,37 @@ class RigifyLimbIk2FkBase:
mat = convert_pose_matrix_via_rest_delta(mat, ik, ctrl)
set_transform_from_matrix(obj, ctrl.name, mat, keyflags=keyflags)
+ def assign_extra_controls(self, context, obj, all_matrices, ik_bones, ctrl_bones):
+ for extra in self.extra_ctrl_list:
+ set_transform_from_matrix(
+ obj, extra, Matrix.Identity(4), space='LOCAL', keyflags=self.keyflags
+ )
+
def apply_frame_state(self, context, obj, all_matrices):
ik_bones = [ obj.pose.bones[k] for k in self.ik_bone_list ]
ctrl_bones = [ obj.pose.bones[k] for k in self.ctrl_bone_list ]
tail_bones = [ obj.pose.bones[k] for k in self.tail_bone_list ]
- assert len(all_matrices) == len(ik_bones) + len(tail_bones)
+ assert len(all_matrices) >= len(ik_bones) + len(tail_bones)
matrices = all_matrices[0:len(ik_bones)]
tail_matrices = all_matrices[len(ik_bones):]
use_pole = self.get_use_pole(obj)
+ # Remove foot heel transform, if present
+ self.assign_extra_controls(context, obj, all_matrices, ik_bones, ctrl_bones)
+
+ context.view_layer.update()
+
# Set the end control position
- endmat = convert_pose_matrix_via_rest_delta(matrices[-1], ik_bones[-1], ctrl_bones[-1])
+ endmat = convert_pose_matrix_via_pose_delta(matrices[-1], ik_bones[-1], ctrl_bones[-1])
set_transform_from_matrix(
obj, self.ctrl_bone_list[-1], endmat, keyflags=self.keyflags,
undo_copy_scale=True,
)
- # Remove foot heel transform, if present
- for extra in self.extra_ctrl_list:
- set_transform_from_matrix(
- obj, extra, Matrix.Identity(4), space='LOCAL', keyflags=self.keyflags
- )
-
# Set the base bone position
ctrl_bones[0].matrix_basis = Matrix.Identity(4)