diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py index 4d69c38f4..a4b1a600d 100644 --- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py @@ -303,14 +303,14 @@ def __gather_mesh(vnode, blender_object, export_settings): depsgraph = bpy.context.evaluated_depsgraph_get() blender_mesh_owner = blender_object.evaluated_get(depsgraph) blender_mesh = blender_mesh_owner.to_mesh(preserve_all_data_layers=True, depsgraph=depsgraph) - # Seems now (from 4.2) the custom properties are copied when evaluate a mesh that will not be changed - # so no need to copy them in that case - # But we need to remove some properties that are not needed + # Seems now (from 4.2) the custom properties are Statically Typed + # so no need to copy them in that case, because overwriting them will crash if len(blender_mesh.keys()) == 0: # Copy custom properties for prop in [p for p in blender_object.data.keys() if p not in BLACK_LIST]: blender_mesh[prop] = blender_object.data[prop] else: + # But we need to remove some properties that are not needed for prop in [p for p in blender_object.data.keys() if p in BLACK_LIST]: del blender_mesh[prop]