1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2025-01-19 15:38:39 +01:00

When exporting PSKs, armatures with no bones are now more sensibly handled

umodel, for some reason, exports some models with no bones. For
compatibility and convenience, an armature with no bones may as well not
exist, so we treat it as though it doesn't on export, and a single fake
root bone is added for maximum compatibility.
This commit is contained in:
Colin Basnett 2024-03-01 15:14:37 -08:00
parent 15e2c6ccdd
commit 4d41f1af83

View File

@ -76,9 +76,9 @@ def build_psk(context, options: PskBuildOptions) -> PskBuildResult:
psk = Psk()
bones = []
if armature_object is None:
# If the mesh has no armature object, simply assign it a dummy bone at the root to satisfy the requirement
# that a PSK file must have at least one bone.
if armature_object is None or len(armature_object.data.bones) == 0:
# If the mesh has no armature object or no bones, simply assign it a dummy bone at the root to satisfy the
# requirement that a PSK file must have at least one bone.
psk_bone = Psk.Bone()
psk_bone.name = bytes('root', encoding='windows-1252')
psk_bone.flags = 0