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!
Alchemist
Original Poster
#76 Old 18th Mar 2008 at 8:24 PM
First thing you want to do is study the layout and graph (draw) the heirarchy for all the bones. This is easiest to follow in the CRES section in SimPE. Since I don't have Pets loaded right now, I have to work from memory.

But what you are wanting to do is draw a picture of the skeleton, attaching each bone to the parent, all the way back to the root (duskel, root_trans, root_rot). Label each bone so that you have a guide to work from.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Advertisement
Lab Assistant
#77 Old 19th Mar 2008 at 12:36 AM
Wes, I got that figured after making some comparisons with Milkshape 3D's Ascii for an Adult Man and a Big Dog, along with the 3D Preview in SimPE.

But by following in the Bone Heirarchy from CRES section in SimPE only returns the same order of children coming before their parents, the same cause for the CRES's infinate load in Milkshape.

Dealing with a pet's Bone Heirarchy is a bit tricky. You see, in a human Sim there is only one bone (one of the spine bone along with root_trans and root_rot) joining to the absolute root (auskel). That makes for easy parent to child. However, in a pet, there are two bones (one from the spine and the other from the head) joining to the absolute root (duskel). Perhaps that's because pets have their spine rather parallel to the ground? Anyhow, that may be the reason why they have child coming before parents. But then again, they can do away with the link on the head to the root.

At first I used the joint list from the SimPE's 3D Preview as the joint order. Then I realise that it's not according to order! The end result? A muddle of mass, poor dog! He even sank into the floor! All my tedious effort gone.

But then, I found the Bone Heirarchy from the GMDC. I got the bones reordered and the result was much better. However, some part are still out. Maybe that's because I don't know how certain child bones join to which parent. Those are the ones which are located at the same position. How can I tell which parent should I join the child to if they are in the same position? Give me some time to work on it again. I might list down those overlapping joints here later. For now, I can only do guess work. Does anyone know how to link them?
Alchemist
Original Poster
#78 Old 19th Mar 2008 at 1:34 AM
OK. The reason I suggested a chart was we are going to reorder the bones, and we need to know all the parent-child relationships. Your official source for the heirarchy is the CRES, and the tool to best work with it is SimPE.

After you have the chart done, you need to make a list similar to this:

duskel {none}
root_trans duskel
root_rot root_trans

never forward referenced, until you have all the bones listed. Now put the joints your MilkShape Ascii file in this order.

Your mesh, when imported, will have all the bone assignments wrong. The good news is that only matters as far as what the animation looks like in MilkShape, the game will use what is in the game packages, and we do not need to change those.

To make the Animesh exporter work properly, you will need to also manually make the PrelQuat comments from the values in the CRES. I believe the readme file explains the order differences between the game and MilkShape.

You will need to clear the assignments and remake them to see your animation correctly. But, if you move the bones and export the animation, even without the assigments, the exported file is supposed to work. The animation references are passed along via name, not order (while the GMDC is passed by order, without names).

If you can't get the bare skeleton to animate properly, then we have a default rotations issue that may take me some time to get around to looking at.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#79 Old 20th Mar 2008 at 3:57 AM Last edited by Kodiak : 20th Mar 2008 at 4:16 AM. Reason: Typo
Default Dog Joint Hierarchie
Alright, here's the LONG dog joint hierarchie list with a total of 75 joints in the format:
"child"
"parent"

###START###
"duskel"
""

"head_orient"
"duskel"

"root_trans"
"duskel"

"root_rot"
"root_trans"

"spine0"
"root_rot"

"spine1"
"spine0"

"breathe_bone_trans"
"spine1"

"spine2"
"spine1"

"r_shoulderoffset"
"spine2"

"r_shoulderblade_trans"
"r_shoulderoffset"

"r_clavicle"
"r_shoulderblade_trans"

"r_upperarm"
"r_clavicle"

"r_forearm"
"r_upperarm"

"r_hand"
"r_forearm"

"r_finger"
"r_hand"

"l_shoulderoffset"
"spine2"

"l_shoulderblade_trans"
"l_shoulderoffset"

"l_clavicle"
"l_shoulderblade_trans"

"l_upperarm"
"l_clavicle"

"l_forearm"
"l_upperarm"

"l_hand"
"l_forearm"

"l_finger"
"l_hand"

"neck0"
"spine2"

"neck1"
"neck0"

"head_fk"
"neck1"

"head"
"neck1"

"r_earbase_trans"
"head"

