Open ammaraskar opened 10 months ago
Animations for sims work too, but without the IK they look a little whacky. Notice how straight the arms are here:
As of https://github.com/LazyDuchess/OpenTS2/commit/becb9815e3e52dc355c502c4b8e8eef0c5edf431 we now have good foot IK. The boxes are supposed to be the goal-IK positions from the animation
and
The arm IK still needs work, it seems to be a little more complicated. They appear to use a 1 float channel, this is the IkWeight
portion of the IKTarget that controls how much weight the IK has.
Arm IK seems to be working now! Turns out l_handcontrol0
and r_handcontrol0
were parented to the root_trans
of the skeleton in the scenegraph despite being animated in absolute positions...
We still have to handle IkWeight
to handle arms properly in some animations.
Getting close now, I added a little animation viewer to the SimsAnimationTest
scene. A lot of stuff plays properly but the head look-at IK and spine position still need work.
even with the wonky rotations this is still insanely impressive. can definitely see some of that wonkiness in the arms and legs there but overall it's really coming together
The next issue seems to be related to the headingOffset
parameter. Some animations like a2o-exerciseMachine-benchPress-start_anim
have really weird looking data.
For reference this is the original animation in game:
InGameBenchPressWithAnimationDebug.webm
This is what it looks like in unity if we just use the raw data:
The way to make it look kinda normal is to set the root_rot
's z
rotation values zero and add 89.95
to the x rotation values. The heading offset for the clip is -1.570
radians, which is -89.95 degrees.
UnityBenchPressKindaWorking.webm
Welp that was a stupid bug. Turns out the order of rotations when converting from euler rotations in sims2 is different from unity. Now a lot more animations play properly with https://github.com/LazyDuchess/OpenTS2/commit/380b83ad7ff69ef8c3b69661c7db1868d79a1d30
Just documenting this here but LazyDuchess pointed out that face blends seem to also be working, they're just hard to see without any texture:
https://github.com/LazyDuchess/OpenTS2/assets/773529/0c340122-88b6-400f-b385-10e7df9bb8dc
Next up is head look-at IK and then all this code should be moved to an animation controller so different animations can be blended but this is basically done.
We have basic animations from the game now!
ReclinerFixed.webm
These currently only work on bones and morphs (also I'm using the bone names instead of the bone CRC32) but this will not work for things like the Sims animations, those use a chain of inverse kinematics and basically only encode hand movements and such. This also applies to some more complicated objects like the cowplant with it's 17 neck bones.