Skip to content

Commit

Permalink
Improve ms2 versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Sep 19, 2023
1 parent 0a4f385 commit d321835
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions generated/formats/ms2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def save(self, filepath):
# for modelstreams, trailing _ is ignored
self.basename = os.path.splitext(self.name)[0].rstrip("_")
logging.info("Pre-writing buffers")
# just a quick hack to support WH
for model_info in self.model_infos:
if hasattr(model_info.bone_info, "bone_limits"):
if self.context.version < 53:
model_info.bone_info.bone_limits.index = 255
self.info.mdl_2_count = len(self.model_infos)
self.update_names()
self.update_buffer_0_bytes()
Expand Down
5 changes: 5 additions & 0 deletions source/formats/ms2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ def save(self, filepath):
# for modelstreams, trailing _ is ignored
self.basename = os.path.splitext(self.name)[0].rstrip("_")
logging.info("Pre-writing buffers")
# just a quick hack to support WH
for model_info in self.model_infos:
if hasattr(model_info.bone_info, "bone_limits"):
if self.context.version < 53:
model_info.bone_info.bone_limits.index = 255
self.info.mdl_2_count = len(self.model_infos)
self.update_names()
self.update_buffer_0_bytes()
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc5f62433 - Tue Sep 19 20:28:08 2023 +0200
0a4f3856d - Tue Sep 19 20:31:41 2023 +0200

0 comments on commit d321835

Please sign in to comment.