-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export FBX animation #59
Comments
Aah it's unfortunate that Unity's FBX export doesn't bake in the inverse kinematics. If there isn't a way to do that with the built-in exporter then you may have to write your own exporter that goes frame-by-frame and dumps the IK-updated position of bones. @LazyDuchess has an example of an |
Unfortunately, I don’t know the programming language in C#. Could you help me write the script? |
Hey @alexcroft93, sorry for the late response but I pushed some code to the branch This adds a "baked" version of each animation as it plays which should hopefully survive the export process. Could you give this a try and see if it works? |
That's awesome! Would you mind saving one of those animations out as a As for loading animations from the DLCs, after this line: OpenTS2/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs Lines 31 to 34 in be73b02
go ahead and add the line contentProvider.AddPackages(
Filesystem.GetPackagesInDirectory(Filesystem.GetDataPathForProduct(ProductFlags.Business) +
"/Res/Sims3D")); You can find the other |
Sure. To export the animation I select only the one baked animation deleting all others animation array elements in the animation section of the inspector under the amFace_cres object. |
I pushed some code that optimizes the keyframes used in the animations to make it take up less space. I also made a separate baked object to just contain the animations at the Using the https://github.com/KhronosGroup/UnityGLTF extension, I was able to manage to export the sim and animations into a You can switch between the animations by filtering to |
It works!! Thanks to your work, there is finally a way to export animations from The Sims 2 (using unity). |
Hi @ammaraskar , I picked up the project again after quite some time. I was trying to load the "a2o-tent-getIn_anim" animation from bonvoyage in the simanimationtestscript. I used the version of OpenTS2 (https://github.com/LazyDuchess/OpenTS2/tree/d0ca1fe69f17387cc7900ab49fe5cda10b3ce816) and modified the file "OpenTS2/Assets/Scripts/OpenTS2/Engine/Tests/SimAnimationTest.cs" by adding this code:
However, the script is unable to correctly retrieve the animation, it simply doesn't find it. |
Heyo, try doing: contentProvider.AddPackages(Filesystem.GetPackagesInDirectory("C:/Path/To/Bon/Voyage/Res/Sims3D")); I think the product flags have to be configured correctly in |
Thanks it works now |
Hi Anmar, can I ask you what is the process to load objects with animations instead of sims? thanks |
You can try using the You'll need to change this line:
to be the object you want to load and then this line: OpenTS2/Assets/Scripts/OpenTS2/Engine/Tests/ScenegraphGMDCTest.cs Lines 59 to 60 in d0ca1fe
to be the animation you want. I think (most) objects don't use inverse kinematics, except things like the cow plant so that should work. I think I exported the recling chair asset to view on the web here a while ago. |
For the o2a-vehicleOWN-superSportsCar-getIn_anim of the vehiclesupersportscarnew_cres it doesn't load the l_door_rot bone animations. Maybe something missing in the script? EDIT: I also tried loading the "o-vehicleOWN-SuperSportsCar-driveway-DriveThruFromPark_anim" animation for the "vehiclesupersportscarnew_cres" object, but the rotation animation of the car doesn't load. I don’t understand in which part of the scripts the bone animations are being referenced. |
Hello, your re-implementation of the sims 2 in unity is really impressive.
I'm currently looking for a way to transfer animations from The Sims 2 to Blender.
I've downloaded the OpenTS2 Unity project and loaded everything correctly with @ammaraskar unity simanimationtestscript. I'm able to play the animations and view their keyframes. Now, I tried exporting the mesh, rig, and animation to Blender using a Unity FBX export, but it seems not to work correctly. Maybe for the IK CHAIN. Is there a way to bake the ik chain directly in unity of the simanimationtestscript to the rig bones, so when i import the fbx in blender it reads only the bones keyframes and not also the ikchain (ik bones).
thanks
The text was updated successfully, but these errors were encountered: