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
This commit is contained in:
Philipp Oeser 2018-12-12 11:20:15 +01:00
parent 5aa12449c9
commit e4f4053de6
Notes: blender-bot 2023-02-14 19:23:15 +01:00
Referenced by commit 3a264229: FBX export: skip special properties when exporting custom properties
Referenced by commit 3a264229, FBX export: skip special properties when exporting custom properties
Referenced by issue #59202, FBX Custom property error
1 changed files with 12 additions and 2 deletions

View File

@ -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)