blender3d_import_psk_psa icon indicating copy to clipboard operation
blender3d_import_psk_psa copied to clipboard

Some more Animations are broken upon Import PSA on models

Open AnimNyan opened this issue 3 years ago • 7 comments

If you're still developing this plugin, I am happy to work with you on the issue or your plugin, I've done a bit of blender scripting so if you want to find me here on github or on Discord here: Anime Nyan#5897

So the problem is the psk/psa blender plugin is causing some animations to break, whilst with the ActorX 3ds max plugin made by Gildor these same animations work just fine. So in 3ds max with the official maxscript it works fine. I have made sure Don't invert Root Bone is enabled and used the default settings + Reorient Bones enabled like so: https://imgur.com/slSftK6

I have had a detailed look at the problem and the problem happens as the psk/psa importer adds non zero keyframes to the rotation and location which is not supposed to happen for the following bones: ['joint_HandRoll01LT_01','joint_HandRoll01LT_02','joint_HandRoll01RT_01','joint_HandRoll01RT_02','joint_ShoulderRollOffRT_01','joint_ShoulderRollOffLT_01','joint_Jaw01','joint_WeaponLT_01','joint_WeaponRT_01','joint_ShoulderRollLT_02','joint_ShoulderRollRT_02','joint_KneeRollRT_01','joint_KneeRollLT_01']

To solve the issue I can clear all movement, rotation and scale transforms to the following bones and delete these incorrect keyframes, but this is a bandaid fix.

I have also found that it might be due to this line of code: loc = (p_pos - psa_bone.orig_loc) the psa_bone.orig_loc is non zero which is causing the the location to be non zero.

as well as these ones: psa_bone.fcurve_quat_w.keyframe_points[i].co = i, quat.w psa_bone.fcurve_quat_x.keyframe_points[i].co = i, quat.x psa_bone.fcurve_quat_y.keyframe_points[i].co = i, quat.y psa_bone.fcurve_quat_z.keyframe_points[i].co = i, quat.z

as extra non zero rotations are also part of the problem.

I have also printed out the Bones array in the psaimport function to try and find the root of the psa_bone.orig_loc problem but it prints out the vec_x, vec_y and vec_z just fine there so honestly I am just confused.

I've attached images on everything I have tried to research into in the imgur below:

Model and Broken Animations (PSK and PSA): https://drive.google.com/file/d/1HqNEyuFw9BV12nnVJEZCgQ_j8gtFrbc7/view?usp=sharing

Imgur to detailed issues: https://imgur.com/a/UBvxL9u

AnimNyan avatar Jul 01 '21 02:07 AnimNyan

hey :) it's summer time!
thanks for details!

Are you sure about correct import in 3dsMax ?
3DS Max 2016 importing ( ActorXImporter ) animation with the same defects.

image

Befzz avatar Jul 18 '21 00:07 Befzz

Apologies might have been my fault with those animations but this time I tested them as you can see from this imgur in 3ds max 2017 all these animations are broken in blender and I can confirm from these screenshots are not broken in 3ds max.

Imgur link to broken animations: https://imgur.com/a/jI85tB5

And here are the related files for you to test: https://drive.google.com/file/d/1_hkXTTOqImisPK3jGf_KPRC-CF0b7L_M/view?usp=sharing

I know that you've basically stopped working on this project, so I understand that it is unlikely this problem will ever be solved, so if you need any help or have any pointers at what I should be looking at in your code to fix it myself that would be fantastic as well.

AnimNyan avatar Jul 31 '21 14:07 AnimNyan

A small note I have found this issue to be consistent through all the models for the game I am trying for dead by daylight and to import the animations I have just set the psk/psa importer to all and imported the animations separately to each armature and the issue still occurs.

AnimNyan avatar Jul 31 '21 14:07 AnimNyan

Can you share your ActorXImporter plugin?
1.38 right?
bcs idk where the problem is....

(picture from 3ds max)
image

Befzz avatar Jul 31 '21 16:07 Befzz

