Many msh files (e.g. those in BFX) have multiple models assigned to the same index (MNDX). Indices should be linked only to the first model that uses them to ensure proper skinning.

This commit is contained in:
William Herald Snyder 2022-10-09 00:15:29 -04:00
parent 432c9ff380
commit 613cb20678
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
bl_info = {
'name': 'SWBF .msh Import-Export',
'author': 'Will Snyder, SleepKiller',
"version": (1, 0, 0),
"version": (1, 2, 1),
'blender': (2, 80, 0),
'location': 'File > Import-Export',
'description': 'Export as SWBF .msh file',

View File

@ -203,7 +203,9 @@ def _read_modl(modl: Reader, materials_list: List[Material]) -> Model:
global model_counter
global mndx_remap
mndx_remap[index] = model_counter
if index not in mndx_remap:
mndx_remap[index] = model_counter
model_counter += 1