mos9527 / sssekai_blender_io

Project SEKAI Blender Asset Importer / PJSK 资源导入插件
https://github.com/mos9527/sssekai
MIT License
10 stars 0 forks source link

Some file refused to load but it works on AssetStudio #4

Closed Hazuki-san closed 5 months ago

Hazuki-san commented 5 months ago

Console output:

* Loading index for C:\Users\Aoba\Desktop\ProSekaiModel\kit\folder1\
Traceback (most recent call last):
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\addon.py", line 334, in enumerate_assets
    sssekai_global.articulations, sssekai_global.armatures = search_env_meshes(sssekai_global.env)
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\asset.py", line 87, in search_env_meshes
    dfs(root)
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\asset.py", line 86, in dfs
    dfs(child.read(), bone)
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\asset.py", line 86, in dfs
    dfs(child.read(), bone)
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\asset.py", line 86, in dfs
    dfs(child.read(), bone)
  [Previous line repeated 6 more times]
  File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\asset.py", line 65, in dfs
    bonePhysics.pivot = path_id_tbl[physics['pivotNode']['m_PathID']].name
KeyError: 0
File "C:\Users\Aoba\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\sssekai_blender_io-master\blender\addon.py", line 314, in enumerate_assets

AssetBundle in question: kit01_men.zip

mos9527 commented 5 months ago

I've added a null check here. Which seems to fix the apparent exception and allowed the model (and its physics constraints) to load properly on my machine. FYI this value (bonePhysics.pivot) isn't really used. Meaning feature wise this shouldn't affect anything the addon has implemented.

Hazuki-san commented 5 months ago

image Seems to be fixed on my end, i think you can close this issue now