View Full Version : How can i set the loop count in an animation?
Nico Pretty Boy
18th Sep 2007, 03:07 AM
Hi people, forgive my bad english...I have a question, i made an animation 2 second in lenght; since 2 second are too little i want to set 10 or 12 loop of the same animation but i don't know how to do this. Please, can you help me? If i do it i can share with you some very good stuff, i'm a very good animator. Thanks
WesHowe
18th Sep 2007, 03:35 AM
Look through this tutorial:
http://www.modthesims2.com/showthread.php?p=1707080#post1707080
Echo describes how you can use a flag in a bhav so that temp1 to store the loop count, with -1 meaning repeat indefinitely.
<* Wes *>
Nico Pretty Boy
18th Sep 2007, 07:25 PM
(excuse my bad english) - Hi Wes and thanks for the answer. I got The Sims 2 ten days ago and now i try to mod it. I made skins, mesh and all went well with Milkshape but when i tried to make animations i seen that the MilkShape animation tool don't works so good, the animations appear all messed up in Milk and in Sims2. I used to make animations for Sims1 with Simpose, this program is little and not the best but it always works well. But now with Sims2, Simpose and Simpose2 not allow to import animations inside the game and i guess Milkshape is the only program that allow export and import animations in Sims2. The only way to adjust the animations is to set manually the axis with SimPe but this way take a long time and for this reason is not allowed to make many keyframes to store inside an animation in order to make a realistic movement (this is too bad...). i Love Milkshape but his animation tool for Sims not work well. Now i made an animation of 2-3 seconds in lenght and since Milk not allow to make more keyframes in a short time a want a way to set this (and of course others) animation in a 8-10 loops. I read the Echo's tutorial 2 or 3 days ago but when i click on the wizard there is only the "Trans to Idle" option, not "Loop Count in Temp1" option. I tried to set to "trans to idle" option but nothing happens. Since this animation is joinable i need more time in order to allow the second person to join the first person, cause if the 2-3 sec. of the animation run out, person A and person B can't do the joint and all the following animations can't run. What can i do? Tanks
WesHowe
18th Sep 2007, 10:50 PM
Well, Nico, you have made a lot of progress in 10 days.
The Animation Exporter is a new piece of software. I am not sure what parts of you animations are messed up. However, you can only move the root_trans joint, just rotate all the others.
The exporter does have problems when rotations in root_rot go past +90 or -90 degrees and other joints go past +180 or -180. You may have to fix the transition point in SimPE.
You are going to have to study BHAVs. There is a lot I do not know about BHAVs, and how to change what you have to what you need is one of those.
Find teh InfoCenter (here at MTS2) and start there.. there is a whole topic devoted to BHAV programming.
<* Wes *>
Nico Pretty Boy
20th Sep 2007, 05:52 PM
eheh, yes i got the Sims2 two weeks ago but i'm an older Sims1 modder. By the way, you are the same Wes that made plugins allowing people like me to work with meshes and animations for sim2? great....Believe me, i'm a very very good sims-animator, and i must tell this: i read all anims tutorial in this site and i seen some errors. For example, it's not right to set the first keyframe BEFORE make any change or to set the first keyf. on slot 1 on the timeline, the second on slot 2 ecc....and after you made the anims you must set the number 30 on the right in order to have the same number as the anims lenght. Unfortunately my english is not good and i can't explain very well these things. I think that both exporter and Milkshape anims tool not works well...try to rotate the r-thigh, than rotate the r-calf: now if you try to rotate the r-foot you'll see the foot making a bizarre rotation, innatural...and this is not an error of the exporter...
WesHowe
20th Sep 2007, 07:07 PM
Yes, I am that Wes.
There is a way to fix the MilkShape odd rotation issue.
In the tools panel, when you select rotate, there are some options. One is global, the other is local.
The animation software should ignore this and always do a local rotation (local being based on the parent joint relationship). But it doesn't. Always remember to set this to local when you start animating, and the odd stuff that happens to the feet and fingers will stop.
Do not confuse my Animaton Exporter plugin with Miche's Animation COnverter. They are quite different. Because his works from SMD files, he needed a way to determine what the default bone positions were, hence the instruction to set a keyframe forst.
My animation exporter is quite different. The first frame you set is the animation start position. The game will move from the last used position on the the sim to the position of your first keyframe. Thus, if they are standing and you play an animation that is laying down, the game will create a series of steps to move the sim from standing to laying down. This may be pretty abrupt.
Additionally, you can animate just parts of a body. To do this, you need to check the menu option "Operate On Selected Joints Only". With this, when you set keyframes, only the joint you have selected, and all children, will have keyframes set. So it is possible to make animation that only moves an arm, and leaves the rest sim in whatever position it was in. These are overlay animations.
So, be careful not to confuse the two tools when working with them. Mine is a MilkShape plugin that creates an ANIM file ready to put in the game. Miche's will creat an ANIM file from an SMD file that need not have come from MilkShape. Even when not using overlays, with my exporter you use the Length field to specify the total anim time, and only have to set the keyframes that define your animation... the game will interpolate all the between positions for you.
<* Wes *>
Nico Pretty Boy
22nd Sep 2007, 07:49 PM
You are right. I tried Miche's converter some days ago but it don't work so good for me, maybe some people could use it better than me; i always use your exporter, the Wes exporter, and i think it is the best way to follow. I have a question for all sims-people (maybe i must open another thread ^^): What type of anims you want? I mean dancin anims, walkin anims, or "something else"? I don't know if it's right or not making "something else" anims; you see, the world, Tv, mass media are filled of sex, i make sims-mod as hobby and i give my creations only to friends of mine. I sent a short avi captured in game with a sex scene to a big sims adult site asking what they think about those animations...this is the answer: "wow that looks really great best sims 2 anims I seen so far! ". I'd like to share it with other people for free; i know, this is not the right place to make this but there's an adult zone in this site. I like skinning, i like meshing and i like animating; a skin is a paint, a mesh is a sculpture, an amims is the life. These anims have a few keyframes but are realistic, so i made a version of Shaklin Love Bed with it and now it is a true sex object with custom anims (and not with in-game anims adapted so sims LOOKS LIKE making love). I must share it or not? I don't know...You are the animation exporter creator, what you think about this? Believe me, i dislike pornography; but in this situation we have a life simulator videogame...love is part of our life and i guess is not a bad thing (for us adult people) allow our sims to make love ^^
marvine
22nd Sep 2007, 11:02 PM
We want everything!! :lol:
Seriously, I think you should start with what you like to make and feel the game is missing. When you've released something nice, don't worry, people will send you LOTS of suggestions :)
Now if you made a version of Shaklin's bed with custom animations, as interesting as it sounds you'd need to contact them about their policy.
I'm not a trained animator but beta-tested Wes's Animesh plugins and then made animated spiral stairs and other stuff, so I shared some tips in a tutorial uploaded here (http://www.modthesims2.com/showthread.php?t=241067); maybe you'll find some of them useful since they are specifically meant for Wes's plugin, but also, if you have more experience, maybe you could take a look and tell me if you see something wrong?
Nico Pretty Boy
25th Sep 2007, 05:46 PM
eheh, ok i contact Shak. I seen your dance anims, it is perfect, maybe you can teach me something, not me...I read all tutorial in this site, i guess there are many people good with animations but the tools are not so good. I think that Wes exporter is the best way to make anims, i know, it's not perfect but no one else made something better so i guess Wes is a great programmer ^^.
marvine
25th Sep 2007, 07:48 PM
Yes, he is, and I've heard from specialists that his coding is excellent :)
Also, you can rely on him to improve and update his plugins, so even if a few things are not perfect yet, it will be better - within the limitations of milkshape of course.
And thank you for the compliment! :D
WesHowe
26th Sep 2007, 04:01 AM
Nico:
Thank you also for the nice words.
From my observations, new animations of high quality would be enthusiastically accepted, although the Shaklin type ones should get uploaded to that site.
Marvine has pleased many people with her ladder and stairs animations. As you described, we have learned a lot in three years about painting and sculpting sims, but only a little about making them alive.
As for Miche's animation converter project, he had to stop before it was finished. It could well have been a lot better, but personal issues interfered with his continuing work. He passed the source code to at least me, but I did not make any headway at rewriting it, and dawdled for a long time. But I did use his work together with the file format writeup on the wiki to help me create a new work from scratch, which is the AnimExporter plugin.
While I do not preannounce any new things I am doing, the animation stuff I have worked on recently will still be able to make use of any .ms3d files you made for this exporter. That is one of my design objectives, to allow older works to remain usable when I make an update. It is hard enough to make things without new versions of software requiring them to be remade because the programmer changed something.
<* Wes *>
Nico Pretty Boy
29th Sep 2007, 06:32 PM
Hi people...i can't find Shaklin for the policy (sob). A few days ago i sent two messages to him, maybe he's not at home. So what should i do? I don't want to change her L.bed name, i don't mind to put my name in it...maybe we can update it with this name: Shaklin LoveBed 2. '(°o,°)'
(i read that Shak allows recolor of his LB, what i made is not exactly a recolour but we can look at animations as colors, a more lighted color in place of a normal color^^ (don't tell me, my english is terrible, i know that...))
WesHowe
30th Sep 2007, 01:15 AM
Some creators gradually stop coming around, and never fully quit.
How about, instead of just improving theirs, make your own package? While it isn't polite to just make a copy of someone else's work, it is perfectly acceptible to open it up, see how it is made, and make your own original work with that knowledge. No one owns the technique, or the idea. I think the bed itself is just a stock game item.
Packaging your original animations, even when the idea came from seeing Shaklin's work, is certainly ethical. You can always credit him/her for the idea.
<* Wes *>
Inge Jones
1st Oct 2007, 05:15 PM
Shaklin is female, just as a FYI :)
Nico Pretty Boy
1st Oct 2007, 10:58 PM
You are right bro, but making anims take a lot of time and i have not the time to spend for learning and making behaviours. I'd like to learn all about bhav, i have changed some parameters in Shak LB yet. I read some Echo's tutorials about bhav (they are good and clear). There's some people that make objects with bhav based on anims, in my modest opinion this is an error, we must do anims based on bhav (i.e. some great bhav creators they don't know so much about making anims, so they use anims taken inside the sims2 game and adapt bhav on it). In the opposite way there's people good with meshes or anims but not with bhav...i imagine a place where a person good with bhav make an object, then a person good with meshes make the shape, and then another person good with anims make the anims for this object; in this way the sims comunity (aka us) will have (<--it's correct?^^) some better objects than ones created by a person all by itself.
P.S. so Shaklin is a lady? thanks for the information Inge ^^ ( but Marvine is a lady too? Wes is a man, i'm sure^^)
WesHowe
1st Oct 2007, 11:17 PM
I do not know shaklin, but Inge knows everybody.
Marvine is a gal. Her screen name sometimes throws people because "marvin" would be a man's name in English, which is totally unrealted to her screen name.
And yes, wes_h is a guy.
As far as the BHAVs go, they were written to support the animation capabilities in the game engine (and other game stuff). This per an old Maxis design document floating around. So somewhere there is a BHAV or a parameter to one that does the cool stuff, like right/left swaps, direction reversal, symmetry and so on.
And back to your original question, one parameter is the loop count, and -1 means continuous.
<* Wes *>
Echo
2nd Oct 2007, 12:46 AM
There's some people that make objects with bhav based on anims, in my modest opinion this is an error, we must do anims based on bhav (i.e. some great bhav creators they don't know so much about making anims, so they use anims taken inside the sims2 game and adapt bhav on it). In the opposite way there's people good with meshes or anims but not with bhav...i imagine a place where a person good with bhav make an object, then a person good with meshes make the shape, and then another person good with anims make the anims for this object; in this way the sims comunity (aka us) will have (<--it's correct?^^) some better objects than ones created by a person all by itself.
Hey Nico,
There are a couple of pretty good reasons why a lot of hacked objects use existing Maxis animation. The first is that, while BHAV hacking has been well understood for a few years now, accessible and general purpose animation tools are still relatively new, so hackers used to be limited to Maxis animations. The other reason is, as you stated, that some of the people who have learnt BHAV editing have not yet learnt or are not talented at animation.
If you want to work with other people (eg, you animate, someone else meshes, someone else codes, etc) on a project, then you can make a post in project proposals ( http://www.modthesims2.com/forumdisplay.php?f=436 ) explaining your goal and what you're able to contribute. Project proposals don't need to be for big projects, you can put up "animator seeks mesher", or "hacker seeks animator" type proposals there too! Mod teams/collaborations are quite common around here, but you have to find people who are interested in making the same sort of things as you. Remember that people like to make different things - I'd be delighted if someone came along and offered to mesh for me so I could just hack and animate, but that would only work if we both wanted to make the same sort of objects. :)
Oh, and since we're sharing, I'm a girl too. ;)
Nico Pretty Boy
2nd Oct 2007, 05:10 PM
Hi Echo, please to meet you^^. You are right, animations tools are new pieces of software, Wes told me. Sometimes i can't explain very well what i think cause my english is not good (as you seen...^^). I got Milkshape and Wes' plugins some weeks ago and then i have a tried to make anims...so i made some love scene anims for just one reason: they needs only two keyframes^^. The very first time i made a very good anim with a lot of different keyfrms but i seen it in game all messed up. So i posted a thread in the best sims site of all the web and a guy named Wes told me a lot of things ^^. In my Sim1 age i made 4 or 5 lap dance anims, new walking anims for child and male sims, some new idle poses, new dance, new anims for a lot of interactions. I read somewhere (and Wes told me too) about the 90-160 degrees problem in MilkS...this is a great prob in order to make anims with a lot of kfrms; besides, MilkS not allow to save kfrms and this is another great prob. I like to make my things in the best way i can, so if i make a complex anim but not realistic i prefer another one not so complex but realistic, even if it require only two kfrms. I like a lot meshing but animations making is something special, i also make 2D anims in vectorial graphic. By the way, i love The Sims but in my opinion the best videogame of ever is the Final Fantasy series (^however Sims allow me to meet some special persons^).
marvine
2nd Oct 2007, 07:53 PM
Nico, what do you need by "a lot of keyframes"? And why can't you save your animations in Milkshape?
A good reference for size would be the Maxis animations, they give us an idea of what the game can handle easily; there are few longer than 10000 milliseconds, and they are made with an impressive economy of resources - just a keyframe on a joint here and there (well, apart from the IK bits that I can't read), and the results can be very smooth and realistic.
So far I never had an issue with saving the keyframes in Milkshape; but I did have issues in the game at the beginning, when I didn't know how to use the "operate on selected joints only" option. Also, now I work with an average 10 fps, the game interpolates the rest very nicely - in fact, it seems to me that it deals better this way.
As far as I tested, the rotation issues happen only on three bones and under special circumstances, so most animations wouldn't be affected - and if they are, it's not awfully hard to spot the reversals in SimPE and fix them, just not fun to do again and again when testing the animation in progress.
I may make a short tutorial just for that if needed.
Now I can relate to your frustration, I have some cool ideas that require learning a lot more about BHAV editing - so much more that I'll obviously have to either take an unpaid leave, or beg for help at some point :)
Nico Pretty Boy
2nd Oct 2007, 09:46 PM
Marvine, i mean a lot of DIFFERENT keyframes...and yes, i can save my anims, what i can't save are my keyframes^^. When in our life we perform a movement, often we have a "start mov." a "central mov." and a "end mov."...often the "start mov." and the "end mov." are the same but in reverse order (when you sit on a chair you perform the "sitting mov." (then you stay there for a while) and then you perform the "stand up mov."...now, "sitting mov." and "stand up mov." are the same movement but in reverse order). So when you make an anim you need to save your kfrms, if you don't do that you have to create another time the same kfrms. You could make 3 different bhavs for Start, Loop and End anims but also you need to save the last kfrm of the Start anim in order to put it as Loop anim first kfrm...also you need to save the last kfrm of the Loop anim for set it as End anim first kfrm...in this way the three anims (start, loop and end) are perfectly linked. MilkS allow to copy and paste only a JOINT KEYFRAME, so in order to copy and paste an entire kfrm you must copy and paste ALL the joint of the kfrm you want to copy. In sims1 i made anims with a lot of different kfrms (20-30) and a lot of frames (sometimes more than 800). Example: we can make a walking anim with only two kfrms yes, one for the right step and the other one for left step but...the result will be not realistic cause, yes, the game with the interpolation feature create for us all the frames between your two kfrms but in a irrealistic way...a realist walking anim require at least 8 DIFFERENT kfrms, so the game will perform a good interpolation^^.
marvine
2nd Oct 2007, 10:38 PM
Oh ok!! I think I understand better now :)
There are workarounds to save a whole keyframe (or several) and reuse it in a new animationt though; one is via the smd export, did you try that? Export the first animation to smd, import that in a new file (you'll get only the skeleton at this point), delete the unwanted frames with the smd animation tools to keep only what you need, that you will then be able to import in a new animation file with a fresh model. Not overly convenient, but it's quickly done and works nicely. Sometimes I just make a copy of my animation and copy/paste the keyframes I need in temporary frames, delete all the rest and then copy/paste them in the wanted place. Now I'm sure that I'm not teaching you anything here :)
The smd trick is also useful for reversing animations and such, the downside is that it sets all the bones and frames in keyframes and needs cleaning afterwards.
Yes, I'm aware that you need more than two keyframes for a walk animation; I used 74 or 73 for the spiral stairs anims (for 13 steps including the landing, and total of 6000 or 6500 ms), but not all the bones are included in the keyframes, just those that Milkshape couldn't interpolate to my liking. Um, there's more to explain, but I'm not a native English speaker either and it's hard at this hour >_<
Jasana_BugBreeder
3rd Oct 2007, 07:18 AM
For myself, I chose using Milkshape ASCII export as a solution to keyframe manipulation :) The keyframes part is fairly easy to read and replace, and add/remove keyframes as well. And it doesn't generate intermediate keyframes, so no need of cleaning :)
marvine
3rd Oct 2007, 06:32 PM
Thank you very much for the tip, Jasana, I'll have to try this! Surely a very convenient alternative :)
Nico Pretty Boy
4th Oct 2007, 08:18 PM
Marvine, you said " in The Sims2 there are a few anims longer than 10.000 milliseconds, and they are made with an impressive economy of resources". I guess
Maxis prefer to make 3 short anims in place of a long one, i also think it is a good way (anyway an anim 10sec. in lenght is not a short one^^; in a 3D vgame the frame rate is 30-60 fps, so a 10 sec. anim have 300-600 frames). When you make an anim, open it on Simpe, click on all the joints and then click on "remove uneeded" option...in this way you remove many axis numbers so you can make economy of resources^^.
You said: "So far I never had an issue with saving the keyframes in Milkshape" i never seen that issue too^^; i seen it in Simpose and in some others animations programs.
You said: "the rotation issues happen only on three bones and under special circumstances, so most animations wouldn't be affected". I don't know that, i have
Milkshape 1.8.1.a and maybe it has some bugs cause in my anims the odd rotation problem happen on both the legs (even if i rotate it just a little), on both the the arms, on the root-rot, on the root-trans; and always the left arm (and his childs)
perform a smaller rotation in comparison of the right arm ( if in MilkS i rotate both the arms exactly in the same way, when i test it in game the left arm position is always
in a different position compared to the right arm). The odd rotation problem, as you said, is not so hard to resolve: the error occur when a joint rotation past the 90/180 degrees. Open your anim in Simpe, click on the crazy-flip joint you want to
adjust and look at the X-Y-Z values; for example you'll see someting like this:
r-thigh first keyframe: X: 10200 Y: -403 Z: -652
r-thigh second keyframe: X: -9965 Y: 251 Z: -702
look at the X axis values 10200 and -9965, there's a enormous difference between these values, it means "go to 10,20 o clock and then go to 9,50 o clock", so you'll see the hour-hand in the same wrong rotation as our animation.
This happens when the rotation past the 180 degrees, but the X value are 10200 and -9965, so where are the 180 degrees? The values 10200 and -9965 are just parameter and 180 degrees value is equivalent to 11520 parameter value.
So, when a rotation past the 11520 value (aka 180 degrees) it take the inverse way, and besides it change the +/- values. Let't try to adjust the X values: the X value on the first keyframe is always the one good, so we must change the X value on the second keyfrm...
take the X value -9965 and change it in the same sign ( + / - ) of the X value first keyfrm, so we have the value 9965; now take the 11520 value (aka 180 degrees) and subctrat 9965 ( 11520-9965=1555 ); now we must add this value 1555
(aka 24 degrees) to the 11520 value (aka 180 degrees)....we have the value 13075 (aka 204 degrees), and this is the right number to put as X value in the Second Keyframe ( and no more crazy rotations^^).
P:S. i know, my english is something like an odd rotation in a crazy animation ^^
WesHowe
4th Oct 2007, 09:42 PM
Nico:
The arms and legs end up with a default rotation when down of about 180. The actual encoding is rotation*64.0, so the range of -179 to +180 is -11456 to 11520.
The game will accept rotations in the range of 0 to 360, or 0 to 23,040, so therefore -179 can be changed to +181, or 11584. When you do this, it moves the short way.
The problem is that I do not know why the game sometimes chooses to go almost all the way around (355 degrees) for a rotation from say 179 to -176, instead of the short way (5 degrees). Sometimes it rotates as expected.
I cannot just arbitrarily change the numbering range, because then a rotation from 3 to -2, which usually works fine will almost always go from 3 to 358. If I knew when it would decide to go the long way and when it would the short way, I could code a fix for that into the exporter plugin.
Jasana, Echo, Marvine and myself have all had troubles like this, mostly on the legs and arms, but sometimes on root_rot and other bones. root_rot seems to break at 90 and -90, I think because it has a default rotation of 90 degrees on its parent (root_trans).
<* Wes *>
EDIT: Also, at least for meshing, you should get MilkShape 1.8.1b. It is a free update, and it fixes at least one problem where the game keeps removing one character from each comment everytime you save and reopen a file, eventually making something break.
marvine
4th Oct 2007, 10:16 PM
Phew thanks Wes for explaining this in a few words!! :lol:
Nico, the arms issue should be solved in the latest version of the exporter; the settings were a temporary workaround for some oddity, but the last version I've been testing is now ok :)
Now could you say more about the issues you're having with with the legs? All I'm aware of is the reversal when the thighs are rotated backwards on the X axis (at which point the value in SimPE needs to be removed from 23040 to get the right rotation value, 11520 being the default position), but it doesn't happen too often since the movement isn't natural.
And you mention the root_trans, but rotations shouldn't be applied to that one so I'm not sure what you mean - now the translations don't "stick" very well without an export/reimport to smd, and I don't have a clue why this happens.
Oh, I updated my downloadable "body animations" tutorial last week, with examples for correcting the rotations in SimPE. I hope that it's clear enough, not sure >_<
Now you're mentioning something very interesting :
When you make an anim, open it on Simpe, click on all the joints and then click on "remove uneeded" option...in this way you remove many axis numbers so you can make economy of resources
I don't see this option in the animation tabs in SimPE, and I can't select all the joints at the same time either - where is it hiding?
Blarg, I need to get some sleep and won't be able to access the site from my workplace tomorrow... But I'll check back as soon as I can.
Thank you for the pains you're taking, this conversation is really interesting :)
Nico Pretty Boy
5th Oct 2007, 05:28 PM
Wes: "I cannot just arbitrarily change the numbering range, because then a rotation from 3 to -2, which usually works fine will almost always go from 3 to 358". I agreed.
Marvine: "All I'm aware of is the reversal when the thighs are rotated backwards on the X axis but it doesn't happen too often since the movement isn't natural".
You are right, it's not a natural movement (maybe only in some dancing step^^) but if you rotate forward the pelvis joint you need to rotate both the legs backward. In Simpe, right click on a joint of your anim et voila, the "remove uneeded" option appear (but you can't select all the joints at the same time). The root-trans, as you said, it can't be rotated (so it is not a rotation problem, my mistake)...there's a little problem with root-trans when you make an anim that run on the object (i.e. a sleeping anim run on a bed).
Marvine, this is not a pain for me, it's a pleasure^^. The only pain is when i can't explain what i'm thinking.
WesHowe
5th Oct 2007, 06:10 PM
I have in testing a version of the animation exporter that allows you to define by way of a bone comment keyword, per bone and by axis, the automatic conversion from -179 to +180 to the framework 0 to 360, where -179 becomes of course 181.
It seems to work well enough, and when properly used will eliminate at least some of the need to edit in SimPE.
I would like a better solution, but I haven't any additional ideas on what I could do to make it work smoothly automatically.
<* Wes *>
WesHowe
5th Oct 2007, 06:27 PM
there's a little problem with root-trans when you make an anim that run on the object (i.e. a sleeping anim run on a bed).
root_trans has a significant rotation applied by the game engine, 90,0,180. This flips the model from lying on it's back with the feet towards you to upright facing you.
This has the effect of making X,Y,Z animation values -X,-Z,-Y. So the math I use in the plugin for body meshes is tuned to this. While it is possible to make the root_trans bone rotate, without using the right keyword in the bone comments any bone with "trans" in the name does not have any rotation keyframes exported.
This is in keeping with the way the game engine operates, requiring two seperate sets of frames using the same bone name to both translate and rotate a joint.
So you should only use root_trans to move the entire sim up, left, right, etc. and root_rot to make the sim lie down, etc. And yes, there are direction reversal issues on root_rot rotations, too.
<* Wes *>
marvine
5th Oct 2007, 09:19 PM
but if you rotate forward the pelvis joint you need to rotate both the legs backward.
Ah.. erm, I see - yes, that would be an issue :D
Thank you very much for the explanation. I tried the "remove unneeded" option on my spiral stairs animations, there are some issues. It works great in general, but not too good on the clavicles, and possibly the root_trans: for the clavicles, if there are no transformations applied to them during the animation they appear rotated about (possibly exactly since I don't believe in random values) 45 degrees upwards on the Z axis, even though the first keyframe still appears with the correct 90 degrees Z default rotation in SimPE.
And when applied to the root_trans, it seems to undo the "smd fix": the result is that the body doesn't stay very well in place and the sim seems to stake on the steps. How I'd love to understand this root_trans mystery!!
I have in testing a version of the animation exporter that allows you to define by way of a bone comment keyword, per bone and by axis, the automatic conversion from -179 to +180 to the framework 0 to 360, where -179 becomes of course 181.
You may not be totally satisfied, but this sounds like a very nice workaround :)
WesHowe
5th Oct 2007, 09:35 PM
Well, he has told us what he is working on, but he has kept the tone and the details fairly circumspect. However, that is a detail that probably needed described.
As for packages, sometimes they show up in the mail unexpectedly. :)
<* Wes *>
Echo
6th Oct 2007, 06:49 AM
I would like a better solution, but I haven't any additional ideas on what I could do to make it work smoothly automatically.
Wes, may seem like a foolish question, but if we assume that the "correct" (ie, Milkshape-like) way of translating is the one which produces the shortest distance between rotation (x-1) and rotation (x), couldn't you do something like:
int distbtwn = r[x-1] - r[x];
if(abs(distbtwn) > 180)
{
distbtwn = 360 - distbtwn;
if(r[x-1] < 0)
{
r[x] = r[x-1] - distbtwn;
}
else
{
r[x] = r[x-1] + distbtwn;
}
}
... or some such?
I know you don't actually get the frames in a nice neat array, but I guess you're probably getting them in some sort of structure where you can compare the one which came before to the current one at some point?
Edit: darn whitespace removal, moved the above code into a code block to make it slightly more readable. :)
WesHowe
7th Oct 2007, 01:34 AM
Adding the needed code for previous frame cache to the exporter would not be difficult to implement, and would be all the added storage that is required to implement your suggestion. Supporting code would be needed, but essentially it is "calculate this both ways and use the method with the smallest absolute rotation change".
This may be a very good idea, and it may be a very good idea with subtle hidden side effects. It would certainly limit rotations to under 180 degrees, because at exactly 180 the rotation direction would be ambiguous and anything greater than 180 would get reversed by the algorithm. I will give this some thought over the next few days.
Thank you for the idea.
<* Wes *>
Nico Pretty Boy
9th Oct 2007, 09:55 PM
Wes: " He has told us what he is working on, but he has kept the tone and the details fairly circumspect. " :cool:
Marvine, could you explain me what you (and all of you) means with the word "issue" ? So the remove unneeded option don't work too...oh, i forgot to tell you that i seen your stairs anims; you are one of the better sims-animators that i seen (now i read your updated tutorial).
I also seen the Echo's code...the Wes and Echo's coding work is really interesting, i don't know much about it but i should like to understand just a bit of it. Hey Wes, i got milks 1.8.1b as you told me.
WesHowe
9th Oct 2007, 10:49 PM
Nico:
MilkShape 1.8.1b has some bugs that were introduced in 1.8.1 and 1.8.1a fixed.
As far as coding, well I spent six months coding the AniMesh exporter. A lot of that time was because I had a lot of problems making the rotations from MilkShape perform the same rotation in the game. The game uses some especially complex skeletal default rotations for the body meshes, and there is some stuff that as yet does not look the same in the game as in MilkShape. The only fast solution I can suggest is rearrange the bones so it looks right in the game.
As far as animation tools go, MilkShape and the current exporter are all we have to pick from, as Miche's converter is not really a finished product. Now, that does not mean you have to necessarily make the animations in MilkShape, but whatever you would make them with needs to interact with MilkShape well at the file level.
As an experiment, I exported a mesh and animation (Marvine's dancing gal) from MilkShape to the Maya PLE program using .fbx format. I was able to make the animation play properly in Maya. However, since Maya PLE cannot save anything useful (it is the free learning edition) I was unable to test exporting from Maya back to MilkShape.
The biggest issue using other tools is to start with the right rigging. The AniMesh exporter only works with UniMesh imported skeletons for a reason, and that is other potentially usable bases (such as the MilkShape ASCII export from SimPE) have variations in bone ordering and default rotations. If you have a different starting point, and you still do the same things you will end up at a different point.
Nonetheless, I would all love to see you make something useful with animations (even if it gets posted elsewhere because of age restrictions).
<* Wes *>
marvine
10th Oct 2007, 07:03 PM
*stares in awe at the little bit of code*
Would a manual workaround be possible to get over the 180 degrees limit? The legs, root_rot and upperarms need to work on a bigger angle... fixing the current problems in SimPE isn't too hard, or wasn't in the kind of animations I worked on, but SimPE edits on more bones would not be fun.
MilkShape 1.8.1b has some bugs that were introduced in 1.8.1 and 1.8.1a fixed.
I believe you mean the opposite, 1.81b fixes the 1.8.1a bugs - at least 1.8.1a had the nasty habit of swallowing bone comments :)
Nico, by "issue" I mean "problem"; but the "remove unneeded" option is still interesting, it should be safely useable for other bones. It needs more testing, on the legs in particular, but I'm sure it's very useful. Oh and thank you for the kind words! I guess the animations are okay as long as you don't take a too close look in the files - most probably lots of "unneeded" things in there :lol:
Nico Pretty Boy
10th Oct 2007, 09:27 PM
Marvine, i looked your anims files in Simpe too (i love the unneeded things :lovestruc ).
Wes, right now i made this sample just for you (i spent just an hour to make it so don't expect nothing special ^^). In the next days i shall make something better :D
WesHowe
10th Oct 2007, 11:39 PM
Would a manual workaround be possible to get over the 180 degrees limit?
The 180 degrees would be 'per step'. The algorithm I am proposing would always pick the number framework that resulted in the smaller rotation, meaning a rotation from one frame to the next of 185 degrees would end up being turned into 175 degrees in the opposite direction. So to make a proper animation, the new rule would be "make all rotations between each frame 180 degrees or less".
I believe you mean the opposite, 1.81b fixes the 1.8.1a bugs - at least 1.8.1a had the nasty habit of swallowing bone comments :)
MilkShape 1.8.1b has some bugs that were introduced in 1.8.1 and 1.8.1a fixed.
1.8.1b fixes the bugs. Because english is such a tricky language, you can parse what I did say two ways, with different meanings. How I meant the statement to be parsed is indicated in italics. Sorry.
<* Wes *>
WesHowe
11th Oct 2007, 12:26 AM
Wes, right now i made this sample just for you
Well, thank you.
The work is very nice... high quality animation like Marvine does. The movements of the head and armsynchronize nicely. Quite realistic action.
I didn't mean I wanted you to make a special effort just for me, I meant seeing it in a general sense, packaged up for download. I can see from the gif that people will like your work.
<* Wes *>
marvine
11th Oct 2007, 06:51 PM
So to make a proper animation, the new rule would be "make all rotations between each frame 180 degrees or less".
Oh ok, this would be perfectly fine then! For body animations at least, bigger rotations between two frames shouldn't ever be needed.
And thanks for the grammar lesson, it seems obvious now but the phrasing has no equivalent in my language so I'll have to learn to expect it. In other circumstances the misunderstanding could be problematic...
Nico, I had to take a peek, your sample animation is very nice and smooth - and fun! I can't wait to see more of your work. :)
Nico Pretty Boy
11th Oct 2007, 10:37 PM
Wes, you spent 6 months for made your plugins and then you gave it to the people...i know, you made it for ALL the people but i don't mind, i think that you allow ME to work with sims-anims so a simple sample (-->simple sample?!?<-- sob...) animation is the less that i can do...anyway i made what i love to do ^^. Now i try to make a true object downloadable for all the people.
Marvine, thanks ^^
WesHowe
12th Oct 2007, 12:58 AM
you spent 6 months for made your plugins
Well, if I had known a litle more, I probably could have done it in a few weeks. I ended up doing a lot of trail and error (mainly error) in converting the rotations. Here is one of the errors: http://profile.imageshack.us/user/weshowe/images/detail/#329/pretzelitismb7.jpg
So, I will watch for your upcoming new work.
<* Wes *>
Nico Pretty Boy
12th Oct 2007, 08:01 PM
All the pics are very very fine...so you are a cowboy programmer ^^ (i am an urban animator instead). I like the web when it allow me to meet some special persons. I seen your sim-girl pic; when i tried the Miche's converter my animation were something like that, with the joints all messed up. To make animations is not easy but i guess to make animation programs is very difficult...when a month ago i got The Sims2 i believed there's no way for make anims for it, and this is the reason why i haven't sims2 from the beginning. See you guitarist-cowboy-programmer ^^
WesHowe
13th Oct 2007, 04:47 AM
I have only been a cowboy programmer a few years. Before that, I worked in engineering for one of the big cellphone companies. Now, I have no job. I was going to be retired, but that was too boring. So I bought a cattle ranch, and then some cattle, and now I am already breeding some of my cow's babies (not to their dad, of course).
I am attracted to 3D graphics stuff (the UniMesh plugins are my work also). I am not so good at making the meshes or animations myself. I know what to do, but I just do not have the eye for detail like you and Marvine do. So I make guns, and let everybody else fight the wars. :)
<* Wes *>
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.