diff --git a/addons/io_scene_gltf2/__init__.py b/addons/io_scene_gltf2/__init__.py index ab3b17671..74e3f76b4 100644 --- a/addons/io_scene_gltf2/__init__.py +++ b/addons/io_scene_gltf2/__init__.py @@ -307,6 +307,12 @@ class ExportGLTF2_Base(ConvertGLTF2_Base): default=True, ) + export_gltfpack_kn: BoolProperty( + name='Keep Named Nodes', + description='Restrict some optimization to keep named nodes and meshes attached to named nodes so that named nodes can be transformed externally', + default=False, + ) + # TODO: some stuff in Textures # TODO: Animations @@ -1284,6 +1290,7 @@ def execute(self, context): export_settings['gltf_gltfpack_vpi'] = self.export_gltfpack_vpi export_settings['gltf_gltfpack_noq'] = self.export_gltfpack_noq + export_settings['gltf_gltfpack_kn'] = self.export_gltfpack_kn export_settings['gltf_binary'] = bytearray() export_settings['gltf_binaryfilename'] = ( @@ -1777,7 +1784,7 @@ def export_panel_gltfpack(layout, operator): # col = body.column(heading = "Scene", align = True) col = body.column(heading="Miscellaneous", align=True) col.prop(operator, 'export_gltfpack_noq') - + col.prop(operator, 'export_gltfpack_kn') def export_panel_user_extension(context, layout): for draw in exporter_extension_layout_draw.values(): diff --git a/addons/io_scene_gltf2/blender/exp/export.py b/addons/io_scene_gltf2/blender/exp/export.py index f6939c07e..3a43cd370 100644 --- a/addons/io_scene_gltf2/blender/exp/export.py +++ b/addons/io_scene_gltf2/blender/exp/export.py @@ -279,6 +279,8 @@ def __postprocess_with_gltfpack(export_settings): if (export_settings['gltf_gltfpack_noq']): options.append("-noq") + if (export_settings['export_gltfpack_kn']): + options.append("-kn") else: options.append("-vp") options.append(f"{export_settings['gltf_gltfpack_vp']}")