diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-02 05:56:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-02 05:56:22 +0300 |
commit | 50c8c28c60a88a615c1dbace004b75316ebd2437 (patch) | |
tree | 515011097322613565d0b21e46afe2711596ea35 /release/scripts/modules/graphviz_export.py | |
parent | fd69360fd2c8bb9850134e37ec18608cfd94dbce (diff) |
- finished spine rig generator, (drivers, constraints)
- bug with args passed for class slots being modified in place.
- sort graphviz bones & drivers (useful for diffing 2 armatures)
Diffstat (limited to 'release/scripts/modules/graphviz_export.py')
-rw-r--r-- | release/scripts/modules/graphviz_export.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/release/scripts/modules/graphviz_export.py b/release/scripts/modules/graphviz_export.py index 1e6d9ffe95b..c5b8b185893 100644 --- a/release/scripts/modules/graphviz_export.py +++ b/release/scripts/modules/graphviz_export.py @@ -26,7 +26,7 @@ footer = ''' } ''' -def compat_str(text, line_length=22): +def compat_str(text, line_length=0): if line_length: text_ls = [] @@ -88,7 +88,9 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True): if FAKE_PARENT: fw('"Object::%s" [];\n' % obj.name) - for bone in arm.bones: + for bone in bones: + bone = arm.bones[bone] + parent = bone.parent if parent: parent_name = parent.name @@ -131,7 +133,11 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True): animation_data = obj.animation_data if animation_data: - for fcurve_driver in animation_data.drivers: + + fcurve_drivers = [fcurve_driver for fcurve_driver in animation_data.drivers] + fcurve_drivers.sort(key=lambda fcurve_driver: fcurve_driver.rna_path) + + for fcurve_driver in fcurve_drivers: rna_path = fcurve_driver.rna_path pbone = rna_path_as_pbone(rna_path) @@ -158,5 +164,5 @@ if __name__ == "__main__": import bpy import os path ="/tmp/test.dot" - graph_armature(bpy.context.object, path, CONSTRAINTS=False, DRIVERS=False) + graph_armature(bpy.context.object, path, CONSTRAINTS=True, DRIVERS=True) os.system("dot -Tpng %s > %s; eog %s &" % (path, path + '.png', path + '.png')) |