Browse Source

Fixed a bug where None value was returned on geometries that had no morph targets when morph animation export was selected

repsac 10 years ago
parent
commit
ab7c0a8ac9

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

@@ -340,7 +340,7 @@ def morph_targets(mesh, options):
             break
     else:
         logger.info("No valid morph data detected")
-        return
+        return []
 
     manifest = []
     for index, morph in enumerate(morphs):

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

@@ -432,12 +432,12 @@ class Geometry(base_classes.BaseNode):
 
             self[constants.INFLUENCES_PER_VERTEX] = influences
             self[constants.SKIN_INDICES] = api.mesh.skin_indices(
-                self.node, bone_map, influences)
+                self.node, bone_map, influences) or []
             self[constants.SKIN_WEIGHTS] = api.mesh.skin_weights(
-                self.node, bone_map, influences)
+                self.node, bone_map, influences) or []
 
         if self.options.get(constants.MORPH_TARGETS):
             logger.info("Parsing %s", constants.MORPH_TARGETS)
             self[constants.MORPH_TARGETS] = api.mesh.morph_targets(
-                self.node, self.options)
+                self.node, self.options) or []