"r_upear0"
"r_earbase_trans"

"r_upear1"
"r_upear0"

"r_flopearoffset"
"r_earbase_trans"

"r_flopear0"
"r_flopearoffset"

"r_flopear1"
"r_flopear0"

"l_earbase_trans"
"head"

"l_upear0"
"l_earbase_trans"

"l_upear1"
"l_upear0"

"l_flopearoffset"
"l_earbase_trans"

"l_flopear0"
"l_flopearoffset"

"l_flopear1"
"l_flopear0"

"jaw"
"head"

"tonguebase_grip"
"jaw"

"tongue1_trans"
"tonguebase_grip"

"tongue1_rot"
"tongue1_trans"

"tongue2_rot"
"tongue1_rot"

"tongue3_rot"
"tongue2_rot"

"tongue4_rot"
"tongue3_rot"

"pelvis"
"spine0"

"r_thighoffset"
"pelvis"

"r_thigh_trans"
"r_thighoffset"

"r_thigh"
"r_thigh_trans"

"r_knee"
"r_thigh"

"r_calf"
"r_knee"

"r_foot"
"r_calf"

"r_toe"
"r_foot"

"l_thighoffset"
"pelvis"

"l_thigh_trans"
"l_thighoffset"

"l_thigh"
"l_thigh_trans"

"l_knee"
"l_thigh"

"l_calf"
"l_knee"

"l_foot"
"l_calf"

"l_toe"
"l_foot"

"wagpelvis"
"pelvis"

"tail0"
"wagpelvis"

"tail1"
"tail0"

"tail2"
"tail1"

"tail3"
"tail2"

"tail4"
"tail3"

"tail5"
"tail4"

"tail6"
"tail5"

"joint23"
""

"joint30"
""

"joint31"
""

"joint39"
""

"joint40"
""

"joint47"
""

"joint48"
""
###END###


I didn't know where to place the "jointXX"s bones (they are all at the end of the list for now) because I couldn't find them under the "CRES Hierarchie" tab in a CRES file view in SimPE. What are they and where should I place them?

