Author Topic: Need help with new Sephiroth skeleton animations  (Read 272 times)

Kaldarasha

  • No life
  • *
  • Posts: 2119
  • Karma: 126
  • Prince of Model Editing
    • View Profile
Need help with new Sephiroth skeleton animations
« on: 2017-04-23 19:08:41 »
It doesn't help but I have to ask for help. There are animations are ridicules long and doesn't even need the coat animated. These are not also unnecessary time eaters but means also a lot of work and stress for something that could be done easier with a tool. All I need is a small tool which adds the new bones to the animation. As far I understand the info from the wiki an animation has a header with the information of the number of frames and the number of bones (and some other stuff I don't understand) then the file consist out of a followup of (floats)numbers.
It starts with three numbers for the root rotation, the next three are for the root translation and then follow the numbers for the bones (again three for each). This means, if we have a skeleton with 24 bones and an animation with two frames, it will have for its first frame 78 numbers. The 79th number is the first of the three numbers for the root rotation of the second frame.
Example with a skeleton with 2 bones and 3 frames

Header|root rotation f1|root translation f1|bone 1 f1|bone 2f1|root rotation f2|root translation f2|bone 1 f2|bone 2f2|root rotation f3|root translation f3|bone 1 f3|bone 2f3|
2bones; 3framesxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz

As you can see on the wiki the header has more information but I guess they don't need to be edited.
So far so good.

What I need, is a tool, which will inject additional bone rotations into the animation file. The best way I could think of to realize that is to load the original models hrc file and then the animation, which should be ported to the new skeleton. For that it's necessary to load the new hrc of the model to have a comparison for the program to know which bones are new. When it writes the animation for the new file, it firstly updates the number of bones in the header, then it checks if the current bone of the new skeleton has in the original hrc a corresponding bone and if yes it writes the coords for the current frame from it and if not then it writes zeros and goes on.
Example:

                          Old Skeleton                          New Skeleton                          write
bone                head-chest                          head-chest
x  rotation              7,0312                          ------                          7,0312
y  rotation              0                          ------                          0
z  rotation              359,9121             
             
------                          359,9121
bone                N/A                          coat-hip
x  rotation              N/A                          ------                          0
y  rotation              N/A                          ------                          0
z  rotation              N/A             
             
------                          0

And we shouldn't forget the six numbers for the root rotation and transition at the start of every frame, but these don't need an edit so it might be good to take them over from the original a file to the new one.

And this how I think an animation file (taking my first example) will look after the change:

Header|root rotation f1|root translation f1|bone 1 f1|new_bone  f1|bone 2f1|root rotation f2|root translation f2|bone 1 f2|new_bone  f1|bone 2f2|root rotation f3|root translation f3|bone 1 f3|new_bone  f3|bone 2f3|
2bones; 3framesxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz

That would be for the first version of the tool enough.

The next needed feature would be to patch a new animation file with the original. Why? Because sometimes I can't achieve the quality of the original animation with Kimera's interpolation function, however if I could restore the bone's rotation I could use Kimera to animate the new bones with it. I think it will work similar as before, but this time the new skeleton will get also an animation attached to it (I guess it's enough if the program checks if the file names are the same) and the program will only write coords from matching bones of the original animation. The root rotation and translation should be left untouched.

If someone could create such tool for me (plea~ze :wink:), it might be possible that we also can exceed the limit of 29 bones (I haven't found a model with more) and I could make one skeleton which is compatible with all human models. It also would mean that a few more things could be animated with new additional bones (feet hands and hair springs in my mind).

Thanks for reading.

obesebear

  • Administrator
  • No life
  • *
  • Posts: 3219
  • Karma: 109
    • View Profile
Re: Need help with new Sephiroth skeleton animations
« Reply #1 on: 2017-04-23 22:39:36 »
The best way to do any of this would be to have an import/export tool which can convert the skeleton/animation to a more user friendly format and back again.

Kaldarasha

  • No life
  • *
  • Posts: 2119
  • Karma: 126
  • Prince of Model Editing
    • View Profile
Re: Need help with new Sephiroth skeleton animations
« Reply #2 on: 2017-04-24 08:24:31 »
It would be even easier with an import export script for Blender (sadly the one I found here in the tools section doesn't work). Would be nice to have something like that, but it would mean too much work.