- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Modding Discussion >
- Research & Development >
- Animation & ANIM Files >
- Sims 2 Animations exported with baked inverse kinematics
- Site Map >
- Modding and Creation >
- Sims 2 Creation >
- Modding Discussion >
- Research & Development >
- Animation & ANIM Files >
- Sims 2 Animations exported with baked inverse kinematics
Replies: 11 (Who?), Viewed: 1033 times.
#1
16th May 2024 at 11:10 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 12
Thanks: 211 in 10 Posts
![Default](/images/icons/icon1.gif)
In most games these inverse kinematics get "baked" into the animation files so the movement of each individual bone and limb is recorded. But unlike most games, Sims 2 uses these inverse kinematics in the final animations shipped with the game and the game engine runs the inverse kinematics as you play.
With that background out of the way, I was looking at reverse-engineering the animation format for OpenTS2 and figured out how these inverse-kinematics are set up. I haven't documented my findings but you can find some more information on the cAnimResourceConst scenegraph blocks here. With the inverse-kinematics part of the animations decoded, we are now able to play some animations from the game successfully! (Note that some animations where the hands should be pinned to objects etc still don't work well)
Since this is all done in Unity, we can actually export these animations to a format that can be imported into blender. There isn't currently a way to directly export from blender back to a sims 2 animation file without milkshape (I might make a plugin for that if I'm feeling bored). But you try to customize these animations or try to port them to future games. I have exported 10 base game animations to a .glb file available here: https://blog.ammaraskar.com/assets/...es/bakedSim.glb
If you're just curious, there is also an online model viewer available here where you can view them straight from your web browser.
What's cool is this web editor can also display other game assets, such as the reclining chair here.
Unfortunately the process to export animations fully-baked yourself will be a bit involved and need some know-how on Unity but hopefully some of you can get through it and help others out.
1. Grab and setup the OpenTS2 bake_ik_animations branch code from here https://github.com/LazyDuchess/Open...ile#development
2. Open the SimAnimationTest scene and type in the name of the animation you want
3. Right click the bakedSim and select UnityGTLF and then Export Selected as GLB
Thank you to @AlexCroft for bringing this up on the OpenTS2 repo here! https://github.com/LazyDuchess/OpenTS2/issues/59
2 users say thanks for this.
(Who?)
Thanks
Advertisement
#2
17th May 2024 at 10:11 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 73
Thanks: 2723 in 25 Posts
Thanks to @anmar2 's work we can now finally export ts2 animations to blender (using unity) ! I'm trying now to retarget the animation to a sims 4 rig in order to export animations in the sims 4 (like the car get in animation). But it's a difficult process. Maybe @omglo can help us in this project reversing the current 4to2 animation retargeting (https://modthesims.info/showthread.php?t=637212.
#3
18th May 2024 at 12:48 AM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 3,045
Thanks: 906 in 4 Posts
This is really great, guys.
I'd be willing to look into making a 2to4 rig when I have time.
I'd be willing to look into making a 2to4 rig when I have time.
Test Subject
#4
19th May 2024 at 10:09 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 2
woah this is incredible!! hopefully this is a big step forward to make a proper way to create animations for TS2 in Blender ♥ (wich I have been looking for years lol :_____) )
#5
21st May 2024 at 1:13 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 3,045
Thanks: 906 in 4 Posts
@alexcroft - do you have a Sims 2 rig with the IK bones to work with, or are you usuing the old GMDC without those included?
#6
21st May 2024 at 1:59 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 73
Thanks: 2723 in 25 Posts
The unity anmar2 script bakes the ik chain directly on the rig.
So the animation keys in the resulting exported rig are not on the ik bones.
Although you can export also the whole rig animation with the animation of the ik chain, you have to simply export the fbx using the unbaked animation.
I’ve tryed to reconnect the IK bones chain to the corresponding rig bones in blender, but it was difficult to me, so I prefer to use the ik baked version.
So the animation keys in the resulting exported rig are not on the ik bones.
Although you can export also the whole rig animation with the animation of the ik chain, you have to simply export the fbx using the unbaked animation.
I’ve tryed to reconnect the IK bones chain to the corresponding rig bones in blender, but it was difficult to me, so I prefer to use the ik baked version.
#7
25th May 2024 at 3:23 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 3,045
Thanks: 906 in 4 Posts
So, does anyone know what I'm doing wrong here? I filled out the config.json like this below and left it in the OpenTS2-bake_ik_animations folder. I installed the correct unity and VS.
"C:/Program Files/The Sims 2 Ultimate Collection",
"user_dir" : "C:/Users/myname/Documents/EA Games/The Sims™ 2 Ultimate Collection",
"C:/Program Files/The Sims 2 Ultimate Collection",
"user_dir" : "C:/Users/myname/Documents/EA Games/The Sims™ 2 Ultimate Collection",
#8
25th May 2024 at 10:30 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 73
Thanks: 2723 in 25 Posts
#9
25th May 2024 at 11:54 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 3,045
Thanks: 906 in 4 Posts
Thanks, such a simple thing I missed. But I must've still done something wrong, because playing it says "object reference not set to an instance of an object" when I press play, and I don't get the baked Sim etc in the hierarchy like ammar2 has in their screenshot.
#10
26th May 2024 at 12:08 AM
Last edited by ammar2 : 26th May 2024 at 12:24 AM.
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 12
Thanks: 211 in 10 Posts
Make sure that in your config.json, the "dlc" array has the first element (the base game folder) set correctly. For example mine looks like this:
Code:
{ "game_dir" : "C:/Program Files (x86)/EA Games/The Sims 2 Ultimate Collection", "user_dir" : "C:/Users/Ammar/Documents/EA Games/The Sims 2", "dlc" : [ "The Sims 2", ... ] }
#11
28th May 2024 at 3:15 PM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 3,045
Thanks: 906 in 4 Posts
Thanks, I have it working and have been trying it out over the last couple days. Now I just have to see how these look after being filtered through milkshape.
Test Subject
#12
6th Jun 2024 at 7:05 AM
![Old](/static/images/buttons/buttons-rro/images/statusicon/post_old.gif)
Posts: 1
Thanks for helping me out, I am also trying to export animations from sims 2 and I was confused before but you made my day.
Who Posted
|