Apologies for the late reply. Yep I'm using ActorX 1.38 I've tried it both in 3ds max 2022 and 2017 and the animations import correctly in both.

Okay I've changed to 3ds Max 2022 to test it again and I may have a lead to what the problem is that the blender add on. So basically the thing is the ActorX plugin only works properly if the .config files for the psa animation files (the config files with the same name as the psa files) are still there. So what I did the previous two times is just send you the psk and psa files. That caused 3ds max to have the same problems as Blender.

I might be wrong here but I think the Actor X 3ds max plugin is reading the data from the .config files with the same name as the animation files in the same folder. The .config files have some kind of data that I think that the blender psk/psa script just isn't reading causing the problem.

I'm not sure if the props.txt files might have some data as well but in my testing deleting the props.txt files with the same name as the animation had no effect. However, deleting the .config files with the same name had a marked effect causing the animation to cause the weird distortion of the mesh.

Proof they're working with 3ds max: https://cdn.discordapp.com/attachments/783639279213215757/871685645691670528/unknown.png

So this time I sent you the full folder without moving the psk/psa files, because I'm pretty sure not including some .config files is causing the errors you are seeing in 3ds max: https://drive.google.com/file/d/1vAEt-AmiDmwsbH_7Rw1MI9DwrXDk4h4F/view?usp=sharing

Sorry for it being annoying but the paths for the related files are here: Huntress: Model: Broken Huntress + Yui Animations\Game\Characters\Slashers\Bear\Models\Bodies\BE_Body01_REF.psk

Animations Broken Huntress + Yui Animations\Game\Characters\Slashers\Bear\AnimSequences\Attacks\BE_Attack01_BOW.psa

Yui Model: Broken Huntress + Yui Animations\Game\Characters\Campers\Sweden\Models\Heads\SS_Heads00_REF.psk Broken Huntress + Yui Animations\Game\Characters\Campers\Sweden\Models\Torsos\SS_Torso01_REF.psk Broken Huntress + Yui Animations\Game\Characters\Campers\Sweden\Models\Legs\SS_Legs01_REF.psk

Animations Broken Huntress + Yui Animations\Game\Characters\Campers\Common\Animation\Female\AnimSequences_NEXTGEN\Loco_Inj\F_inj_CrouchWalk.psa Broken Huntress + Yui Animations\Game\Characters\Campers\Common\Animation\Female\AnimSequences_NEXTGEN\Loco_Inj\F_Inj_StandIdle.psa Broken Huntress + Yui Animations\Game\Characters\Campers\Common\Animation\Female\AnimSequences\InjuredLocomotion\F_InjuredIdleStand.psa

Apologies for all the trouble and if you need any help I am happy to do as much as I possibly can. If it's too much stuff to change and requires an entire rework of the plugin, ignoring this is completely okay too.

AnimNyan avatar Aug 02 '21 11:08 AnimNyan

If it helps at all reading the .config file I found it has a section called bAnimRotationOnly=1

[UseTranslationBoneNames] joint_Char joint_Pelvis_01 joint_FacialGroup cheek_LT_01 cheek_RT_01 ...

and then a list of bone names maybe it's saying for most bones only use Rotation except for these specific bones that also have to use Translation (guessing movement transforms)? Though I tried enabling the rotation only option in Blender and importing the psa file with the your psk/psa add on and does not really help.

Either that or this section here: [RemoveTracks] F_Inj_StandIdle.7=all F_Inj_StandIdle.8=all F_Inj_StandIdle.9=all

Though I can't quite figure out what this RemoveTracks is referring to maybe bone numbers? But honestly this one seems less likely to be what is solving the weird mesh distortion issue with the Actor X plugin in 3ds max

AnimNyan avatar Aug 02 '21 11:08 AnimNyan

wow!
You did a really good job ♥
I didnt know about .config files, now i just need to implement ActorXImporter's .config files functionality.
👍

Befzz avatar Aug 02 '21 18:08 Befzz