Skip to content

Commit

Permalink
Automatically drop .gla extension in glm header
Browse files Browse the repository at this point in the history
Users are now free to include .gla in the gla reference export setting,
it will be dropped automatically to ensure the game can load the file.

Fixes #51.
  • Loading branch information
mrwonko committed May 8, 2024
1 parent da73769 commit 8b1c14a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion JAG2GLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,8 @@ def loadFromFile(self, filepath_abs: str) -> Tuple[bool, ErrorMessage]:

def loadFromBlender(self, glm_filepath_rel: str, gla_filepath_rel: str, basepath: str) -> Tuple[bool, ErrorMessage]:
self.header.name = glm_filepath_rel.replace("\\", "/").encode()
self.header.animName = gla_filepath_rel.encode()
# the .gla extension must be omitted
self.header.animName = gla_filepath_rel.removesuffix(".gla").encode()
# create BoneName->BoneIndex lookup table based on GLA file (keeping in mind it might be "*default"/"")
defaultSkeleton: bool = (gla_filepath_rel ==
"" or gla_filepath_rel == "*default")
Expand Down

0 comments on commit 8b1c14a

Please sign in to comment.