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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-03 02:43:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-03 02:43:46 +0300
commitd8d11c55d9ebdedb72ea2c2bfb5038e612529157 (patch)
treea7a94e3b635aa8e7afe279f6364266f4c94fceec /release/scripts/modules/rigify/spine_pivot_flex.py
parent04d0261c37ccd28e8466312f5a2d8260c5a4c9e9 (diff)
patch from Cessen
Adds a new set of bones to rig types which are to be used for weight paint vgroups, in some these have some more segments to account for twist. also use Aligoriths new copy transform constraint.
Diffstat (limited to 'release/scripts/modules/rigify/spine_pivot_flex.py')
-rw-r--r--release/scripts/modules/rigify/spine_pivot_flex.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/release/scripts/modules/rigify/spine_pivot_flex.py b/release/scripts/modules/rigify/spine_pivot_flex.py
index 895a5d854c0..a8ba71d1fe6 100644
--- a/release/scripts/modules/rigify/spine_pivot_flex.py
+++ b/release/scripts/modules/rigify/spine_pivot_flex.py
@@ -122,6 +122,30 @@ def fk(*args):
main(*args)
+def deform(obj, definitions, base_names, options):
+ for org_bone_name in definitions[2:]:
+ bpy.ops.object.mode_set(mode='EDIT')
+
+ # Create deform bone.
+ bone = copy_bone_simple(obj.data, org_bone_name, "DEF-%s" % base_names[org_bone_name], parent=True)
+
+ # Store name before leaving edit mode
+ bone_name = bone.name
+
+ # Leave edit mode
+ bpy.ops.object.mode_set(mode='OBJECT')
+
+ # Get the pose bone
+ bone = obj.pose.bones[bone_name]
+
+ # Constrain to the original bone
+ # XXX. Todo, is this needed if the bone is connected to its parent?
+ con = bone.constraints.new('COPY_TRANSFORMS')
+ con.name = "copy_loc"
+ con.target = obj
+ con.subtarget = org_bone_name
+
+
def main(obj, bone_definition, base_names, options):
from Mathutils import Vector, RotationMatrix
from math import radians, pi
@@ -269,6 +293,7 @@ def main(obj, bone_definition, base_names, options):
spine_e.roll += pi # 180d roll
del spine_e
+ deform(obj, bone_definition, base_names, options)
bpy.ops.object.mode_set(mode='OBJECT')