Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#1 Old 9th Jul 2008 at 4:34 PM
Default Incorrect Joint Rotations In-Game
Hello. I've been playing around with AniMesh again and some poses/animations show differently in-game than the way I pose them. For example, if I were to rotate a joint into a 90 degree angle in Milkshape, in-game it may be at 45 degrees instead. This is just an example of some joints not moving the way that they were posed in Milkshape. I've noticed this with more recent poses and animations that I've made.

The difference is usually more subtle than the example I had given. A joint may be rotated slightly higher or lower than originally positioned. I've had this problem for a while, but just ignored it. Now that I am working more with animations, I'd like to find a work around. I don't know if this is a problem with my animations, or something I can fix in SimPE. I recall seeing where someone else had a similar problem, but I can't find the thread.

Is there a way to get poses/animations to show as closely in-game to the way I pose them in Milkshape?
Advertisement
Lab Assistant
Original Poster
#2 Old 6th Aug 2008 at 4:13 PM
I've encountered a new problem. Hopefully someone can offer a solution.

I'm testing animations in-game. The hips shift slightly from side to side, but only on two of the animations do the legs rotate 360 degrees around rather than stay on the ground.

First, I thought I moved the hip joints too much, but all the animations have almost the same lower body position and only two of them have this problem. In fact, I created one of the animations a several months ago and had no problem with it then. It looked almost exactly the same in-game as it did in Milkshape. Now that I've re-imported it, the legs spin like crazy. This leads me to believe I made an error in exporting it from Milkshape or importing it into SimPe, but I'm not sure.

Has anyone experienced wonky leg syndrome or know how to fix this? Any advice is appreciated.

Thanks.
Instructor
#3 Old 6th Aug 2008 at 5:37 PM
Quote: Originally posted by pinksuki2k
For example, if I were to rotate a joint into a 90 degree angle in Milkshape, in-game it may be at 45 degrees instead.

Make sure you apply:
- only rotations (in Rotate options, select Origin and Local) - to check this out, you can export your anim as Milkshape ASCII and check that all translations blocks have 0.000000 0.000000 0.000000 for all rows
- only to the real bones - i.e. don't rotate

Quote: Originally posted by pinksuki2k
The hips shift slightly from side to side, but only on two of the animations do the legs rotate 360 degrees around rather than stay on the ground.
That't the -179 to +181 transition problem - by default, Milkshape maps angles to (-180;+180), while Sims prefer (0;360).
You have 2 solutions for this:
- fix such angles manually in SimPE - beg Wes to release the beta version which has special keys to handle this - I had the same legs problem when making cellar, and at least for legs it can be handled automatically
Lab Assistant
Original Poster
#4 Old 7th Aug 2008 at 8:25 PM
Thanks so much for replying =)

I went into SimPE and changed any negative angles on the X-axis for l_thigh and r_thigh to positive. In-game, the legs no longer spin 360s, although the feet slide out of place a little. This can be fixed with further tweaking I'm sure. Thanks again for that bit of advice.

My only concern now is editing the ASCII file. All this time, I've been rotating with the options "Center of Mass" and "Global" selected. Could this be the cause of my problem? Well, I exported a pose from Milkshape to ASCII format and checked out the .txt file. I see two "root_trans" and one "breathe_trans". I'm assuming they are the translation blocks I should edit. I changed the blocks above or below them all to 0.000000. Most of them were already set 0.000000 with some rows beginning with 1.000000, 2.000..., and so on. I tested the pose in-game, but there was no difference. I'm not sure what went wrong. I must've misunderstood.

Could setting my Rotate Options to Origin and Local prevent this same problem in the future?
Instructor
#5 Old 8th Aug 2008 at 6:27 PM
Center of Mass is certainly bad, never use anything other than Origin from that block. You see, joints other than root_trans may not be moved, only rotated - and if you use Center of Mass, Milkshape will move them, because, well, the center of rotation is different from expected - don't know how explain it better.
As for Global or Local - in many cases, you can use Global and it produces correct rotations; however, sometimes it adds translations too - you can see it often on fingers and toes (symptom in Milkshape - you try to rotate a hand, and it starts to grow 8-)), and in such cases, it's better to use Local.

