Beherith / Skeletor_S3O

A blender script that automatically generates a skeleton for an s3o imported model for SpringRTS animation. Makes .BOS exported script from animation too.
https://www.beyondallreason.info/
GNU General Public License v3.0
2 stars 2 forks source link

Export function does create an almost empty file #5

Open azaremoth opened 3 years ago

azaremoth commented 3 years ago

The export script is not including any animation in the exported text file without any error. Does happen for the latest py script as well as for the older one (without scaling/animation speed options). MAybe it is related to the setup of the file, however, I do not find the issue.

Export results: https://github.com/azaremoth/cursed/blob/master/Objects3d/euf_walker.blend.bos_export.txt

Blender file (Blender 2.83): https://github.com/azaremoth/cursed/blob/master/Objects3d/euf_walker.blend

Beherith commented 3 years ago

Ok, some findings:

  1. Somehow, there is an old version of skeletor plugin somehow bundled into your .blend file, which I dont know how got there, but its overriding my latest version when I open yours. You should absolultely use the latest version, just disable variable scale and variable amplitude if you dont need them (their perf cost isnt much if you keep them on, variable scale is for when you have the same model in different sizes, and move commands must be scaled with the model)

Variable amplitude is a whole different and much more useful beast, it allows you control over how big of a 'step' your unit will make, quite literally, and some very clever things can be done with it, but totally optional.

image

  1. The reason its empty is shown in blender is in window/toggle system console (whose output isnt very helpful to non devs), but the gist is:

You only have keyframes assigned to bones that are IK targets. When the script looks through all the keyframes, it ignores bone movements that are at ik targets, thus thinking that there is no actual animation data present.

TLDR Solution:

Have at least 3 keyframes at different times on a real bone (not iktarget), usually the pelvis or whatever, it doesnt matter if the bone doesnt move, just have at least one bone have a non-iktarget keyframe assigned to it whenever you have a keyframe on an iktarget. e.g.:

A side note: I highly recommend spacing keyframes evenly, as thats when speed interpolation will work the best, as shown below:

image

Beherith commented 3 years ago

Also, lua anim export is coming along, thanks to @psimyn (its 99% usable) in the relevant PR in this repo (I believe he still has his fully lua version in WIP in the ZK repo).