[Bf-extensions-cvs] [3dc2ed1] master: Fix T49197: all virtual leaf bones had same uuid.

Bastien Montagne noreply at git.blender.org
Tue Aug 30 21:22:17 CEST 2016


Commit: 3dc2ed11c05de63d2d98b9914f5f1e1b25db8f6f
Author: Bastien Montagne
Date:   Tue Aug 30 21:20:45 2016 +0200
Branches: master
https://developer.blender.org/rBA3dc2ed11c05de63d2d98b9914f5f1e1b25db8f6f

Fix T49197: all virtual leaf bones had same uuid.

Kinda odd nobody noticed this so far :/

Also, cleanup: do not loop over key/value of a dict when you only need the keys...

===================================================================

M	io_scene_fbx/export_fbx_bin.py

===================================================================

diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 4979dfc..250b951 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1822,8 +1822,8 @@ def fbx_skeleton_from_armature(scene, settings, arm_obj, objects, data_meshes,
 
 def fbx_generate_leaf_bones(settings, data_bones):
     # find which bons have no children
-    child_count = {bo: 0 for bo, _bo_key in data_bones.items()}
-    for bo, _bo_key in data_bones.items():
+    child_count = {bo: 0 for bo in data_bones.keys()}
+    for bo in data_bones.keys():
         if bo.parent and bo.parent.is_bone:
             child_count[bo.parent] += 1
 
@@ -1835,8 +1835,9 @@ def fbx_generate_leaf_bones(settings, data_bones):
     for parent in leaf_parents:
         node_name = parent.name + "_end"
         parent_uuid = parent.fbx_uuid
-        node_uuid = get_fbx_uuid_from_key(node_name + "_node")
-        attr_uuid = get_fbx_uuid_from_key(node_name + "_nodeattr")
+        parent_key = parent.key
+        node_uuid = get_fbx_uuid_from_key(parent_key + "_end_node")
+        attr_uuid = get_fbx_uuid_from_key(parent_key + "_end_nodeattr")
 
         hide = parent.hide
         size = parent.bdata.head_radius * bone_radius_scale



More information about the Bf-extensions-cvs mailing list