[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25450] trunk/blender: autorigging front end, access in pose mode armature panel (at the bottom)
Campbell Barton
ideasman42 at gmail.com
Thu Dec 17 20:48:32 CET 2009
Revision: 25450
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25450
Author: campbellbarton
Date: 2009-12-17 20:48:30 +0100 (Thu, 17 Dec 2009)
Log Message:
-----------
autorigging front end, access in pose mode armature panel (at the bottom)
demo: http://download.blender.org/durian/metarig_demo.ogv
sintel base rig also, would like to include more generic/simple rigs eventually
Modified Paths:
--------------
trunk/blender/release/scripts/modules/rigify/arm_biped_generic.py
trunk/blender/release/scripts/modules/rigify/leg_biped_generic.py
trunk/blender/source/blender/makesrna/intern/rna_armature.c
Added Paths:
-----------
trunk/blender/release/scripts/op/add_armature_human.py
trunk/blender/release/scripts/ui/properties_data_armature_rigify.py
Modified: trunk/blender/release/scripts/modules/rigify/arm_biped_generic.py
===================================================================
--- trunk/blender/release/scripts/modules/rigify/arm_biped_generic.py 2009-12-17 19:23:25 UTC (rev 25449)
+++ trunk/blender/release/scripts/modules/rigify/arm_biped_generic.py 2009-12-17 19:48:30 UTC (rev 25450)
@@ -164,14 +164,6 @@
con.chain_length = 2
con.pole_angle = -90.0 # XXX, RAD2DEG
- # ID Propery on the hand for IK/FK switch
-
- prop = rna_idprop_ui_prop_get(ik_chain.hand_p, "ik", create=True)
- ik_chain.hand_p["ik"] = 0.5
- prop["soft_min"] = 0.0
- prop["soft_max"] = 1.0
-
-
# last step setup layers
layers = get_layer_dict(options)
lay = layers["ik"]
@@ -292,8 +284,8 @@
def main(obj, bone_definition, base_names, options):
- bones_ik = ik(obj, bone_definition, base_names, options)
bones_fk = fk(obj, bone_definition, base_names, options)
+ bones_ik = ik(obj, bone_definition, base_names, options)
bpy.ops.object.mode_set(mode='OBJECT')
- blend_bone_list(obj, bone_definition, bones_ik, bones_fk, target_bone=bone_definition[1], blend_default=1.0)
+ blend_bone_list(obj, bone_definition, bones_fk, bones_ik, target_bone=bones_fk[1], blend_default=1.0)
Modified: trunk/blender/release/scripts/modules/rigify/leg_biped_generic.py
===================================================================
--- trunk/blender/release/scripts/modules/rigify/leg_biped_generic.py 2009-12-17 19:23:25 UTC (rev 25449)
+++ trunk/blender/release/scripts/modules/rigify/leg_biped_generic.py 2009-12-17 19:48:30 UTC (rev 25450)
@@ -367,8 +367,8 @@
def main(obj, bone_definition, base_names, options):
+ bones_fk = fk(obj, bone_definition, base_names, options)
bones_ik = ik(obj, bone_definition, base_names, options)
- bones_fk = fk(obj, bone_definition, base_names, options)
bpy.ops.object.mode_set(mode='OBJECT')
- blend_bone_list(obj, bone_definition, bones_ik, bones_fk, target_bone=bone_definition[1], blend_default=0.0)
+ blend_bone_list(obj, bone_definition, bones_fk, bones_ik, target_bone=bones_ik[1], blend_default=0.0)
Added: trunk/blender/release/scripts/op/add_armature_human.py
===================================================================
--- trunk/blender/release/scripts/op/add_armature_human.py (rev 0)
+++ trunk/blender/release/scripts/op/add_armature_human.py 2009-12-17 19:48:30 UTC (rev 25450)
@@ -0,0 +1,623 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+import bpy
+import Mathutils
+from math import cos, sin, pi
+
+# could this be stored elsewhere?
+
+def metarig_template():
+ # generated by rigify.write_meta_rig
+ bpy.ops.object.mode_set(mode='EDIT')
+ obj = bpy.context.active_object
+ arm = obj.data
+ bone = arm.edit_bones.new('root')
+ bone.head[:] = 0.0000, 0.0000, 0.0000
+ bone.tail[:] = 0.0000, 0.4000, 0.0000
+ bone.roll = 0.0000
+ bone.connected = False
+ bone = arm.edit_bones.new('pelvis')
+ bone.head[:] = -0.0000, -0.0145, 1.1263
+ bone.tail[:] = -0.0000, -0.0145, 0.9563
+ bone.roll = 3.1416
+ bone.connected = False
+ bone.parent = arm.edit_bones['root']
+ bone = arm.edit_bones.new('torso')
+ bone.head[:] = -0.0000, -0.0145, 1.1263
+ bone.tail[:] = -0.0000, -0.0145, 1.2863
+ bone.roll = 3.1416
+ bone.connected = False
+ bone.parent = arm.edit_bones['pelvis']
+ bone = arm.edit_bones.new('spine.01')
+ bone.head[:] = 0.0000, 0.0394, 0.9688
+ bone.tail[:] = -0.0000, -0.0145, 1.1263
+ bone.roll = 0.0000
+ bone.connected = False
+ bone.parent = arm.edit_bones['torso']
+ bone = arm.edit_bones.new('spine.02')
+ bone.head[:] = -0.0000, -0.0145, 1.1263
+ bone.tail[:] = -0.0000, -0.0213, 1.2884
+ bone.roll = -0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['spine.01']
+ bone = arm.edit_bones.new('thigh.L')
+ bone.head[:] = 0.0933, -0.0421, 1.0434
+ bone.tail[:] = 0.0933, -0.0516, 0.5848
+ bone.roll = 0.0000
+ bone.connected = False
+ bone.parent = arm.edit_bones['spine.01']
+ bone = arm.edit_bones.new('thigh.R')
+ bone.head[:] = -0.0933, -0.0421, 1.0434
+ bone.tail[:] = -0.0933, -0.0516, 0.5848
+ bone.roll = -0.0000
+ bone.connected = False
+ bone.parent = arm.edit_bones['spine.01']
+ bone = arm.edit_bones.new('spine.03')
+ bone.head[:] = -0.0000, -0.0213, 1.2884
+ bone.tail[:] = -0.0000, 0.0160, 1.3705
+ bone.roll = -0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['spine.02']
+ bone = arm.edit_bones.new('shin.L')
+ bone.head[:] = 0.0933, -0.0516, 0.5848
+ bone.tail[:] = 0.0915, 0.0100, 0.1374
+ bone.roll = 0.0034
+ bone.connected = True
+ bone.parent = arm.edit_bones['thigh.L']
+ bone = arm.edit_bones.new('shin.R')
+ bone.head[:] = -0.0933, -0.0516, 0.5848
+ bone.tail[:] = -0.0915, 0.0100, 0.1374
+ bone.roll = -0.0034
+ bone.connected = True
+ bone.parent = arm.edit_bones['thigh.R']
+ bone = arm.edit_bones.new('spine.04')
+ bone.head[:] = -0.0000, 0.0160, 1.3705
+ bone.tail[:] = -0.0000, 0.0590, 1.4497
+ bone.roll = -0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['spine.03']
+ bone = arm.edit_bones.new('foot.L')
+ bone.head[:] = 0.0915, 0.0100, 0.1374
+ bone.tail[:] = 0.1033, -0.0968, 0.0510
+ bone.roll = 2.8964
+ bone.connected = True
+ bone.parent = arm.edit_bones['shin.L']
+ bone = arm.edit_bones.new('foot.R')
+ bone.head[:] = -0.0915, 0.0100, 0.1374
+ bone.tail[:] = -0.1033, -0.0968, 0.0510
+ bone.roll = -2.8793
+ bone.connected = True
+ bone.parent = arm.edit_bones['shin.R']
+ bone = arm.edit_bones.new('neck_base')
+ bone.head[:] = -0.0000, 0.0590, 1.4497
+ bone.tail[:] = -0.0000, 0.0401, 1.5389
+ bone.roll = -0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['spine.04']
+ bone = arm.edit_bones.new('toe.L')
+ bone.head[:] = 0.1033, -0.0968, 0.0510
+ bone.tail[:] = 0.1136, -0.1848, 0.0510
+ bone.roll = 0.0001
+ bone.connected = True
+ bone.parent = arm.edit_bones['foot.L']
+ bone = arm.edit_bones.new('heel.L')
+ bone.head[:] = 0.0809, 0.0969, -0.0000
+ bone.tail[:] = 0.1020, -0.0846, -0.0000
+ bone.roll = -0.0001
+ bone.connected = False
+ bone.parent = arm.edit_bones['foot.L']
+ bone = arm.edit_bones.new('toe.R')
+ bone.head[:] = -0.1033, -0.0968, 0.0510
+ bone.tail[:] = -0.1136, -0.1848, 0.0510
+ bone.roll = -0.0002
+ bone.connected = True
+ bone.parent = arm.edit_bones['foot.R']
+ bone = arm.edit_bones.new('heel.R')
+ bone.head[:] = -0.0809, 0.0969, -0.0000
+ bone.tail[:] = -0.1020, -0.0846, -0.0000
+ bone.roll = -0.0000
+ bone.connected = False
+ bone.parent = arm.edit_bones['foot.R']
+ bone = arm.edit_bones.new('head')
+ bone.head[:] = -0.0000, 0.0401, 1.5389
+ bone.tail[:] = -0.0000, 0.0401, 1.5979
+ bone.roll = 3.1416
+ bone.connected = True
+ bone.parent = arm.edit_bones['neck_base']
+ bone = arm.edit_bones.new('DLT-shoulder.L')
+ bone.head[:] = 0.0141, -0.0346, 1.4991
+ bone.tail[:] = 0.1226, 0.0054, 1.4991
+ bone.roll = 0.0005
+ bone.connected = False
+ bone.parent = arm.edit_bones['neck_base']
+ bone = arm.edit_bones.new('DLT-shoulder.R')
+ bone.head[:] = -0.0141, -0.0346, 1.4991
+ bone.tail[:] = -0.1226, 0.0054, 1.4991
+ bone.roll = -0.0005
+ bone.connected = False
+ bone.parent = arm.edit_bones['neck_base']
+ bone = arm.edit_bones.new('neck.01')
+ bone.head[:] = -0.0000, 0.0401, 1.5389
+ bone.tail[:] = -0.0000, 0.0176, 1.5916
+ bone.roll = 0.0000
+ bone.connected = False
+ bone.parent = arm.edit_bones['head']
+ bone = arm.edit_bones.new('shoulder.L')
+ bone.head[:] = 0.0141, -0.0346, 1.4991
+ bone.tail[:] = 0.1226, 0.0216, 1.5270
+ bone.roll = -0.1225
+ bone.connected = False
+ bone.parent = arm.edit_bones['DLT-shoulder.L']
+ bone = arm.edit_bones.new('shoulder.R')
+ bone.head[:] = -0.0141, -0.0346, 1.4991
+ bone.tail[:] = -0.1226, 0.0216, 1.5270
+ bone.roll = 0.0849
+ bone.connected = False
+ bone.parent = arm.edit_bones['DLT-shoulder.R']
+ bone = arm.edit_bones.new('neck.02')
+ bone.head[:] = -0.0000, 0.0176, 1.5916
+ bone.tail[:] = -0.0000, 0.0001, 1.6499
+ bone.roll = 0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['neck.01']
+ bone = arm.edit_bones.new('DLT-upper_arm.L')
+ bone.head[:] = 0.1482, 0.0483, 1.4943
+ bone.tail[:] = 0.2586, 0.1057, 1.5124
+ bone.roll = 1.4969
+ bone.connected = False
+ bone.parent = arm.edit_bones['shoulder.L']
+ bone = arm.edit_bones.new('DLT-upper_arm.R')
+ bone.head[:] = -0.1482, 0.0483, 1.4943
+ bone.tail[:] = -0.2586, 0.1057, 1.5124
+ bone.roll = -1.4482
+ bone.connected = False
+ bone.parent = arm.edit_bones['shoulder.R']
+ bone = arm.edit_bones.new('neck.03')
+ bone.head[:] = -0.0000, 0.0001, 1.6499
+ bone.tail[:] = -0.0000, 0.0001, 1.8522
+ bone.roll = 0.0000
+ bone.connected = True
+ bone.parent = arm.edit_bones['neck.02']
+ bone = arm.edit_bones.new('upper_arm.L')
+ bone.head[:] = 0.1482, 0.0483, 1.4943
+ bone.tail[:] = 0.3929, 0.0522, 1.4801
+ bone.roll = 1.6281
+ bone.connected = False
+ bone.parent = arm.edit_bones['DLT-upper_arm.L']
+ bone = arm.edit_bones.new('upper_arm.R')
+ bone.head[:] = -0.1482, 0.0483, 1.4943
+ bone.tail[:] = -0.3929, 0.0522, 1.4801
+ bone.roll = -1.6281
+ bone.connected = False
+ bone.parent = arm.edit_bones['DLT-upper_arm.R']
+ bone = arm.edit_bones.new('forearm.L')
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list