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

Armature scale issue when importing psa animation with a scaled down model. #87

Open Hans-xwh opened 3 months ago

Hans-xwh commented 3 months ago

Versions Blender: 4.1 io_scene_psk_psa: 7.0.0

Describe the bug Importing a psa animation and applying it to an armature is not working properly, the bones deform badly, the scale of the motion seems to be the problem. Both the model and the motion are from the same game, so that shouldn't be a problem. I'll attach a video of the mentioned issue. The robot model is scaled down, but it used to work like that.

https://github.com/DarklightGames/io_scene_psk_psa/assets/95545028/131def7f-020c-4475-b24f-1022a16863fe

Expected behavior The exact same process, with the same files used to work fine on another psa/psk addon, which is no longer fully compatible with blender 4.1 and will not be maintained, that's why i decided to try this one. Here's a video of how it should look like.

https://github.com/DarklightGames/io_scene_psk_psa/assets/95545028/4c070c05-dc9a-4e40-8867-b39669f7f056

Screenshots Screenshot of the log window on the first video, in the case it is of any help. I don't think the render region error is related though. image

I'm not sure if can share the files, as those are game rips. If you need more info, or if i can help in any way let me know!

cmbasnett commented 2 months ago

Hi, thanks for your report. Please send the PSK and PSA files you are using to encounter this issue.

Hans-xwh commented 2 months ago

Hi. I'll attach the psa i used and the model in a zip archive. The model i use i keep it in a .blend file, and i append it when i want to use it. I do this because models from this game are separated by parts, and having to rebuild the model each time is not very practical. If you need anything else, feel free to contact me.

Model & Psa.zip

cmbasnett commented 2 months ago

The ghost of that other plugin is still haunting people to this day it seems. The old plugin that people were using would, be default, scale things down by 100x for really no discernible reason. It was objectively a mistake on the previous author's part and it's caused no end of headaches over the years.

So the issue here is that the model has been scaled down and has had the transformation applied to the bones. This means that the location of all the bones in the bind position are totally wrong compared to the PSA. The only reason this worked with the old plugin was that it stored data about the original location in the bone's custom properties.

I recommend simply scaling the armature up by 100x and then applying the transformation. This will make the model match the incoming PSA animations.

https://github.com/DarklightGames/io_scene_psk_psa/assets/5035660/3458b1e0-f3f5-412f-9a19-9973b17031b6

Hans-xwh commented 2 months ago

Hi, thanks for the response. Indeed scaling the armature by 100x makes the psa import work. However, working with models that big is very impractical, specially for the purpose of retargeting animations.

Maybe it is possible to add a functionality to scale the animation on import? I've seen something like this on the plugging mmd tools where you can scale the animation by a factor before importing to make it fit any model/armature size. That would really be a solution.

cmbasnett commented 2 months ago

Maybe it is possible to add a functionality to scale the animation on import? I've seen something like this on the plugging mmd tools where you can scale the animation by a factor before importing to make it fit any model/armature size. That would really be a solution.

I can add something like this for compatibility's sake, that should be easy enough to do. I'll probably bury it in an "advanced" sub-panel though because it's not likely to be used by most folks.

Hans-xwh commented 2 months ago

I can add something like this for compatibility's sake, that should be easy enough to do. I'll probably bury it in an "advanced" sub-panel though because it's not likely to be used by most folks.

Thanks. This feature will be very appreciated, I'll be in wait for the next release.