Skip to content

Commit

Permalink
Fix for export
Browse files Browse the repository at this point in the history
- ignore meshes with broken UV during tangents calculation
- add null material hash for mrl features
  • Loading branch information
HenryOfCarim committed Nov 24, 2024
1 parent 605291e commit 15f9970
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions albam/engines/mtfw/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
MRL_MATERIAL_TYPE_STR_TO_ID = {ext_desc: h for h, ext_desc in MRL_MATERIAL_TYPE_STR.items()}

MRL_PER_MATERIAL_FEATURES = {
0x854D484: [],
0x5FB0EBE4: ["FVertexDisplacement"],
0x7D2B31B3: ["FVertexDisplacement"],
0x1CAB245E: ["CBDDMaterialParam",
Expand Down
6 changes: 5 additions & 1 deletion albam/lib/blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ def get_tangents_per_vertex(blender_mesh):
uv_name = blender_mesh.uv_layers[0].name
except IndexError:
return tangents
blender_mesh.calc_tangents(uvmap=uv_name)
try:
blender_mesh.calc_tangents(uvmap=uv_name)
except RuntimeError:
print("Mesh {} has no UV".format(blender_mesh.name))
return tangents
for loop in blender_mesh.loops:
tangents.setdefault(loop.vertex_index, loop.tangent)
return tangents
Expand Down

0 comments on commit 15f9970

Please sign in to comment.