From 41f1df2ad53989898d3a2bbe41f1d73c70d64b8b Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Tue, 17 Jun 2025 12:10:12 +0200 Subject: [PATCH] glTF exporter: Fix Variants export when Apply modifiers Was a regression in 4.4 --- scripts/addons_core/io_scene_gltf2/__init__.py | 2 +- scripts/addons_core/io_scene_gltf2/blender/exp/nodes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/addons_core/io_scene_gltf2/__init__.py b/scripts/addons_core/io_scene_gltf2/__init__.py index b510d53b8a2..56b01cb8035 100755 --- a/scripts/addons_core/io_scene_gltf2/__init__.py +++ b/scripts/addons_core/io_scene_gltf2/__init__.py @@ -5,7 +5,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (4, 5, 35), + "version": (4, 5, 36), 'blender': (4, 4, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/scripts/addons_core/io_scene_gltf2/blender/exp/nodes.py b/scripts/addons_core/io_scene_gltf2/blender/exp/nodes.py index fc4aaab91a0..7422de69409 100644 --- a/scripts/addons_core/io_scene_gltf2/blender/exp/nodes.py +++ b/scripts/addons_core/io_scene_gltf2/blender/exp/nodes.py @@ -311,11 +311,11 @@ def __gather_mesh(vnode, blender_object, export_settings): # 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]: + for prop in [p for p in blender_object.data.keys() if ((p not in BLACK_LIST) or p.startswith("gltf"))]: 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]: + for prop in [p for p in blender_object.data.keys() if (p in BLACK_LIST and not p.startswith("gltf"))]: del blender_mesh[prop] # Store that this evaluated mesh has been created by the exporter, and is not a GN instance mesh blender_mesh['gltf2_mesh_applied'] = True