[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25068] trunk/blender: rename armature RNA props
Campbell Barton
ideasman42 at gmail.com
Wed Dec 2 11:32:39 CET 2009
Revision: 25068
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25068
Author: campbellbarton
Date: 2009-12-02 11:32:39 +0100 (Wed, 02 Dec 2009)
Log Message:
-----------
rename armature RNA props
armature_matrix --> matrix_local
armature_head --> head_local
armature_tail --> tail_local
Modified Paths:
--------------
trunk/blender/release/scripts/io/export_fbx.py
trunk/blender/release/scripts/modules/graphviz_export.py
trunk/blender/source/blender/makesrna/intern/rna_armature.c
Modified: trunk/blender/release/scripts/io/export_fbx.py
===================================================================
--- trunk/blender/release/scripts/io/export_fbx.py 2009-12-02 10:21:10 UTC (rev 25067)
+++ trunk/blender/release/scripts/io/export_fbx.py 2009-12-02 10:32:39 UTC (rev 25068)
@@ -486,7 +486,7 @@
self.blenBone = blenBone
self.blenMeshes = {} # fbxMeshObName : mesh
self.fbxArm = fbxArm
- self.restMatrix = blenBone.armature_matrix
+ self.restMatrix = blenBone.matrix_local
# self.restMatrix = blenBone.matrix['ARMATURESPACE']
# not used yet
@@ -664,13 +664,13 @@
# we know we have a matrix
# matrix = mtx4_z90 * (ob.matrix['ARMATURESPACE'] * matrix_mod)
- matrix = mtx4_z90 * ob.armature_matrix # dont apply armature matrix anymore
+ matrix = mtx4_z90 * ob.matrix_local # dont apply armature matrix anymore
# matrix = mtx4_z90 * ob.matrix['ARMATURESPACE'] # dont apply armature matrix anymore
parent = ob.parent
if parent:
#par_matrix = mtx4_z90 * (parent.matrix['ARMATURESPACE'] * matrix_mod)
- par_matrix = mtx4_z90 * parent.armature_matrix # dont apply armature matrix anymore
+ par_matrix = mtx4_z90 * parent.matrix_local # dont apply armature matrix anymore
# par_matrix = mtx4_z90 * parent.matrix['ARMATURESPACE'] # dont apply armature matrix anymore
matrix = matrix * par_matrix.copy().invert()
@@ -841,7 +841,7 @@
"""
file.write('\n\t\t\tProperty: "LimbLength", "double", "",%.6f' %
- (my_bone.blenBone.armature_head - my_bone.blenBone.armature_tail).length)
+ (my_bone.blenBone.head_local - my_bone.blenBone.tail_local).length)
# (my_bone.blenBone.head['ARMATURESPACE'] - my_bone.blenBone.tail['ARMATURESPACE']).length)
#file.write('\n\t\t\tProperty: "LimbLength", "double", "",1')
Modified: trunk/blender/release/scripts/modules/graphviz_export.py
===================================================================
--- trunk/blender/release/scripts/modules/graphviz_export.py 2009-12-02 10:21:10 UTC (rev 25067)
+++ trunk/blender/release/scripts/modules/graphviz_export.py 2009-12-02 10:32:39 UTC (rev 25068)
@@ -16,6 +16,8 @@
#
# ##### END GPL LICENSE BLOCK #####
+import bpy
+
header = '''
digraph ancestors {
graph [fontsize=30 labelloc="t" label="" splines=false overlap=true, rankdir=BT];
@@ -84,6 +86,8 @@
fw('"%s" [%s];\n' % (bone.name, ','.join(opts)))
+ fw('\n\n# Hierarchy:\n')
+
# Root node.
if FAKE_PARENT:
fw('"Object::%s" [];\n' % obj.name)
@@ -110,7 +114,10 @@
# constraints
if CONSTRAINTS:
- for pbone in obj.pose.bones:
+ fw('\n\n# Constraints:\n')
+ for bone in bones:
+ pbone = obj.pose.bones[bone]
+ # must be ordered
for constraint in pbone.constraints:
subtarget = constraint.subtarget
if subtarget:
@@ -122,6 +129,7 @@
# Drivers
if DRIVERS:
+ fw('\n\n# Drivers:\n')
def rna_path_as_pbone(rna_path):
if not rna_path.startswith("pose.bones["):
return None
@@ -156,9 +164,13 @@
fw(footer)
file.close()
+ '''
print(".", end='')
import sys
sys.stdout.flush()
+ '''
+ print("\nSaved:", path)
+ return True
if __name__ == "__main__":
import bpy
Modified: trunk/blender/source/blender/makesrna/intern/rna_armature.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-12-02 10:21:10 UTC (rev 25067)
+++ trunk/blender/source/blender/makesrna/intern/rna_armature.c 2009-12-02 10:32:39 UTC (rev 25068)
@@ -528,7 +528,7 @@
RNA_def_property_array(prop, 9);
RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix.");
- prop= RNA_def_property(srna, "armature_matrix", PROP_FLOAT, PROP_MATRIX);
+ prop= RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, NULL, "arm_mat");
RNA_def_property_array(prop, 16);
RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature.");
@@ -538,7 +538,7 @@
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone.");
- prop= RNA_def_property(srna, "armature_tail", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "tail_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_tail");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature.");
@@ -546,9 +546,9 @@
prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "head");
RNA_def_property_array(prop, 3);
- RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone.");
+ RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone relative to its parent.");
- prop= RNA_def_property(srna, "armature_head", PROP_FLOAT, PROP_TRANSLATION);
+ prop= RNA_def_property(srna, "head_local", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_float_sdna(prop, NULL, "arm_head");
RNA_def_property_array(prop, 3);
RNA_def_property_ui_text(prop, "Armature-Relative Head", "Location of head end of the bone relative to armature.");
More information about the Bf-blender-cvs
mailing list