diff options
author | Thomas Larsson <thomas_larsson_01@hotmail.com> | 2011-03-16 04:10:06 +0300 |
---|---|---|
committer | Thomas Larsson <thomas_larsson_01@hotmail.com> | 2011-03-16 04:10:06 +0300 |
commit | 4071ecb4de6af3792b73966b85fce95fd177d0a0 (patch) | |
tree | 447a360a7af569ad797d047e923519d47544c208 /io_import_scene_mhx.py | |
parent | 5ad0c2496ac6bbdfea914cb0af615533ad05ccfe (diff) |
Mhx importer: list for roll recalculation
Diffstat (limited to 'io_import_scene_mhx.py')
-rw-r--r-- | io_import_scene_mhx.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py index 2abc8e9a..dc9bb51d 100644 --- a/io_import_scene_mhx.py +++ b/io_import_scene_mhx.py @@ -1558,6 +1558,7 @@ def parseArmature (args, tokens): parseBone(bone, amt, sub, heads, tails) loadedData['Bone'][bname] = bone elif key == 'RecalcRoll': + rolls = {} for bone in amt.edit_bones: bone.select = False blist = eval(val[0]) @@ -1565,6 +1566,12 @@ def parseArmature (args, tokens): bone = amt.edit_bones[name] bone.select = True bpy.ops.armature.calculate_roll(type='Z') + for bone in amt.edit_bones: + rolls[bone.name] = bone.roll + bpy.ops.object.mode_set(mode='OBJECT') + for bone in amt.bones: + bone['Roll'] = rolls[bone.name] + bpy.ops.object.mode_set(mode='EDIT') else: defaultKey(key, val, sub, "amt", ['MetaRig'], globals(), locals()) bpy.ops.object.mode_set(mode='OBJECT') @@ -1641,7 +1648,6 @@ def parseBone(bone, amt, tokens, heads, tails): ''' else: defaultKey(key, val, sub, "bone", [], globals(), locals()) - return bone # |