fix(Blenvy:Blender): fixed issue with materials not exported if there was an export parameter change

This commit is contained in:
kaosat.dev 2024-08-06 10:19:22 +02:00
parent d08c235122
commit 0b02a24313
3 changed files with 4 additions and 2 deletions

View File

@ -54,6 +54,7 @@ def generate_temporary_scene_and_export(settings, gltf_export_settings, gltf_out
else: else:
set_active_collection(bpy.context.scene, temp_root_collection.name) set_active_collection(bpy.context.scene, temp_root_collection.name)
# generate contents of temporary scene # generate contents of temporary scene
scene_filler_data = tempScene_filler(temp_root_collection) scene_filler_data = tempScene_filler(temp_root_collection)
# export the temporary scene # export the temporary scene
try: try:

View File

@ -26,7 +26,7 @@ def is_object_dynamic(object):
if component_name == 'Dynamic': if component_name == 'Dynamic':
is_dynamic = True is_dynamic = True
break""" break"""
print("IS OBJECT DYNAMIC", object, is_dynamic) #print("IS OBJECT DYNAMIC", object, is_dynamic)
return is_dynamic return is_dynamic

View File

@ -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] local_materials = [material for material in all_materials if material.library is None]
materials_to_export = [] 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 export_materials_library and change_detection:
if changed_export_parameters: 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 : else :
changed_materials = [bpy.data.materials[material_name] for material_name in list(changes_per_material.keys())] changed_materials = [bpy.data.materials[material_name] for material_name in list(changes_per_material.keys())]