ASCII export is quite simple format - the animations part of it (never change anything else) consists of blocks like this one for each bone:
--------------------------
<bone name> -- don't change
<parent bone name> -- don't change
<bone position> -- don't change
<number of translation frames below>
<frame number 1> <translation by X> <translation by Y> <translation by Z>
<frame number 2> <translation by X> <translation by Y> <translation by Z>
...
<frame number N> <translation by X> <translation by Y> <translation by Z>
<number of rotation frames below>
<frame number 1> <rotation by X> <rotation by Y> <rotation by Z>
<frame number 2> <rotation by X> <rotation by Y> <rotation by Z>
...
<frame number N> <rotation by X> <rotation by Y> <rotation by Z>
--------------------------

Pretty simple, isn't it? (Note, though, that X-Y-Z are as Milkshape sees them - in SimPE, you'll have translations in different order, and rotations are a pain to convert.) Stuff in rows that aren't marked "-- don't change" is OK to change

Keep in mind that value in the row with number translations/rotations must always match the actual number of translations/rotations after it - or Milkshape will not be able to import the file back.

So, what you can do one of two:
1) in each translation block except for root_trans, replace translations values with zeros - only translations, not frame numbers
2) _delete_ all translation blocks except for root_trans at all - so you'll end with blocks like this:
--------------------------
<bone name>
<parent bone name>
<bone position>
0 -- yes, literally 0 here
<number of rotation frames below>
<frame number 1> <rotation by X> <rotation by Y> <rotation by Z>
<frame number 2> <rotation by X> <rotation by Y> <rotation by Z>
...
<frame number N> <rotation by X> <rotation by Y> <rotation by Z>
--------------------------

First way takes a lot of work, but it's a bit safer if you are, well, not fully understand what you are doing
Second way is much simpler and easier, from my point of view, but you need to do it carefully so you will not delete/replace wrong row.
Lab Assistant
Original Poster
#6 Old 10th Aug 2008 at 9:56 PM
I copied a selection of the txt file pre-edit showing the 3 "_trans" blocks that I see. Two sections are labeled "root_trans" and further down in the file is "breathe_trans". Most of the rotations are already set to zeros, unless these are not the blocks I should be altering. I've tried changing only the "breathe_trans" block to zeros, except for the frame numbers (1.0, 2.0, ...?). Checked it out in-game. No luck. Then I also tried changing the "root_trans" blocks to zeros, minus the frame numbers. Same result.

I'm almost positive that I'm not following correctly. Luckily, this isn't a huge problem with static poses—but with animations, it can be bothersome. From now on, I will use the "Origin" and "Local" settings as you suggested.

If only I could fix the current animations. Hmmm.....

------------------------------------------------------
------------------------------------------------------
"root_trans"
"auskel"
16 0.000000 1.012200 -0.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000
"root_rot"
"root_trans"
16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000
.......
.......
.......
"breathe_trans"
"spine0"
16 -0.000000 0.080000 0.130000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
2.000000 0.000000 0.000000 0.000000
3.000000 0.000000 0.000000 0.000000

------------------------------------------------------
------------------------------------------------------
Alchemist
#7 Old 11th Aug 2008 at 1:36 AM
Besides using MilkShape Ascii, I wrote an entire tool set to tweak and animation with. I called it AniMax and it disassembles an ANIM into an ascii file, and can recompile the (possibly edited) file back into an ANIM file.

It's posted in the same message as the AniMesh plugins. Not a tool for computer lightweights, but then neither is editing ANIMs in SimPE. With AniMax, you can cut and paste from other animations.

I also have a pair of raw ANIM frame exporter/importer plugins for MilkShape. They were designed to do what you are trying to do in MilkShape Ascii, edit the anim frames to fix stuff. I'm pretty sure I posted them here, but they are also on the MilkShape site, attached to a post I made in the announcements forum.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
Original Poster
#8 Old 11th Aug 2008 at 9:44 PM
Hi.

I think I've come across your AniMax plugins before, but looked over them, thinking they would be way over my head. Well, after disassembling an animation and viewing it in a hex editor, I realized that I was right. AniMax is a little beyond me right now. Your Raw ANIM importer/exporter plugins, however, are just what I need.

It's great that I can set exact rotations, which is perfect for creating symmetry between left and right joints. I've had some good results with it so far and now I'm off to play with it some more.

