www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Modding

Reply
 
Thread Tools
Old 18-05-19, 17:32   #1031
VictorXD
Relic Hunter
 
VictorXD's Avatar
 
Join Date: Jan 2009
Location: pillow
Posts: 8,970
Default

You need to copy your .exe from the bin folder to the main AOD folder and use that one. I have no idea where that desktop thing came from Where the TPF is placed shouldn't matter as long as you have TexMod using the .exe in the main folder.
__________________
Persecution to all non Luds Gate believers may God's wrath fall upon you sinners
VictorXD is offline   Reply With Quote
Old 18-05-19, 17:37   #1032
Czarpos
Hobbyist
 
Czarpos's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 39
Default

So I decided to work on that script that separates root motion and puts it into a new root bone. I managed to almost finish it if not for one problem. XYZ Location values over keyframes are calculated properly and seem to work fine. The problem is with WXYZ Quaternion Rotations. Do you perhaps know if these rotations have to be treated in some unique way, Nakamichi?

The whole formula is just values over keyframes with [new root bone = (exported animation's hip bone with root motion) - (exported animation's hip bone with no root motion). That works for location values but rotations get messed up.

Some preview of my script's results:
VAULT_A
LAST_CHANCE_GRAB
The more-in-the-middle anim is exported one with root motion and the other anim is work of my script.

If you or someone else knows what is the issue here, please let me know because I have no idea how to fix it.

Last edited by Czarpos; 18-05-19 at 17:38.
Czarpos is offline   Reply With Quote
Old 18-05-19, 20:31   #1033
Czarpos
Hobbyist
 
Czarpos's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 39
Default

After some more tests, I think there is just some animation data missing in hip bone for animations exported without root motion. Checking and calculating values manually it all zeroes out so it should be all correct... but it's not.

Only some anims using rotation on root motion have that issue though but that is something I just can't fix on my own. I can't fix exporter's source code either, it's way too advanced for me (also I don't understand italian lul).
It seems everything's in your hands, Nakamichi. I have tried.
Czarpos is offline   Reply With Quote
Old 19-05-19, 09:12   #1034
nakamichi680
Explorer
 
nakamichi680's Avatar
 
Join Date: Feb 2015
Location: Italy
Posts: 818
Default

TRAODAE exports rotations as Euler angles. There's no need to mess with quaternions. I'll try to explain how CAL files stores animations and how TRAODAE handles them. If you find an algorithm to separate root motion from hip bone I'll be happy to implement it inside the anim exporter.


ROOT MOTION
  • Can contain XYZ translations and Z rotation (all possible combinations)
  • Each keyframe value is an increment or decrement over the previous ones (example with 5 keyframes: 1-3-2-0-5 should be read as 1-4-6-6-11)
  • Z rotation is stored as Euler angles


HIP BONE (same applies to all bones of the skeleton)
  • Can contain XYZ translations, XYZ rotations and XYZ scalings (all possible combinations)
  • Each keyframe value is absolute
  • Rotations are stored as XYZW quaternions
  • Scalings are not inherited from parent bone


How TRAOD extracts them to FBX:
  1. Reads root motion animation data
  2. Reads skeleton animation data
  3. Converts skeleton rotations from quaternions to Euler
  4. Converts root motion Z rotation from relative to absolute values. Each new value is the sum of itself with the previous ones (see example above)
  5. Applies root motion Z rotation to X and Y translations of root motion (at this point X and Y translation are still increments/decrements)
  6. Applies root motion Z rotation to X and Y translations of HIP bone (absolute values here)
  7. Root motion XYZ translations are converted from relative to absolute values like what happened before with Z rotation
  8. Root motion transforms are applied to HIP bone (a simple addition of values)


My suggestion: invent some values (a small animation of 3-4 frames should be enough) for root motion and HIP bone translations and rotations with the specifications abovementioned (you can avoid using quaternions) then apply the same animation exporter procedure to obtain a set of transforms for a single bone. Create it inside your favourite 3D animation program. Then find a new algorithm to obtain the same visual result with two bones but with the same input data.
nakamichi680 is online now   Reply With Quote
Old 19-05-19, 11:31   #1035
Czarpos
Hobbyist
 
Czarpos's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 39
Default

Good Lord that's a lot of useful information, thank you so much!
It seems like for now I got only the "simple" part done in reverse which is substraction of values heh.

Also there is one thing I don't understand. Why is Z rotation of root bone applied to XY locations of root and hip and do you mean replacing or adding? Doesn't seem to make sense to apply rotation to translation.
Czarpos is offline   Reply With Quote
Old 19-05-19, 12:20   #1036
nakamichi680
Explorer
 
nakamichi680's Avatar
 
Join Date: Feb 2015
Location: Italy
Posts: 818
Default

When you rotate an object around z-axis the xy plane rotates. This means that x and y translations need to be adjusted to the new coordinate system.
Use mathRot and mathRotZ functions provided with TRAODAE source code to test rotations.
nakamichi680 is online now   Reply With Quote
Old 19-05-19, 14:35   #1037
Czarpos
Hobbyist
 
Czarpos's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 39
Default

Oh I see, that would make sense.
However I don't think I exactly understand... I guess that all I have to do here is reverse the process of how your exporter extracts these to fbx, which would give me the root motion data I need. If that's the case, then why do you need to find an algorithm looking for that data? It seems like you already have motion data separated, you just add it up to the hip bone, which I'm simply trying to reverse. Can't you just put that root motion into new bone? Or there is more to it and I just don't get it.
Czarpos is offline   Reply With Quote
Old 19-05-19, 14:46   #1038
nakamichi680
Explorer
 
nakamichi680's Avatar
 
Join Date: Feb 2015
Location: Italy
Posts: 818
Default

Quote:
Originally Posted by Czarpos View Post
It seems like you already have motion data separated, you just add it up to the hip bone...
No read again all the steps and do some tests.


Quote:
Originally Posted by Czarpos View Post
Can't you just put that root motion into new bone?
If it were that easy, don't you think I would have done it by now?
nakamichi680 is online now   Reply With Quote
Old 19-05-19, 14:54   #1039
Czarpos
Hobbyist
 
Czarpos's Avatar
 
Join Date: May 2016
Location: Poland
Posts: 39
Default

Quote:
Originally Posted by nakamichi680 View Post
If it were that easy, don't you think I would have done it by now?
True. Seems I'll need to do some tests first, though it looks like the problem is relative/absolute transforms somehow.

Edit: Also I think I will have another problem. You say I don't have to use quaternions but that doesn't seem to be an option. For some reason Blender force-converts rotations for bone animations into quaternions anyway. I would have to convert these back into euler first but I'm not sure if there isn't going to be any data loss. Do you know perhaps what can I do about that?

Last edited by Czarpos; 19-05-19 at 15:08.
Czarpos is offline   Reply With Quote
Old 19-05-19, 15:15   #1040
nakamichi680
Explorer
 
nakamichi680's Avatar
 
Join Date: Feb 2015
Location: Italy
Posts: 818
Default

Quote:
Originally Posted by Czarpos View Post
True. Seems I'll need to do some tests first, though it looks like the problem is relative/absolute transforms somehow.

Edit: Also I think I will have another problem. You say I don't have to use quaternions but that doesn't seem to be an option. For some reason Blender force-converts rotations for bone animations into quaternions anyway. I would have to convert these back into euler first but I'm not sure if there isn't going to be any data loss. Do you know perhaps what can I do about that?
I'm not familiar with Blender
nakamichi680 is online now   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.