Browse Source

[blender exporter] Allow exporting skinning data without bones

Jay Weeks 10 years ago
parent
commit
69ab1e144f

+ 1 - 1
utils/exporters/blender/addons/io_three/exporter/api/mesh.py

@@ -654,7 +654,7 @@ def _skinning_data(mesh, bone_map, array_index):
                 if bone.name != obj.vertex_groups[bone_array[index][0]].name:
                     continue
                 if array_index is 0:
-                    entry = bone_map.get(bone_index)
+                    entry = bone_map.get(bone_index, -1)
                 else:
                     entry = bone_array[index][1]
 

+ 1 - 1
utils/exporters/blender/addons/io_three/exporter/geometry.py

@@ -345,7 +345,7 @@ class Geometry(base_classes.BaseNode):
 
         if self.options.get(constants.SKINNING):
             logger.info('Parsing %s', constants.SKINNING)
-            bone_map = self[constants.BONE_MAP]
+            bone_map = self.get(constants.BONE_MAP) or {}
             self[constants.SKIN_INDICES] = api.mesh.skin_indices(self.node, bone_map)
             self[constants.SKIN_WEIGHTS] = api.mesh.skin_weights(self.node, bone_map)