diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-25 14:07:44 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-25 14:42:56 +0300 |
commit | 292b5975d6d4d470f51ff683d5b5a5d979e887a4 (patch) | |
tree | 98623b8bc46f0d6c07a0ad3ced951bf45393ed3d /rigify/utils/bones.py | |
parent | 1a9a9d008dea3fab2bdfd04a57bcdd364ae5d0b8 (diff) |
Rigify: support including Inherit Scale and constraints in metarig.
Also fix metarig Inherit Scale support in limbs.super_finger.
Diffstat (limited to 'rigify/utils/bones.py')
-rw-r--r-- | rigify/utils/bones.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rigify/utils/bones.py b/rigify/utils/bones.py index f0e5e388..92b91ade 100644 --- a/rigify/utils/bones.py +++ b/rigify/utils/bones.py @@ -121,7 +121,7 @@ def new_bone(obj, bone_name): raise MetarigError("Can't add new bone '%s' outside of edit mode" % bone_name) -def copy_bone(obj, bone_name, assign_name='', *, parent=False, bbone=False, length=None, scale=None): +def copy_bone(obj, bone_name, assign_name='', *, parent=False, inherit_scale=False, bbone=False, length=None, scale=None): """ Makes a copy of the given bone in the given armature object. Returns the resulting bone's name. """ @@ -151,6 +151,8 @@ def copy_bone(obj, bone_name, assign_name='', *, parent=False, bbone=False, leng edit_bone_2.use_inherit_rotation = edit_bone_1.use_inherit_rotation edit_bone_2.use_local_location = edit_bone_1.use_local_location + + if parent or inherit_scale: edit_bone_2.inherit_scale = edit_bone_1.inherit_scale if bbone: @@ -385,9 +387,9 @@ class BoneUtilityMixin(object): self.register_new_bone(name) return name - def copy_bone(self, bone_name, new_name='', *, parent=False, bbone=False, length=None, scale=None): + def copy_bone(self, bone_name, new_name='', *, parent=False, inherit_scale=False, bbone=False, length=None, scale=None): """Copy the bone with the given name, returning the new name.""" - name = copy_bone(self.obj, bone_name, new_name, parent=parent, bbone=bbone, length=length, scale=scale) + name = copy_bone(self.obj, bone_name, new_name, parent=parent, inherit_scale=inherit_scale, bbone=bbone, length=length, scale=scale) self.register_new_bone(name, bone_name) return name |