From 0b02a243134d01aa8d95765d9fe3c044b4731c9a Mon Sep 17 00:00:00 2001 From: "kaosat.dev" Date: Tue, 6 Aug 2024 10:19:22 +0200 Subject: [PATCH] fix(Blenvy:Blender): fixed issue with materials not exported if there was an export parameter change --- .../auto_export/common/generate_temporary_scene_and_export.py | 1 + tools/blenvy/add_ons/auto_export/levels/is_object_dynamic.py | 2 +- .../add_ons/auto_export/materials/get_materials_to_export.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/blenvy/add_ons/auto_export/common/generate_temporary_scene_and_export.py b/tools/blenvy/add_ons/auto_export/common/generate_temporary_scene_and_export.py index 5be49a5..4ba36a0 100644 --- a/tools/blenvy/add_ons/auto_export/common/generate_temporary_scene_and_export.py +++ b/tools/blenvy/add_ons/auto_export/common/generate_temporary_scene_and_export.py @@ -54,6 +54,7 @@ def generate_temporary_scene_and_export(settings, gltf_export_settings, gltf_out else: set_active_collection(bpy.context.scene, temp_root_collection.name) # generate contents of temporary scene + scene_filler_data = tempScene_filler(temp_root_collection) # export the temporary scene try: diff --git a/tools/blenvy/add_ons/auto_export/levels/is_object_dynamic.py b/tools/blenvy/add_ons/auto_export/levels/is_object_dynamic.py index 4ffd4b3..f87b2e7 100644 --- a/tools/blenvy/add_ons/auto_export/levels/is_object_dynamic.py +++ b/tools/blenvy/add_ons/auto_export/levels/is_object_dynamic.py @@ -26,7 +26,7 @@ def is_object_dynamic(object): if component_name == 'Dynamic': is_dynamic = True break""" - print("IS OBJECT DYNAMIC", object, is_dynamic) + #print("IS OBJECT DYNAMIC", object, is_dynamic) return is_dynamic diff --git a/tools/blenvy/add_ons/auto_export/materials/get_materials_to_export.py b/tools/blenvy/add_ons/auto_export/materials/get_materials_to_export.py index 84ed4b6..e3f96a2 100644 --- a/tools/blenvy/add_ons/auto_export/materials/get_materials_to_export.py +++ b/tools/blenvy/add_ons/auto_export/materials/get_materials_to_export.py @@ -15,9 +15,10 @@ def get_materials_to_export(changes_per_material, changed_export_parameters, blu local_materials = [material for material in all_materials if material.library is None] materials_to_export = [] + # print("export_materials_library", export_materials_library, "change detection", change_detection, "changed_export_parameters", changed_export_parameters) if export_materials_library and change_detection: if changed_export_parameters: - materials_to_export = [bpy.data.materials[material_name] for material_name in list(changes_per_material.keys())] # TODO: should be based on the list of materials in use + materials_to_export = local_materials else : changed_materials = [bpy.data.materials[material_name] for material_name in list(changes_per_material.keys())]