Thanks for all your work Wes_h =)
Test Subject
#9 Old 27th Sep 2009 at 2:19 AM
Default Missing something for the aniamtion to work.
Alright ive made an animation.

I used the BasebodyMale thing, i saved it into an Bodyoverlay,
locomotion: pose.

I did got my animbox setled up. but when i click "start' in the game, the animation apears, but like.. its not really the same as the one ive made in milkshape 3d.

But i recongise that when i start the animation, and then i click for example: "Go here" (walk) the animation looks more alike..

So im there thinking that an animation plugin or something is missing, and that when the sim is doing the animation, as its overlay the sim (walks, talks, all the animation when i have my game in Free will) the animation looks alike in milkshape 3d, BCoZ its missign an animation.. but ive tried so many things!

could you please please help me! i dare you i beg you! i really wanna make animations! thanks.

here is the video of my problem:
http://www.youtube.com/watch?v=8lF8EjLYNB4

much love! thank you so much~! -Aleex
Retired Duck
retired moderator
#10 Old 29th Sep 2009 at 2:04 AM
anoyeness, given your other recent post in the animations forum, I'm assuming you're running these as overlays? Overlays are a sort of 'additive' animation, it adds your animation rotations/translations to the equivalent rotations/translations of any other animations playing on your sim (including idle animations, locomotions, facial animations, etc).

If you just want it to play your animation and your animation only, you should run with high or ultra-high priority. Of course, that overrides *all* animations, including carry and look-at animations, so you need to be careful doing this as part of gameplay. As part of a posebox, it's fine. (For a posebox, it also wouldn't hurt to run a "stop all animations" on your sim first.)
Test Subject
#11 Old 22nd May 2010 at 10:22 AM
Default help please!
ok me and max2sims2 have the same problem on making animations

when we move the root_rot on y and x so rotate and some way looking up its rotates really weird ;l like 360* diagonal we tried but to delete negative but then it wont turn.

look here for what i mean:

CLICK HERE


please help it would be so great O_O!
Retired Duck
retired moderator
#12 Old 22nd May 2010 at 10:53 AM
kontgat, in general we'd prefer a clear text description in your post over a 1 minute 30 video with questionable musical taste.

The issue you're having is the same one discussed all through this thread. You need to fix your rotations in SimPE. To find the incorrect ones, go to the anim file and select the relevant joint form the drop down list. That will open up a tree view with all of the time codes (tc) for that joint. They're in order, and the first number after the tc= is the number of milliseconds in, so you should be able to find the affected times that way. If you expand that, you'll see entries for each of the axis. Click on the one which you want to change, then look over to the right. There should be a row of boxes with "Parameter:" at the start. The second of these boxes (which happens to be the largest) shows the actual rotation which you may need to change.

Once you've changed any broken ones, hit commit and you're good to go.
Test Subject
#13 Old 7th Jun 2010 at 12:04 AM Last edited by blaass : 7th Jun 2010 at 12:47 AM.
i don't know if i should create a new thread but
since it's the same subject i prefer to ask here
i had this "crazy legs" problem and i fixed changing all
the negative values in the x-axis to positive

but now, in game, the legs slide out of place a little

i can post a copy of the animation box or the milkshape file if neccesary

english isn't my native language so, i hope you have understood what I tried to say

help please
Retired Duck
retired moderator
#14 Old 7th Jun 2010 at 1:58 AM
blaass, rather than just changing negative values to positive values, try adding 360 to the negative value. That should be a bit more precise.
Test Subject
#15 Old 9th Jun 2010 at 3:10 AM
so if, for example, i have -10569 i must replace it with -10929 ?

thanks for the help
Retired Duck
retired moderator
#16 Old 13th Jun 2010 at 2:43 PM
Erm, I'm not entirely sure you're looking at the right value if you're getting -10569. One of the values is the number of degrees rotation. A full circle goes from 0 to 360. To get -10569 your sim would have spun around backwards about 29 times.

Could you post a screen shot of the place where you're getting the number?
Test Subject
#17 Old 13th Jun 2010 at 5:48 PM


i didn't know that. In that case, you're right. I'm not looking for the correct value

