DarklightGames / io_scene_psk_psa

A Blender extension for importing and exporting Unreal PSK and PSA files
GNU General Public License v3.0
310 stars 20 forks source link

Face bone positons/rotations corrupt when importing animations #85

Closed Spantle closed 3 months ago

Spantle commented 3 months ago

Versions Blender: 4.0.2 io_scene_psk_psa: 6.2.0

Describe the bug Upon exporting the character animations from UModel and importing them into Blender, the face bones appear to be offset and corrupt. Resetting the face bones to their default locations/rotations fixes them and restores the default face, but this means that the facial animations can't be restored.

I've tried subtracting the offsets, moving bones manually, and a whole heap of other things, but the facial animations seem unrecoverable. Is there anything that can be done?

To Reproduce Steps to reproduce the behavior:

  1. Export the model and animations from UModel
  2. Import the model animations into Blender
  3. Apply the Action to the model

Screenshots If applicable, add screenshots to help explain your problem. Here's a normal animation in UModel (animation 1): umodel_acl_1 3_2024-03-23_19-24-29 Here's a facial animation in UModel (animation 2): umodel_acl_1 3_2024-03-23_19-34-43 Here's animation 1 in Blender: blender_2024-03-23_19-28-28 Here's animation 2 in Blender: blender_2024-03-23_19-34-09

Files Please post attachments of the PSK and/or PSA files that you are using to encounter the bug, if any. I would've uploaded the files directly, but GitHub does not allow PSK or PSA files to be uploaded (for some reason?) so I have zipped them. I hope this is OK. PSK and PSAs.zip

Additional context Add any other context about the problem here. These animations were exported using a special version of UModel found here as the game uses an older version of ACL (1.3).

cmbasnett commented 3 months ago

Issue #83 reports the same thing about face bones going wild. Is there a warning about missing bones when the PSA is imported? I'm always a little wary when people start using experimental builds of UModel, there's no telling if the export is just simply incorrect or if there's some special flags I'm not reading or something.

Spantle commented 3 months ago

Issue #83 reports the same thing about face bones going wild. Is there a warning about missing bones when the PSA is imported? I'm always a little wary when people start using experimental builds of UModel, there's no telling if the export is just simply incorrect or if there's some special flags I'm not reading or something.

I thought the same thing hence why I thought to raise the issue to the UModel team and they helped me confirm that the issue is in fact with this importer plugin. By using this older unmaintained importer plugin the results are definitely much much better (although still not perfect possibly due to retargeting or an issue with the plugin, I'm not certain)

EDIT: Sorry, I linked the wrong plugin

Spantle commented 3 months ago

I found and tried another plugin, and this one appears to produce seemingly perfect results. I hope you can use it as a reference to maybe fix your plugin since yours has better features overall.

cmbasnett commented 3 months ago

I figured out the issue here, it's actually a relatively easy fix.

The issue is that the PSK and the PSA bones are named the same, but the casing differs (i.e., root and Root, face and Face etc.) There's a way to tell it to match the bone names ignoring case, but there's a bug with it because I hadn't tested it properly after making some changes. I really need to add some unit tests or something!

In addition, I've fixed the body itself being flipped all over the place. I will push out a fix for this as soon as I can.

image

cmbasnett commented 3 months ago

Please try out the pre-release version, this should now work. Let me know how it goes: https://github.com/DarklightGames/io_scene_psk_psa/releases/tag/6.2.1 . If this solves it for you I will close the issue.

Spantle commented 3 months ago

I think it seems to all be fixed and working perfectly now, thank you! Thank you for also fixing the issue with the model being sideways.