From 8b1c14adc961caf298a60071835bf97a597caf8d Mon Sep 17 00:00:00 2001 From: Willi Schinmeyer Date: Wed, 8 May 2024 13:21:59 +0200 Subject: [PATCH] Automatically drop .gla extension in glm header 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. --- JAG2GLM.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/JAG2GLM.py b/JAG2GLM.py index 54b9b1c..773612f 100644 --- a/JAG2GLM.py +++ b/JAG2GLM.py @@ -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")