1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2024-11-15 02:37:39 +01:00

Set the parent index of the root bone to 0 instead of -1

In normal UE2 derivates, it doesn't appear to matter what the parent index is; but in UE1 games that have basic support for PSK importing (i.e. Harry Potter 2), the parent index of the root bone must be `0` otherwise the import fails.
This commit is contained in:
Colin Basnett 2023-07-28 03:18:05 -07:00
parent 160a6b22f6
commit 25bf8f2087
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ def build_psa(context: bpy.types.Context, options: PsaBuildOptions) -> Psa:
psa_bone.parent_index = parent_index psa_bone.parent_index = parent_index
psa.bones[parent_index].children_count += 1 psa.bones[parent_index].children_count += 1
except ValueError: except ValueError:
psa_bone.parent_index = -1 psa_bone.parent_index = 0
if bone.parent is not None: if bone.parent is not None:
rotation = bone.matrix.to_quaternion().conjugated() rotation = bone.matrix.to_quaternion().conjugated()

View File

@ -97,7 +97,7 @@ def build_psk(context, options: PskBuildOptions) -> Psk:
psk_bone.parent_index = parent_index psk_bone.parent_index = parent_index
psk.bones[parent_index].children_count += 1 psk.bones[parent_index].children_count += 1
except ValueError: except ValueError:
psk_bone.parent_index = -1 psk_bone.parent_index = 0
if bone.parent is not None: if bone.parent is not None:
rotation = bone.matrix.to_quaternion().conjugated() rotation = bone.matrix.to_quaternion().conjugated()