You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some vanilla models, such as 003ebol.mdl/mdx from TSL, fail to completely import and return the error "local variable 'diffuse_tex' referenced before assignment" when using KotorBlender 3.10.3 with Blender 4.0. I am still able to import the model using version 3.5.2 with Blender 2.93, so I'm guessing it's something that changed between those two versions. I have attached 003ebol.mdl/mdx for reference. 003ebol.zip
The text was updated successfully, but these errors were encountered:
To provide some additional context, it seems like it chokes when parsing the mesh engpanlight (which is the only mesh with the LEH_light01 diffuse). It is lightmapped and has self-illum, if that is relevant.
Loading image: G:\Star Wars Knights of the Old Republic\-=TOOLS=-\KOTOR Tool\working\TEXTURES\K1\LEH_light01.tga
Traceback (most recent call last):
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\ops\lyt\importop.py", line 68, in execute
lyt.load_lyt(self, self.filepath, options)
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\io\lyt.py", line 61, in load_lyt
mdl.load_mdl(operator, mdl_path, options, room[1:])
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\io\mdl.py", line 80, in load_mdl
model_root = model.add_to_collection(collection, options, position)
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\scene\model.py", line 70, in add_to_collection
self.import_nodes_to_collection(child, root_obj, collection, options)
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\scene\model.py", line 105, in import_nodes_to_collection
obj = node.add_to_collection(collection, options)
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\scene\modelnode\trimesh.py", line 158, in add_to_collection
material.rebuild_object_materials(
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\scene\material.py", line 79, in rebuild_object_materials
rebuild_material_textured(
File "D:\Blender\3.6.2 LTS\3.6\scripts\addons\io_scene_kotor\scene\material.py", line 228, in rebuild_material_textured
links.new(mul_diffuse_lightmap.inputs[0], diffuse_tex.outputs[0])
UnboundLocalError: local variable 'diffuse_tex' referenced before assignment
Alternatively, the node after that one is the walkmesh, then the following one is Box19, which has a lightmap but no diffuse.
Edit: Yes, it's meshes with lightmaps but no diffuse that it is choking on. Occurs with both 003EBOl and 003EBOq (meshes Box19 and Box18, respectively). Editing those in KMax to assign a diffuse and then recompiling, KBlender will load the layout without error.
Some vanilla models, such as 003ebol.mdl/mdx from TSL, fail to completely import and return the error "local variable 'diffuse_tex' referenced before assignment" when using KotorBlender 3.10.3 with Blender 4.0. I am still able to import the model using version 3.5.2 with Blender 2.93, so I'm guessing it's something that changed between those two versions. I have attached 003ebol.mdl/mdx for reference.
003ebol.zip
The text was updated successfully, but these errors were encountered: