- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Tutorials >
- Modding - General - Turning game animations into AVI files
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Tutorials >
- Modding - General - Turning game animations into AVI files
Posts: 2,832
Thanks: 6613 in 20 Posts
So you need:
S3PE: Get it here.
Chaos' Animation Painting from here.
The AnimTool from here. (You need V0.04 if you already have this).
MilkShape (commercial product) from here.
The files I have attached to this post.
Note that SMD animations will play on fragmotion, but I could not make this demo work with the skin on it. It 'sploded.
Firt, we want to decide on something to do. I used Chaos' painting to play animations until I settled on the one called "Hips Shake".
Download and install any of the programs you need.
Then make a working directory somewhere so you can find everything.
Next, start S3PE and open FullBuild0.package.
Choose "Display: Names" and Sort (at the bottom of the page).
Click on the name column to sort by name... this may take a little while.
Scroll down to the names that start with "a_" (these are adult animations).
Select "a_dance_med_posAHipsShake_x".
Right click on it, choose export and to file.
Save this to your working directory.
Make sure you place a copy of the "rigfile.txt" I attached in your working directory, as well as the afBody4Anim.ms3d and the DDS files.
Start up the AnimTool and click on the "Clip -> SMD" button.
From the dialog box, choose the "S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.animation" that was saved from S3PE.
The AnimTool will make a file "S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.smd" from it.
Close the AnimTool, and start MilkShape.
Load the afbody4anim.ms3d file.
Then, choose "File, Import, Half-Life SMD" and choose the file AnimTool made.
The first dialog box will present some options about loading skeleton, triangles and so on, it matters not what you choose. But be sure and choose "No" to appending the animation, as this will cause a blank animation to appear before the one we are loading.
At this point, we are ready to see it. Click on the 3D window, and then press the space bar, which will set a single view.
Then click on the ANIM button and then on the ">" (play) button just to the left of it.
Here is what you should see (your colors may vary):
To make your own AVI, stop the animation, then right-click on the window, choose "record AVI" from the menu, specify a filename and a codec, and you'll have one.
It the AVI is all white, it is a graphics card issue, and it can be corrected by downloading and installing the "mesa dlls" from the MilkShape site.
There are lots of alternative ways of doing all of this, including using fraps to record with. You can use Animation Shop (free) to edit the frames of the AVI with, turning it into an animated GIF. You can use external video editing software to remove the background and pose the animation over a different background.
So in the attachment I have included a MilkShape file of a whole-body sim, with textures, the game .animation file, a converted .smd file, and the rigfile.txt that I used to make the mesh and the animation. Matching both is the critical element in successfully making this work.
I will post more on the making of the afbody4anim file later, but right now it is ready for use.
AnimDemoStuff.rar (2.10 MB, 313 downloads) - View custom content | ||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- S3_00B2D882_00000000_40E5744B0DBFC320__IMG.dds 699180 126447 18% 03-06-09 14:00 .....A. F3FA485D m3f 2.9 S3_00B2D882_00000000_40E5744B0DBFC321__IMG.dds 1398256 389766 27% 03-06-09 14:00 .....A. E3103ECE m3f 2.9 S3_00B2D882_00000000_40E5744B0DBFC323__IMG.dds 699192 246623 35% 03-06-09 14:00 .....A. A4F21307 m3f 2.9 S3_00B2D882_00000000_2749B03CDE390324__IMG.dds 1398256 76377 5% 03-06-09 14:01 .....A. F0E19DF0 m3f 2.9 S3_00B2D882_00000000_B4CDC208D8D51BF0__IMG.dds 699192 364371 52% 03-06-09 14:00 .....A. E3B8CC7C m3f 2.9 S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.animation 54380 17870 32% 07-11-09 11:12 .....A. A86D765E m3f 2.9 S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.smd 153413 27175 17% 07-11-09 11:16 .....A. FC06693B m3f 2.9 afbody4anim.ms3d 885129 283995 32% 07-11-09 00:18 .....A. 5FEBD7B3 m3f 2.9 hipsshake.gif 221197 216280 97% 07-11-09 11:27 .....A. D00AB05D m3f 2.9 rigfile.txt 10780 1911 17% 06-11-09 23:26 .....A. 5A2A4A24 m3f 2.9 S3_00B2D882_00000000_4F70A1DAF7E9CA29__IMG.dds 699192 387303 55% 03-06-09 14:00 .....A. 99A3F488 m3f 2.9 S3_00B2D882_00000000_22D9CBFED061B771__IMG.dds 1398256 61822 4% 03-06-09 13:59 .....A. 4CC50D09 m3f 2.9 ------------------------------------------------------------------------------- 12 8316423 2199940 26% |
If you like to say what you think, be sure you know which to do first.
Thanks
My girl is a monster!!
I tryed several times, because uhh I'm a beginner but no ......
Your animation.smd included with the AnimDemoStuff did work correct.
Edit: Using the corerigfile that was included with the AnimTool, gave a good animation too.
export.zip (53.6 KB, 56 downloads) - View custom content | ||
0 11-07-09 20:22 export/ 54380 11-07-09 19:56 export/S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.animation 153420 11-07-09 20:18 export/S3_6B20C4F3_00000000_63C18DB33B9FAAF0_a_dance_med_posAHipsShake_x%%+CLIP.smd -------- ------- 207800 3 files |
Posts: 2,832
Thanks: 6613 in 20 Posts
There is a new version of the AnimTool (V0.04) that I should have uploaded before I posted this. It corrects that issue, which happens because the old tool did not transfer values from the rigfile when any joint was not in the .animation file. While that works for making animations, it does not display well, as you discovered.
In general, some of the face bones, the breasts, and the Bicep and calf compress bones are generally not found in game animations, their positions are not changed by the animation, but by game logic for such items as fatness or fitness... or by such things as Delphy's Boobs Slider.
In the new AnimTool package is a special MilkShape plugin that you need to make the properly animatable base meshes from a rigfile. However, the only rigfile I have properly made is the adult female one. The rest will have to wait until I get them done or someone else wants to learn how to do it.
Sorry for the confusion. During the development process I had much worse looking gals appear at times.
If you like to say what you think, be sure you know which to do first.
Did you combined body, face and hair meshes to make the Milkshape body?
Only a_ animation Clips work? , how can you use the a2o etc in Milkshape?
I will have to read a lot more about animations, but this is fun!
Posts: 2,832
Thanks: 6613 in 20 Posts
A least some of the a2o_ animations will work. Many have joints in them for objects, too, and without modifying the rigging they may not be exportable in a manner that allows them to work in the game... and that is another subject for qanother lesson.
I *believe* the tool will work for child and toddler, and also object animations, but those will require new, additional rigging files to be made. Most of the data can be derived from the .grannyrig files, but it is some detailed work.
I am planning on working my way through the child and toddler rigfiles. All objects are pretty unique for rigging, although many are very similar, such as one door or another. But door animations are all pretty much the same, one rotation arc serves as opening the door, playing the clip backwards serves to close it. All of the cars have wheel rotations and that is about it (they were more complex in TS2).
Anyway, I have a lot of work to try to get "lesson plans" for all of this, but I have made the process of extracting, modifying and replacing animations work here. There will likely bee some more polishing to do, but I want to get the tools and the skills out there for more users to try.
And yes, I think it is fun, too, which is why I work on this kind of stuff.
If you like to say what you think, be sure you know which to do first.
Posts: 133
Thanks: 3570 in 220 Posts
The biggest problem right now is extracting the rigging data for the sims and objects. If one doesn't have the money to afford Autodesk 3DS Max, all they can really do is manually copy the data from the GrannyViewer and write it into a more manageable format.
I've had brief glances into the provided source code for the GrannyRig import/export plug-ins for 3DS Max, but it can be a bit hard to understand, especially since its another one of those sources that has a ton of pre-compile macros and names with many, many underscores at the beginning, and other rarely used c syntax that I'm not familiar with.
The hardest part of converting those plug-ins to something compatible with Milkshape would be writing the code for re-exporting the rig to a grannyrig file, which isn't possible with the current 3DS plug-ins.
It's hard because one would have to basically study the code for importing the data from grannyrig files and use that to surmise the compression format for the data in a grannyrig file, and then use that format to write an exporter algorithm from scratch.
Unless, of course, there's a specification for the grannyrig compression format cleverly hidden somewhere on the internet that I don't know about.
Posts: 2,932
Thanks: 15576 in 28 Posts
Sorry for a post that isn't helping with immediate issues but jeesh...this is so adorable I couldn't help it.
Wes, don't you dare calling yourself silly. It makes people like me feel like we shouldn't even be allowed out in public.
OM
Posts: 133
Thanks: 3570 in 220 Posts
Probably premature...but there will be a way to get animations connected to something other than a painting right? Sorry for a post that isn't helping with immediate issues but jeesh...this is so adorable I couldn't help it. Wes, don't you dare calling yourself silly. It makes people like me feel like we shouldn't even be allowed out in public. OM |
Animations can be connected to anything, but it takes more than just the clip files.
The act of playing animations, attaching accessories, playing sounds, creating effect swarms, etc, is a combination of the clip files themselves, and jazz state machines, and the MSIL game code.
It's not nearly as simple as TS2, but that just means that it's a lot more versatile.
The code that I used in my painting for the animations came from copied and edited animation interactions hidden within the game code. These interactions were among the many useful "cheat interactions" in the game found on certain objects, but nearly impossible to access without core modding.
I just copied their code, tweaked it to work with my painting, and then released it to the public.
These interactions were very versatile because they used a simple jazz state machine that could play any animation by just giving it the name of the clip file and the actor to play the animations.
The game already has several other generalized state machines for playing animations, but using them involves a delicate dance between the game code and state machine. I'm still having trouble getting my code to use the jazz file for reactions, in order to get sims to cry on demand, something many have been wanting.
My point is that at the moment we can't exactly create a new animation and slap it into the game, because we also need to create a new jazz file to control that animation and write game code to enter, set the parameters, and exit that jazz file's state machine.
Posts: 2,932
Thanks: 15576 in 28 Posts
I just make meshes and don't really know anything about animations so I was just asking if the code you applied to the painting could be applied to other kinds of objects.
I understand that the whole thing is still in early stages...I was just curious about future possibilities.
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
all they can really do is manually copy the data from the GrannyViewer and write it into a more manageable format. |
The heirarchy is the only part of the rig ingfile that isn't replicated elsewhere than the grannyrig. Except for moving joints in new object designs, having the grannyrig files as unworkable blobs is not that bad.
The global (final) joint positions and rotations for the geoms are in the .skcon files. I worked on extracting them and converting them back to parent relative position/rotation values, but I had trouble with the conversion to euler breaking on the clavicles and thighs. Gimbal lock, people call it. On euler rotations, a 180 degree X and Y are the same as a 180 Z rotation, but then you lose any rotations on the Z axis. The game uses quaternions, that do not have the rotation order issues, but MilkShape, well the SMD format, too, depend on euler rotations.
So I ended up hand polishing the rigging for the adult animations. I think it is pretty well done, and should work for all adult animations, because they all share the same rig in the game, so they should all be compatible with a single rigging setup. I have released the au data in the rigfile, and the format is very simple, you ought to be able to understand it merely by looking at the data.
I plan to work on the cu and pu rigs soon, when they are done I will give them out. While all the object rigging files will require some work, the good part is that, aside from the beds, most objects have no more than about a half-dozen joints. And most of the joints are merely markers for action targets.
I am by nature somewhat of a plodder, I have a work plan and I am working it through step-by-step. You remember how long it has been since you first made your animation painting... I set the work aside for a while, but I didn't quit, just deferred it.
There is plenty of room for more work and more worker bees. The AnimTool only alters the clip frames and names part of animations... all of the events stuff is copied over from the original unaltered except for a few offset pointers. With the proper rigging file you should be able to make animations that play, so controlling them with Smooth Jazz is very feasable.
I have seen you mention before about an EA preview you saw somewhere with a graph. Maya has graphing of several types in their animation system. But the existing SMD plugins for Maya are virtually impossible to work with. After I get the MilkShape stuff settled I may take that on as a project. I like animating in Maya, but so far the pipeline is unworkable... I thought MilkShape would have an updated FBX plugin that would help, but it still isn't released.
The CLIP spec on the wiki that Tiger did so much work on is pretty accurate. I tweaked it a little, and it is essentially an accurate roadmap of the file format.
If you like to say what you think, be sure you know which to do first.
Posts: 133
Thanks: 3570 in 220 Posts
I'm hoping my question didn't offend you. I just make meshes and don't really know anything about animations so I was just asking if the code you applied to the painting could be applied to other kinds of objects. I understand that the whole thing is still in early stages...I was just curious about future possibilities. OM |
Your question didn't offend me. And I'm assuming what you mean is attaching the interactions of my painting to other objects. That is very much possible and has been for a while. You might try looking up Kolipoki's tutorial on adding interactions to objects.
Regarding the overall possibilities of animations, there is still a lot of mysterious data to decipher. For instance, judging by the wiki, there is little data known about TKMK files, which seem to be referenced just as much as CLIP files by JAZZ files.
Also, Wes, in regards to editing granny rigs, its not so much the fact that they have little unique data that worries me, but the fact that they're referenced by so many other files that already have the data for the joint positions.
I fear that they may act as a redundant check-point for the game when it comes to animations, slots, and other data. This was always a worry of mine, and the reports of custom cars' wheels screwing up in the game when you edited the mesh but not the rig reinforced that fear.
College has not allowed me time to test this, but I fear that the game may also throw a fit if the number and positions of slots do not match that of the corresponding joints in the granny rig file.
This is important to me, as I want to add additional routing slots to a multi-tile painting and assign different interactions to each through object components so the pie menus aren't as crowded.
Posts: 2,832
Thanks: 6613 in 20 Posts
in regards to editing granny rigs, its not so much the fact that they have little unique data that worries me, but the fact that they're referenced by so many other files that already have the data for the joint positions. |
I think the .grannyrigs are the source data. I also think they are fully readable using the granny.dll, except for the three GEOM rigs (auRig, cuRig and puRig), they have additional data on the head and tail of a .gr2 file to be stripped first.
However, in my opinion, and that of some others, using the granny.dll file for unlicensed purposes may not be entirely legal... certainly redistributing the granny.dll file would not be. So I am not interested in leveraging that file for anything I am planning on releasing to others.
Besides, figuring out how to do it is half the fun.
If you like to say what you think, be sure you know which to do first.
Posts: 3,878
Thanks: 21111 in 16 Posts
Posts: 1,068
Thanks: 13448 in 34 Posts
Wes, if I'm correct, you intended for additional animations to replace pre-existing one? Therefore, changing the name of .clip file after a conversion is not a good idea? I was under the impression I only needed to keep it's filename to attach a rig file to the .smd during conversion, but I suppose that is not the case?
Posts: 2,832
Thanks: 6613 in 20 Posts
Besides the "frames" part of the animation file, which is what we can replace, there is the names, which you can also change, and a script section for effects that we have no editor for (if someone else doesn't beat me to it, I will make something to edit that with).
I am not sure of all the steps creating a "new" animation, but you would have to start with another one and replace the animation frames using the AnimTool. Tiger left some documentation on the wiki about the way the names and hash values are used... the child anims have the same instance as the adult version, except the lowest order byte of the instance (which isn't the last byte because of little endian ordering) has the "c" x-or'd into it. At least I think that is what he meant.
If you're working on pose boxes or such, I think you need a Jazz script with your new names in it, and then the new animations, where the names and instances are properly matched. As I understood the process, the sim/object uses these Jazz scripts, and the Jazz script is what calls the actual animation to be played. But I didn't do any of that myself, I just used the ChaosMageX painting to trigger the animation.
As far as the name of the .clip files, that is something that should match the hash of the name of the animation. The SMD->Clip conversion uses the rigfile.txt that I provided (or any you substitute) to create the clip file from, so it doesn't care what you name the files, other than the fact that it makes the output name by stripping the extension and slapping ".clip" on the filename.
If you like to say what you think, be sure you know which to do first.
Posts: 591
Thanks: 2585 in 9 Posts
I worked on extracting them and converting them back to parent relative position/rotation values, but I had trouble with the conversion to euler breaking on the clavicles and thighs. Gimbal lock, people call it. On euler rotations, a 180 degree X and Y are the same as a 180 Z rotation, but then you lose any rotations on the Z axis. The game uses quaternions, that do not have the rotation order issues, but MilkShape, well the SMD format, too, depend on euler rotations. |
Man where's the asprin when you need it!
Posts: 2,932
Thanks: 15576 in 28 Posts
I'm still just trying to sort out what this tutorial creates and how it relates to the other animation post. The whole thing is rather impenetrable to my brain and base of knowledge. With meshing it's like there are baby steps you can take but with this it's more like you just have to know all about it to have the slightest clue. And, of course, without a clue, most people aren't going to wade in and ask for fear of appearing to be an idiot.
Direction to something approximating baby steps might help. I suggest this because I think the game could benefit from having stuff that is animated but as it stands the level of discussion is probably pretty much over the heads of most people who might like to try making something like that. Where should one go to get a glimmer of a start?
I apologize if the whole method isn't at a stage where some less technical direction is possible and I am suggesting something not feasible right now. But this has been sitting out there awhile now and I, for one, would like to see someone trying it out in the game or at least making a valiant attempt.
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
Mostly, you can edit an animation. Not all of them import smoothly, some require special rigging because they depend on extra joints and objects, like getting in a car or on a barstool.
A lot of the animation work done for TS2 was poses... which are simple, one-frame animations where the arms and legs and such (including the face in TS3) are set into position.
There is a good tutorial on animation that comes in the help files for MilkShape itself (you may have to download those). If you start with that, you are most of the way there, because if you start with the rigged body I uploaded, you export your animation in SMD format (use the sequence option). Then you convert it with the AnimTool, which looks amazingly like the ObjTool, some grand cosmic coincidence, no doubt.
The math underlying the animations is difficult, yes, but the calculations to generate tangent (bumpmap) normals is difficult, too, but the artists never have to deal with the math. With animation, mostly you just need to replicate the joint actions a real body would use for a comparable action... elbow bends, waist bends, and so on. An animation sequence is just a set of poses strung one after the other... the software helps you because you need only set the start and end positions for a movement and the intermediate steps with be calculated for you (interpolation).
Of course, like meshing, how good it looks depends on good craftmanship, but the basics are simple enough.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15576 in 28 Posts
Initially got stuck until I remembered Cocomama told me how to open FullBuild0.package". I just used s3pe, opened and browsed to Program Files/Electronic Arts/The Sims 3/Gamedata/Shared/Packages to find that.
Got stuck again at the load ms3d thing until I tried opening instead of importing.
So far this tutorial is pretty easy as Sims 3 things go.
OM
Post completely edited to remove dithering...lol.
And once again because I can't find the Anim button or the > to the left of it. And my girl has a snarl of blue on her face...will this go away if I can get her moving?
Ok, and this is completely off-topic and totally stupid, but how do I load the MS help files so I can look at them? This annoying thing just keeps not wanting to let me read it. And who knew MS had such a thing?
Posts: 2,932
Thanks: 15576 in 28 Posts
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
And once again because I can't find the Anim button or the > to the left of it. |
They are in the lower right corner, but you probably aren't seeing them because you don't have the menu item Windows -> Show Keyframer checked.
And my girl has a snarl of blue on her face |
Those are the joints. There are many for the face... turn "show skeleton" (in the joints panel) off to look at the face without the joints. Adjusting the Joint Size a bit smaller (so that the circles do not protrude as far) may also help.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15576 in 28 Posts
But it worked! And the blue is gone This is just the cutest thing Wes.
But first the pleasure...then the pain. I'm off to read the MS tutorial and see if I can get the doll to do something else. If I do how do I save it? Do I just overwrite an instance of the thing that I imported into MS?
Has anyone managed to import something into the game with this yet? (well besides you)...inquiring minds would like to know but don't want to go all over the place looking.
Edited to add: I would like to know if there is some way of selecting the joint we want without having to search through the joints list to find it...is there some way of just selecting the joint in one of the windows that shows the model? I'm having a tough time finding her knees. < blush...ok...I found them...they just weren't named knees >...which isn't to say I wouldn't like an answer to that question. I still would like to know.
And what is that series of joints that is centered between her legs? What is it for? And no, that isn't an odd question thank you...I see the thing there and I just wanna know. If I get sent to my room over that then I'm taking you with me darlin'...
Edited to add: I've played around with this and I think I'm starting to get it. This isn't really hard per se...just tricky details the same as in meshing. I got my girl to do a high kick...lol.
So doing the thing that makes the new animation play (which I can't remember the exact details of yet) doesn't save it right? You have to then...export?...over the original? Is that right? Please give explicit instructions...exactly what to do.
And what is going on over in CAS tonight? It's like the Mongol hordes have descended. Any minute now we'll be hearing the LOW...thank goodness I'm safe over here in Meshing.
OM
Posts: 2,832
Thanks: 6613 in 20 Posts
Then you need to find it and test it with ChaosMageX's painting (in teh downloads here).
Yes, it replaces the original... I haven't replicated the work that was done to make code that will add animations to objects. I expect to get there eventually, but there is just me working on this at the moment.
The stuff 'tween the legs is the root joint. The Pelvis attaches to that, and everything else attaches in some way to the Pelvis. The idea is that when you rotate or move the root joint, the whole model is moved or rotated.
The other thing is that you can save your work as a MilkShape file, and it will save the animation and the mesh in a new file. Or you can export just the animation as an SMD file, and then import that. When you import an SMD, you can choose to append the animation to the end of the file, in which case you have two animations, the second one will play at the end of the first one... it's like recording a second program on your VCR at the end of the first episode. The reason I said not to do that is that
at first, there is an empty animation. So the first time, you don't want to append, or you get that long blank pause.
This appending is a feature, and it can be very powerful, because you can build animations by appending little parts one after another, there is no minimum size, and maximum size is limited mainly by memory, in the past I have had thousands of frames loaded at once (but I also have a bit above average computer). But hundreds is probably not stretching any machine that will run TS3.
Mostly, for a good animation, you really only want to rotate most joints, except the root, breasts and most face joints... those you move. The game does not enforce this, however, so you can do all the deformation stuff they are doing with Delphy's sliders... because that is what his sliders are doing, moving the joint positions, instead of just rotating them.
While you haven't seen any demo stuff, animations also play on objects, but you can't use the rigging for a Sim on objects, and practically every object with more than one joint is unique. The good news is that while making rigging files is all manual work right now, most objects except the beds have very few joints that need put in there... two for the crib, five for the cars (root + four wheels)... simple stuff, really.
If you like to say what you think, be sure you know which to do first.
Posts: 2,932
Thanks: 15576 in 28 Posts
This part is confusing too, "When you import an SMD, you can choose to append the animation to the end of the file, in which case you have two animations, the second one will play at the end of the first one..." Why would you choose to append instead of just creating the whole animation that you want to begin with?
Before I can try importing I first have to practice more with making the Sim move...it isn't hard to figure out how to rotate the joints (and it's very convenient that all the associated parts follow along...I'm glad that heavy lifting gets done for me) but having something that doesn't look ridiculous is a little more tricky.
OM
Who Posted
|