so the only way to fix the rotating legs is adding 360 to the negative values ? but with animations with more than 80 keyframes, should i fix all the negatives one by one ?
Retired Duck
retired moderator
#18 Old 14th Jun 2010 at 3:09 AM
The values you should be using are the ones in the second column down the right; -165.14060000 and -3.10937500.

Unfortunately, yes, you do need to fix the rotations one by one. If you're feeling a bit inventive, there's a tool Wes wrote which translates animations to a text-based format and back again, which makes it a bit easier to script a fix, but that requires some inventiveness to get right (and is done on a case-by-case basis).
Test Subject
#19 Old 20th Jun 2010 at 12:18 AM
I wish it were easier to fix this. anyway thanks for your help. I'm still a rookie in SimPE, but I have some free time (at work ). Where is this tool?
Retired Duck
retired moderator
#20 Old 27th Jun 2010 at 1:01 PM
The tool is in this thread:
http://modthesims.info/showthread.php?t=239060

It's the "msRawANIMPluginsV02.zip" attachment.
Test Subject
#21 Old 22nd Sep 2010 at 6:52 AM
i managed to fix my animations thank you soo much Echo for your help ..but i found out a inverse situation. i have an animation with negatives values (instead of positives) in the X axis, and then it changes to positive values. what should i do ?

it's something like this : -150 / -165 / -174 / -179 / 25 / 10 / 3 / 0 / 0

the pelvis joint spins in the opposite direction between : -179 & 25

Sorry for bothering again. Thanks in advance!
Retired Duck
retired moderator
#22 Old 25th Sep 2010 at 8:01 AM
Subtract the positive values from -180. So in the case of your numbers above, it would be:
-150 / -165 / -174 / -179 / -205 / -190 / -183 / -180 / -180
Test Subject
#23 Old 3rd Nov 2012 at 9:42 PM
Default Rotation in game
I have a problem.
I will show that step by step
1. I make new animation pose in Milkshape.
2. I want rotation 180° in my pose so I'm doing it.
3. I'm saving all perfect.
4. I turn SimPE and I doing all from this tutorial: http://www.youtube.com/watch?v=LXaIuBgE0lk
5. Ending my posebox and turn The sims 2.
6. I'm turning my animation pose and seeing that my sim doesn't rotate, that I wanted :<< My sim does all from animation without rotation.

Can you help me?
I don't know did you already answer because I'm bad in english and I didn't focus on all in this post. But If I get answer for my question I'll try to understand
Instructor
#24 Old 5th Jun 2016 at 5:28 PM
i believe im having the same problem here, but im not really understanding the steps to fix it. i was wondering if someone could help me
This video shows what was going on at first:
https://www.youtube.com/watch?v=TMiwFUo-VHI

in the sims 2 the animation isn't playing the way it does in milkshape. the legs aren't moving right.

i found this tutorial that's supposed to show how to fix the problem: https://www.youtube.com/watch?v=LXaIuBgE0lk
but it didn't really fix it...
here's a video of what it's doing now: https://www.youtube.com/watch?v=ushjtb-0BYg

is there another way to fix this?
Please help.
Instructor
#25 Old 16th Nov 2016 at 5:56 AM Last edited by Prime : 16th Nov 2016 at 6:38 AM.
Quote: Originally posted by Prime
i believe im having the same problem here, but im not really understanding the steps to fix it. i was wondering if someone could help me
This video shows what was going on at first:
https://www.youtube.com/watch?v=TMiwFUo-VHI

in the sims 2 the animation isn't playing the way it does in milkshape. the legs aren't moving right.

i found this tutorial that's supposed to show how to fix the problem: https://www.youtube.com/watch?v=LXaIuBgE0lk
but it didn't really fix it...
here's a video of what it's doing now: https://www.youtube.com/watch?v=ushjtb-0BYg

is there another way to fix this?
Please help.



sorry to bump this but can someone please help me understand how to fix this? i read over the directions and they seem quite complex. im still having this problem.

UPDATE: I still haven't fixed the problem yet, but here's a closer look at what I'm seeing in SimPe.. this is for the animation for the sim being hit in the first video (before I did the whole changing the positive parameters to negative thing)... I thought showing this might make it easier for someone to help me fix this. I'm having this problem with more than 1 animation I made too.
ALSO, this animation has a lot of keyframes so that's why there's so many pictures:








Back to top