Befzz / blender3d_import_psk_psa

import mesh, skeleton, animation from psk, psa files to blender3d
487 stars 168 forks source link

key "orig_quat" not found' #18

Closed oxcxsxixbxaxn closed 6 years ago

oxcxsxixbxaxn commented 6 years ago

I have a model that was originally exported from umodel (fortnite) but is now in XPS format It seems to have the original skeleton/bones in tact when I import this into blender, but when I try to import animations from a psa,I get the below:

Is something stripped from the bones? do I need to recreate them somehow? What is the minimum requirement for bones in a model for it to work with PSA import? I unfortunately have no other way to get the original model as it is no longer in the game...

Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_import_scene_unreal_psa_psk_280.py", line 1731, in execute error_callback = util_ui_show_msg File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_import_scene_unreal_psa_psk_280.py", line 1185, in psaimport armature_obj.pose.bones[orig_name]) File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_import_scene_unreal_psa_psk_280.py", line 1145, in new_psa_bone psa_bone.orig_quat = Quaternion(bone['orig_quat']) KeyError: 'bpy_struct[key]: key "orig_quat" not found'

Befzz commented 6 years ago

psk:
1) original skeleton data ( bone rotation and location ) is stored in bone custom property (orig_quat, orig_loc ). So called "bind pose". It is required because bones, when imported is realigned to "look nicer".

psa:
When importing animation, the original data(bind pose) is available through the custom property(orig_quat, orig_loc ). Each Blender's keyframe is the "difference" between bindpose and psa-keyframe data. Without this data, this plugin will not work.

However. If model that you have is created without "realign bones"(original rotation is used to align bones), it may be possible to import psa over it with correct result, BUT some programming is required.

Befzz commented 6 years ago

@oxcxsxixbxaxn Share the model(skeleton), and psa file. I'll look at it.

oxcxsxixbxaxn commented 6 years ago

thanks, can see those custom properties in other models, but they are indeed missing from this xps import, I'm fairly sure the bones are unchanged in relation to the skeleton, but the scale and overall rotate is out and the names look a bit messed up

I guess the programming you refer to is to calculate and write these for each bone?

I have attached the xps and a small psa which is just a simple one experted from the game.

I've uploaded a blender of just the skeleton and larger file with the whole model and skeleton in case you don't have the xps import add-on handy.

Befzz commented 6 years ago

Oooooookey... this is a best that i can do:

thanos_cantfix

( I have renamed the bones (replaced Space with Underscore) and then applied modified psa import )

I can't get better result, because, AFAIU, .xps importer is reorienting bones to children (so "bind pose" got lost) and i think that .xps data by itself is not looks compatible with .psa data.

Therefore, no correct "bind pose" -> no correct animation.

It is, probably possible to get good result, but it is require digging in .xps(file format, editing xnalara plugin, lot of tests and time...).

oxcxsxixbxaxn commented 6 years ago

Thanks for looking and the explanation, though this model is not usable I learned some things. Let's close this one.

Thanks