After ordering that in the Milkshape Ascii, I still need the Quats, right? (Let's leave joint assignment last)

I don't really understand how to extract the Quat Values from SimPE even after reading your readme, Wes. And yes, Wes, you did an explicit explanation on the order differences between the game and MilkShape. But when I did a comparison with Dr Pixel's Man Mesh in Milkshape and the Man CRES file in SimPE, they don't match. Or at least I might be extracting the wrong values from SimPE. I was looking at duBody_cres>Content>cTransformNode and under light boxes Quaternion and Translation. Is that were I should be looking?
Alchemist
Original Poster
#80 Old 21st Mar 2008 at 1:43 AM
Yes, under Content. The values in SimPE for your du skeleton are the ones you want to use for the PRelQuat values. For both translations and rotations you negate X and swap Y and Z.

You will end up typing all those into the joint comments (or cutting and pasting, still awkward and time consuming). If those few joints have no names and their positions are skipped over in the heirarchy, then 0,0,0 for the position and 0,0,0,1 for the rotation ought to be OK. For quaternions, four zeroes are an impossible combination, and 0,0,0,1 is no rotation.

The values used in mesh files for MilkShape will not agree with the CRES values. The values in the GMDC are absolute positions with no heirarchy. Works for meshing but is unsuitable for animation. To make the animation work, the heirarchy needs to be setup, and the values are now parent relative. So the position for the head is an increment from the neck, spine1 is an increment from spine0, and so on.

This is all designed so that the calculations at runtime are easier and faster. It makes the tool design and use harder, but you model an object once, but if performance is poor because the game engine is more processor intensive, it will always be poor, no matter what the artist does.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#81 Old 21st Mar 2008 at 9:52 AM Last edited by Kodiak : 21st Mar 2008 at 9:59 AM.
Quote:
The values used in mesh files for MilkShape will not agree with the CRES values. The values in the GMDC are absolute positions with no heirarchy. Works for meshing but is unsuitable for animation. To make the animation work, the heirarchy needs to be setup, and the values are now parent relative. So the position for the head is an increment from the neck, spine1 is an increment from spine0, and so on.


Yes, what you were referring to from the quote above are the set of 3 position values found in the exported Milkshape 3D Ascii text file:

"child joint"
"parent joint"
8 ###HERE###
0
0

Right? What I was referring to are the set of 4 quaternion values plus 3 Translation values found in the comment in Milkshape or the "ImpQuatDat:" for each joint. With reference to Dr Pixel's Man Body Mesh which is ready for animation, the values from "ImpQuatDat:" do not agree with those in the CRES file viewed in SimPE after comparing each respective joint and applying the "Direct X and OpenGL" correction.

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Alchemist
Original Poster
#82 Old 21st Mar 2008 at 8:47 PM
Oh. OK.

The body meshes are handled seperately inside the animation exporter. They always have the same heirarchy, and I could do that. So internally, the ImpQuatDat: comments are converted to the values I need. That's why you see that difference on the body meshes.

Objects come with no standard skeleton... they are all different. Hence the use of the tools that reads the CRES and creates different PRelQuat: comments, as well as parenting all the joints.

It all falls apart when the parents are forward referenced. Besides the Pets skeletons, there are a few others. Some of the vehicles have this, some don't. The vehicles, though, have fewer joints to adjust.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#83 Old 21st Mar 2008 at 11:05 PM
By the way, what are PRelQuat values? I think I've been thinking PRelQuat values are the same as ImpQuartDat: values all this while.

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Alchemist
Original Poster
#84 Old 22nd Mar 2008 at 12:29 AM Last edited by wes_h : 22nd Mar 2008 at 12:35 AM.
When you run the CRES Importer plugin I made, it parses the CRES heirarchy and gets the name, parent information, position and default rotation of each true Joint. It then changes all the joint comments from ImpQuatDat: to PRelQuat: and inserts the new numbers, and reparents the joints and sets the appropriate position data fields.

The main reason for the name change is that the file, once prepared for animation, is incompatible with the UniMesh exporter. All this boils down to the fact that the joints in the GMDC and the joints in the CRES (the way they are used by the animation routines) are expressed in different ways, and none of the names or heirarchy information is available from the GMDC file.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#85 Old 22nd Mar 2008 at 1:07 AM
So since I can only import the GMDC. I have to manually do the work your CRES Importer does. Does that mean I have to change all the joint comments from "ImpQuatDat:" to "PRelQuat:" apart from just getting the Quart and Trans values from SimPE?

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Alchemist
Original Poster
#86 Old 22nd Mar 2008 at 2:30 AM
Yes. You can change the comment values in the MilkShape Ascii file, or at least you can use paste to change the comment tags faster than editing each comment individually.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#87 Old 22nd Mar 2008 at 3:16 AM
But when I changed the text "ImpQuatDat:" to "PRelQuat:" in the Ascii file, your AniMesh plugin will return an error saying quarternions not found in joint comments.

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Alchemist
Original Poster
#88 Old 22nd Mar 2008 at 4:39 AM
I have been working from memory, and like an old dog, it ain't as good as it once was. PRelQuatDat: is the proper tag to use - from the program notes for the anim exporter:

Quote: Originally posted by readme
Object meshes with joints replaced by the SkelTool use PRelQuatDat: in the joints comments, and these are different vales from the body meshes, and they will not export as a mesh. You need to save a MilkShape .ms3d file with just the imported object mesh if you expect to be needing to modify and reexport the mesh.


EDIT: The "vales" above is a typo in the original text, "values" is the correct word.

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#89 Old 22nd Mar 2008 at 4:49 AM
The Mesh Animation Template still results in distortion in game after producing a sample animation. Any ideas?

I found that I could produce a much better result if I use the original "ImpQuartDat:" values from the GMDC and not by replacing them with values from the CRES.

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Alchemist
Original Poster
#90 Old 27th Mar 2008 at 11:29 PM
I cruised by the downloads section today and saw that you had succeeded in overcoming the obstacles with you ninja dog candidates.

BTW, they are way too cute.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Lab Assistant
#91 Old 8th Apr 2008 at 2:01 AM
Hey Wes,

Well, there're still a few joints that do not work correctly. The ears and tongue mainly. Perhaps that's under facial expressions.

I've been wondering whether this problem with animation applies to Human Sims as well. When animating in Milkshape, especially when the animation involves the root_rot, while the animation turns to the correct direction (passing along the smaller angle), in game, it chooses to follow the larger angle, creating a quick spin in the opposite direction. I tried setting keyframes to all the frames between the two keyframes (specifying a small angle turn) which makes the quick opposite large angle spin, but the game still chooses a specific two frames to have it spin in the opposite direction. What's the best was to correct this?

If only we could deal with Inverse Kinematics and specify: "This is the path you should follow! Not choose the longer path!".

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Retired Duck
retired moderator
#92 Old 8th Apr 2008 at 6:22 AM
Kodiak - See "When my object is turning in a circle, it suddenly spins around in the opposite direction for no reason!" here - http://www.modthesims2.com/showthread.php?t=239168
Lab Assistant
#93 Old 8th Apr 2008 at 9:16 AM Last edited by Kodiak : 15th Apr 2008 at 3:09 AM.
Opps... Dear me! It's even a sticky! Sorry, Echo. Now I can assure you that I've read that thread a few times over but it never registered to me as my mind must have been too pre-occupied with other points in animation. Thanks for that write-up! It's really useful!


Edit: For those who are interested, I recommend using SimPE to make the adjustments for animations over 180 degrees angle. Just select root_rot and follow your the rotations on any of the axis (X,Y,Z) you are rotating your animation. They should gradually increase or decrease negatively or possitively. When you see a sudden large angle change from positive to negative and vice versa, just replace it with:

-(sign of value of sudden change)(360 - |value of sudden change|)

In words, use 360 and minus the modulus value of the sudden change and add a negative sign to that value if the original value is positive, leave as positive value if the original value is negative.

You have to do this for all the following values until your animation stop rotating on that axis.

Also note that if you want to continue rotating in circles, you can have values going beyond -360 and 360.

YouTube? Check out my channel: AlphaWolfKodi
Interested in Balto? Balto Home

"A bone to a dog is not charity. Charity is the bone shared with the dog, when you are just as hungry as the dog." -Jack London
Test Subject
#94 Old 23rd Apr 2008 at 1:33 PM
Default any tutorials for animesh?
Hello,

I've just started learning how to create sim animations and i'm a little lost. I've read through a stack of tutorials but since they all use the old animation exporter thing, i've had to kind of branch out on my own to figure things out.
At the moment, i don't think i have any problems with actually creating an animation. My problems seem to begin when using SimPE to get the animation into the game. My pie menu appears and the sim walks over to the object (like i instructed using BHAVs), but after that nothing happens - my custom animation doesnt run. At all.

Is there a tutorial or something floating around out there that can help me out, or do i have to wait a little while before one gets released?

Thanks in advance!
Alchemist
Original Poster
#95 Old 24th Apr 2008 at 12:28 AM
Quote: Originally posted by smileychick
I've read through a stack of tutorials but since they all use the old animation exporter thing, i've had to kind of branch out on my own to figure things out.


There is no old "animation exporter thing". Miche did release an animation converter.

It sounds like rather than a tutorial, you just need some help troubleshooting your creation. It could be that your new animation is not linked properly. All ANIM chunks need to be in group 0x1c0532fa, regardless of the group used for the rest of the object. You need to make sure you used 'Fix TGI' on the animation chunk for the current name, and that the name is properly linked in the proper STR#.

<* Wes *>

If you like to say what you think, be sure you know which to do first.
Retired Duck
retired moderator
#96 Old 24th Apr 2008 at 1:12 AM
Smileychick - Are you trying to create sim animations or object animations? There are tutorials, but it depends a bit on what you're trying to create.

The first thing I'd suggest is turning testing cheats on and seeing if you're getting any error messages.
Test Subject
#97 Old 24th Apr 2008 at 2:06 AM
Thanks guys! I figured out my problem. I wasn't pressing the fix TGI button. (I thought i had been...must have just dreamed i did). Now i know what i'm doing, I can start doing more complicated things. Thanks again!
Retired Duck
retired moderator
#98 Old 4th Nov 2008 at 3:21 AM
Hey Wes,

It's been a while, wonder if you could remind me... The animax importer prompts for *.anmdat files. When I decompile an animation, I get at least one of these but generally several. Is there a reason I can't import the ctl file and get all of them?
Lab Assistant
#99 Old 9th Nov 2008 at 11:30 PM
Okay, I ran into another problem(Is that all I'm good at?). After two succesful animations, I did a walking animation and during the animation my Sim's legs all of a sudden do a full rotation. It looked perfectly fine in Milkshape. Can someone help me?
Retired Duck
retired moderator
#100 Old 10th Nov 2008 at 2:13 AM
Chrizta - Take a look at point two: "When my object is turning in a circle, it suddenly spins around in the opposite direction for no reason!" here:
http://www.modthesims2.com/showthread.php?t=239168
Page 4 of 6
Back to top