From 15f6db2bb1ad33d23718f7da53bc568788f52fbe Mon Sep 17 00:00:00 2001 From: Julien Duroure Date: Wed, 27 Nov 2024 09:13:19 +0100 Subject: [PATCH] Fix #2422 - fix recursivity check on gpu instances --- addons/io_scene_gltf2/blender/exp/exporter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/io_scene_gltf2/blender/exp/exporter.py b/addons/io_scene_gltf2/blender/exp/exporter.py index b7fcbf8e3..8b70a42f9 100644 --- a/addons/io_scene_gltf2/blender/exp/exporter.py +++ b/addons/io_scene_gltf2/blender/exp/exporter.py @@ -287,6 +287,10 @@ def manage_gpu_instancing(self, node, also_mesh=False): self.nodes_idx_to_remove.extend(insts) + for child_idx in node.children: + child = self.__gltf.nodes[child_idx] + self.manage_gpu_instancing(child, also_mesh=child.mesh is not None) + def manage_gpu_instancing_nodes(self, export_settings): if export_settings['gltf_gpu_instances'] is True: for scene_num in range(len(self.__gltf.scenes)): @@ -299,9 +303,6 @@ def manage_gpu_instancing_nodes(self, export_settings): self.manage_gpu_instancing(node) else: self.manage_gpu_instancing(node, also_mesh=True) - for child_idx in node.children: - child = self.__gltf.nodes[child_idx] - self.manage_gpu_instancing(child, also_mesh=child.mesh is not None) # Slides other nodes index