Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2018-12-12 13:20:15 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2018-12-12 17:26:32 +0300
commite4f4053de64eaa04b0199eea8f55a5f6b8b456dd (patch)
treede471599e1198ae3fe5f175304b61950a52f1fa6
parent5aa12449c934b4ae2d429586be118bc79a17752a (diff)
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
-rw-r--r--io_scene_fbx/export_fbx_bin.py14
1 files 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)