Skip to content

Commit

Permalink
fix sp infantry
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemrav committed Dec 16, 2024
1 parent 8e911c8 commit 5467a8d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions game/src/Game/Model/XACLoader.gd
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,6 @@ static func _load_xac_model(source_file : String, is_unit : bool) -> Node3D:
push_warning("Skipping unused mesh \"", mesh_chunk_name, "\" in model \"", node.name, "\"")
continue

# polySurface97 corresponds to the "arab_infantry_helmet", and needs to be removed often
# but only in cases where it isn't an attachment
const INVALID_IF_NOT_ONLY_MESH : PackedStringArray = ["polySurface97"]
if mesh_chunks.size() != 1 and mesh_chunk_name in INVALID_IF_NOT_ONLY_MESH:
push_warning("Skipping unused mesh \"", mesh_chunk_name, "\" in model \"", node.name, "\" because it was not the only mesh chunk in its file")
break

var mesh : ArrayMesh = null
var verts : PackedVector3Array
var normals : PackedVector3Array
Expand Down Expand Up @@ -200,6 +193,16 @@ static func _load_xac_model(source_file : String, is_unit : bool) -> Node3D:
skinning_chunk_ind = 1
applyVertexWeights = false

# polySurface97 corresponds to the "arab_infantry_helmet", and needs to be removed often
# but only in cases where it isn't an attachment
# problem, this is also the body of the S-P infantry
# so this should only be valid if inside an attachment or makes use of bone weights
const INVALID_IF_NOT_ONLY_MESH : PackedStringArray = ["polySurface97"]
if influenceRangeInd.is_empty() or skinningChunks.is_empty() or not applyVertexWeights:
if mesh_chunks.size() != 1 and mesh_chunk_name in INVALID_IF_NOT_ONLY_MESH:
push_warning("Skipping unused mesh \"", mesh_chunk_name, "\" in model \"", node.name, "\" because it was not the only mesh chunk in its file")
break

var meshInstance : MeshInstance3D = MeshInstance3D.new()
node.add_child(meshInstance)
meshInstance.owner = node
Expand Down

0 comments on commit 5467a8d

Please sign in to comment.