[Bf-extensions-cvs] [e4f4053d] blender2.8: FBX export: skip special properties when exporting custom properties

Philipp Oeser noreply at git.blender.org
Wed Dec 12 15:31:36 CET 2018


Commit: e4f4053de64eaa04b0199eea8f55a5f6b8b456dd
Author: Philipp Oeser
Date:   Wed Dec 12 11:20:15 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBAe4f4053de64eaa04b0199eea8f55a5f6b8b456dd

FBX export: skip special properties when exporting custom properties

'_RNA_UI' (and rna runtime properties) should not be included, these
would have been included as string properties causing errors on reimport

Fixes T59202

Differential Revision: https://developer.blender.org/D4068

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

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 1f95eace..6f6005cb 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -534,7 +534,17 @@ def fbx_data_element_custom_properties(props, bid):
     """
     Store custom properties of blender ID bid (any mapping-like object, in fact) into FBX properties props.
     """
-    for k, v in bid.items():
+    items = bid.items()
+
+    if not items:
+        return
+
+    rna_properties = {prop.identifier for prop in bid.bl_rna.properties if prop.is_runtime}
+
+    for k, v in items:
+        if k == '_RNA_UI' or k in rna_properties:
+            continue
+
         list_val = getattr(v, "to_list", lambda: None)()
 
         if isinstance(v, str):
@@ -2304,7 +2314,7 @@ def fbx_data_from_scene(scene, depsgraph, settings):
     # For now, do not use world textures, don't think they can be linked to anything FBX wise...
     for ma in data_materials.keys():
         # Note: with nodal shaders, we'll could be generating much more textures, but that's kind of unavoidable,
-        #       given that textures actually do not exist anymore in material context in Blender...
+        #       given that textures actually do not exist anymore in material context in Blender...
         ma_wrap = node_shader_utils.PrincipledBSDFWrapper(ma, is_readonly=True)
         for sock_name, fbx_name in PRINCIPLED_TEXTURE_SOCKETS_TO_FBX:
             tex = getattr(ma_wrap, sock_name)



More information about the Bf-extensions-cvs mailing list