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:
authorDemeter Dzadik <Mets>2020-06-09 17:20:46 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2020-06-10 14:10:26 +0300
commitba2521b7ed14b5deb6bb9a82a442bc85d2e05224 (patch)
tree6d0540a65396845e8ee0b8280048c6f6c56ad6fd /rigify/rigs/spines/spine_rigs.py
parent084eec36977c9a084aa020031f4a1aa0f0352170 (diff)
Fix T74483: Rigify Meta-Human Neck Bone stretching.
This implements Ivan's suggestion: all the constraints on spine bones have to be moved from ORG to its DEF bone. All the spine ORG-bones have to be unconnected-children of their corresponding tweak. This is actually how chain rigs work in my own Rigify feature set, so as far as I'm concerned this is a tried and viable solution. The result is that, if you want to parent something to your chain rig, you can do it in two ways: If you parent it to the ORG bone (ie. by default), it will not inherit any squash and stretch induced by the "tweak" bones. If you parent it to the DEF bone however, it will behave the same as before. This raises a backwards compatibility concern; If you want the old behavior, you have to express that in your metarig explicitly, by parenting your bone to the DEF bone in some way. This patch also only affects the spine rig, which makes it inconsistent with other chain rigs in Rigify in this regard. Maniphest Tasks: T74483 Differential Revision: https://developer.blender.org/D7801
Diffstat (limited to 'rigify/rigs/spines/spine_rigs.py')
-rw-r--r--rigify/rigs/spines/spine_rigs.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/rigify/rigs/spines/spine_rigs.py b/rigify/rigs/spines/spine_rigs.py
index d23676d5..fa5babf3 100644
--- a/rigify/rigs/spines/spine_rigs.py
+++ b/rigify/rigs/spines/spine_rigs.py
@@ -129,6 +129,20 @@ class BaseSpineRig(TweakChainRig):
create_cube_widget(self.obj, master, radius=0.5)
####################################################
+ # ORG bones
+
+ @stage.parent_bones
+ def parent_org_chain(self):
+ ctrl = self.bones.ctrl
+ org = self.bones.org
+ for tweak, org in zip(ctrl.tweak, org):
+ self.set_bone_parent(org, tweak)
+
+ def rig_org_bone(self, i, org, tweak, next_tweak):
+ # For spine rigs, these constraints go on the deform bones. See T74483#902192.
+ pass
+
+ ####################################################
# Tweak bones
@stage.configure_bones
@@ -140,6 +154,18 @@ class BaseSpineRig(TweakChainRig):
####################################################
# Deform bones
+ @stage.rig_bones
+ def rig_deform_chain(self):
+ tweaks = self.bones.ctrl.tweak
+ for args in zip(count(0), self.bones.deform, tweaks, tweaks[1:]):
+ self.rig_deform_bone(*args)
+
+ def rig_deform_bone(self, i, deform, tweak, next_tweak):
+ self.make_constraint(deform, 'COPY_TRANSFORMS', tweak)
+ if next_tweak:
+ self.make_constraint(deform, 'DAMPED_TRACK', next_tweak)
+ self.make_constraint(deform, 'STRETCH_TO', next_tweak)
+
@stage.configure_bones
def configure_bbone_chain(self):
self.get_bone(self.bones.deform[0]).bone.bbone_easein = 0.0