From bbfaf7ee152e2bc143bc72c7d1c7349c74a134e2 Mon Sep 17 00:00:00 2001 From: Alexander Kleemann Date: Mon, 14 Aug 2023 13:29:26 +0200 Subject: [PATCH 1/3] Temporary fix for missing file --- addon/utility/build.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/addon/utility/build.py b/addon/utility/build.py index d020deb..f5b32e1 100644 --- a/addon/utility/build.py +++ b/addon/utility/build.py @@ -961,25 +961,27 @@ def manage_build(background_pass=False, load_atlas=0): if mat.name.startswith("."): if "_Original" in mat.name: bpy.data.materials.remove(mat) + try: + for obj in bpy.context.scene.objects: + if obj.type == 'MESH' and obj.name in bpy.context.view_layer.objects: + if obj.TLM_ObjectProperties.tlm_mesh_lightmap_use: - for obj in bpy.context.scene.objects: - if obj.type == 'MESH' and obj.name in bpy.context.view_layer.objects: - if obj.TLM_ObjectProperties.tlm_mesh_lightmap_use: - - if obj.TLM_ObjectProperties.tlm_mesh_lightmap_unwrap_mode == "AtlasGroupA": - atlasName = obj.TLM_ObjectProperties.tlm_atlas_pointer - img_name = atlasName + '_baked' - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw - elif obj.TLM_ObjectProperties.tlm_postpack_object: - atlasName = obj.TLM_ObjectProperties.tlm_postatlas_pointer - img_name = atlasName + '_baked' + ".hdr" - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw - else: - img_name = obj.name + '_baked' - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw + if obj.TLM_ObjectProperties.tlm_mesh_lightmap_unwrap_mode == "AtlasGroupA": + atlasName = obj.TLM_ObjectProperties.tlm_atlas_pointer + img_name = atlasName + '_baked' + Lightmapimage = bpy.data.images[img_name] + obj["Lightmap"] = Lightmapimage.filepath_raw + elif obj.TLM_ObjectProperties.tlm_postpack_object: + atlasName = obj.TLM_ObjectProperties.tlm_postatlas_pointer + img_name = atlasName + '_baked' + ".hdr" + Lightmapimage = bpy.data.images[img_name] + obj["Lightmap"] = Lightmapimage.filepath_raw + else: + img_name = obj.name + '_baked' + Lightmapimage = bpy.data.images[img_name] + obj["Lightmap"] = Lightmapimage.filepath_raw + except: + pass for image in bpy.data.images: if image.name.endswith("_baked"): From c1d14e94f9f588f50c3a18ce53b27d62903889b9 Mon Sep 17 00:00:00 2001 From: Alexander Kleemann Date: Mon, 14 Aug 2023 14:08:14 +0200 Subject: [PATCH 2/3] Revert to version without lightmap paths (for non-bg bakes) --- addon/utility/build.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addon/utility/build.py b/addon/utility/build.py index f5b32e1..84d36b6 100644 --- a/addon/utility/build.py +++ b/addon/utility/build.py @@ -961,7 +961,7 @@ def manage_build(background_pass=False, load_atlas=0): if mat.name.startswith("."): if "_Original" in mat.name: bpy.data.materials.remove(mat) - try: + for obj in bpy.context.scene.objects: if obj.type == 'MESH' and obj.name in bpy.context.view_layer.objects: if obj.TLM_ObjectProperties.tlm_mesh_lightmap_use: @@ -980,8 +980,6 @@ def manage_build(background_pass=False, load_atlas=0): img_name = obj.name + '_baked' Lightmapimage = bpy.data.images[img_name] obj["Lightmap"] = Lightmapimage.filepath_raw - except: - pass for image in bpy.data.images: if image.name.endswith("_baked"): @@ -1363,4 +1361,3 @@ def checkAtlasSize(): return True else: return False - From b688b2e1d217de83aa7e1e4a78623e87e6481ceb Mon Sep 17 00:00:00 2001 From: Alexander Kleemann Date: Mon, 14 Aug 2023 14:19:22 +0200 Subject: [PATCH 3/3] Add possible fix for missing property paths --- addon/utility/build.py | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/addon/utility/build.py b/addon/utility/build.py index 84d36b6..fbf28dc 100644 --- a/addon/utility/build.py +++ b/addon/utility/build.py @@ -962,29 +962,6 @@ def manage_build(background_pass=False, load_atlas=0): if "_Original" in mat.name: bpy.data.materials.remove(mat) - for obj in bpy.context.scene.objects: - if obj.type == 'MESH' and obj.name in bpy.context.view_layer.objects: - if obj.TLM_ObjectProperties.tlm_mesh_lightmap_use: - - if obj.TLM_ObjectProperties.tlm_mesh_lightmap_unwrap_mode == "AtlasGroupA": - atlasName = obj.TLM_ObjectProperties.tlm_atlas_pointer - img_name = atlasName + '_baked' - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw - elif obj.TLM_ObjectProperties.tlm_postpack_object: - atlasName = obj.TLM_ObjectProperties.tlm_postatlas_pointer - img_name = atlasName + '_baked' + ".hdr" - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw - else: - img_name = obj.name + '_baked' - Lightmapimage = bpy.data.images[img_name] - obj["Lightmap"] = Lightmapimage.filepath_raw - - for image in bpy.data.images: - if image.name.endswith("_baked"): - bpy.data.images.remove(image, do_unlink=True) - if "tlm_plus_mode" in bpy.app.driver_namespace: #First DIR pass if bpy.app.driver_namespace["tlm_plus_mode"] == 1: #First DIR pass