diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-10-01 09:59:51 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-10-01 14:29:30 +0300 |
commit | 50c493fb22869e0e08936c4b7a44624887b1de58 (patch) | |
tree | 59c571688b6e09f9d41cf6053924f7a3dfdb377d /rigify/rigs/spines/spine_rigs.py | |
parent | e57714f3a2805b5ca71d68f967961950e707e191 (diff) |
Rigify: add more parent switching and 2.81 inherit scale features.
- Add a parent switch to the main spine control, to allow using the
key baking operator to convert between moving and fixed root bone.
- Add hips, chest and head as parents for children of the spine.
- Use 'Fix Shear' Inherit Scale and 'Make Uniform' Copy Scale in limbs.
- Switch code to use the new inherit_scale parameter of set_bone_parent.
- Allow local matrices in adjust_widget_transform_mesh.
Diffstat (limited to 'rigify/rigs/spines/spine_rigs.py')
-rw-r--r-- | rigify/rigs/spines/spine_rigs.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/rigify/rigs/spines/spine_rigs.py b/rigify/rigs/spines/spine_rigs.py index 34eefbf5..6628289f 100644 --- a/rigify/rigs/spines/spine_rigs.py +++ b/rigify/rigs/spines/spine_rigs.py @@ -64,11 +64,26 @@ class BaseSpineRig(TweakChainRig): align_bone_to_axis(self.obj, name, 'y', length=self.length * 0.6) - SwitchParentBuilder(self.generator).register_parent(self, name) + self.build_parent_switch(name) + + def build_parent_switch(self, master_name): + pbuilder = SwitchParentBuilder(self.generator) + pbuilder.register_parent(self, master_name, name='Torso') + pbuilder.build_child( + self, master_name, exclude_self=True, + prop_id='torso_parent', prop_name='Torso Parent', + controls=lambda: self.bones.flatten('ctrl'), + ) + + self.register_parent_bones(pbuilder) + + def register_parent_bones(self, pbuilder): + pbuilder.register_parent(self, self.bones.org[0], name='Hips', exclude_self=True) + pbuilder.register_parent(self, self.bones.org[-1], name='Chest', exclude_self=True) @stage.parent_bones def parent_master_control(self): - self.set_bone_parent(self.bones.ctrl.master, self.rig_parent_bone) + pass @stage.configure_bones def configure_master_control(self): |