From e4f4053de64eaa04b0199eea8f55a5f6b8b456dd Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 12 Dec 2018 11:20:15 +0100 Subject: 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 --- io_scene_fbx/export_fbx_bin.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) -- cgit v1.2.3