Explorar o código

Blender Exporter: Custom Properties for Empty objects (#9202) (#9541)

Jason Yung %!s(int64=9) %!d(string=hai) anos
pai
achega
8f798a149f

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

@@ -250,7 +250,7 @@ def custom_properties(obj):
     # Grab any properties except those marked private (by underscore
     # prefix) or those with types that would be rejected by the JSON
     # serializer object model.
-    return {kvp[0]: kvp[1] for kvp in obj.data.items() if kvp[0][:1] != '_' and isinstance(kvp[1], constants.VALID_DATA_TYPES)}
+    return {K: obj[K] for K in obj.keys() if K[:1] != '_' and isinstance(obj[K], constants.VALID_DATA_TYPES)}  # 'Empty' Blender objects do not use obj.data.items() for custom properties, using obj.keys()
 
 @_object
 def mesh(obj, options):