Call for XSI test models

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

The bones themselves aren't animated, only the effectors. The "up vectors" (those four nulls above the model which only keeps the leg curved downward) is parented by the leg root and arenot animated. The only animation I encoded in the walk clip is on the ankle/foot effectors - their curves can be seen in the "Walk_Guides" layer. So I really don't understand what you just said. Is my model save wrong or something?

EDIT: The head has a little bob to it too, but that's on an effector too.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Well, according to the action sources, the odd bone has keyframes (Leg_Root2 and Leg_Root3, but not the other 2, Foot_Bone but none of the other feet), and lots of effectors and up vectors. Just right-click Mixer > Sources > Animation > Walk and select Animation Editor to see what I mean. The entries in there are the only things that have keyframes associated with them.

My problem is that whilst you're animating the effector (or the upvector, although I accept you don't appear to have animated that intentionally), there seems to be no record at all of the actual effect that has on the bone. So it looks like to pull the information out reliably, I'd have to turn the animation of effectors into animation of the bones themselves, somehow. I have no idea how to do that - it's not a simple case of the effector being a parent - it's the fact that the bones it affects in the same chain appear not to be keyframed. I'm sure this is because XSI just calculates the IK on the fly - but for export to OGRE, it has to be turned into FK. When I've been doing simple testing I've been using FK so my bones were keyframed, and everything worked fine of course.
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

I'm beginning to see what you mean, but an awful lot of those values are flat.. except the effectors path animations. Which I now notice isn't reflected in the effector's actual positions over time.

Instead, they are in different keys
eff(number)_pathcns_perc holds the animation while eff(same number)_pos(x, y z) has nothing. Maybe your exporter can't see the curves used for IK? (Or a myriad of other things)

I wonder if it's possible to build a FK/Keyframed animation from the curve animation? As long as it encodes the bones positions, would that work? (I'll try anyway.)
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

Aha, I may have it. When I stored the animation, I marked the effectors, making it a IK, not FK - but stored them all in the animation. It'll take a few minutes to correct - I apologize for the wasted time.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Most FK animation is bone rotation. Unless the bones change length, bone positions never change.

I can see all the tracks, eff(number)_pathcns_perc included. I just haven't got the foggiest idea what to do with them. Getting to the data that's there is easy enough, interpreting it into what I need (bone FK animation) is bloody difficult :evil: Even if I could write an IK solver into my exporter, the keyframes that are added to the effectors probably aren't optimal for FK animation. A fixed sampling is an option I suppose, although it's a bit of a blunt instrument. I'd be really interested to know if XSI can do this itself (and I note that if you CTRL-R on a bone, you get some IK vs FK settings, but I'm not sure what they do).
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

zarthrag wrote:Aha, I may have it. When I stored the animation, I marked the effectors, making it a IK, not FK - but stored them all in the animation. It'll take a few minutes to correct - I apologize for the wasted time.
Ah, ok - no problem, it's good to understand these things (of a sort). Can you explain in a bit more detail what the difference in steps is? This is the kind of thing I'll need to put in the docs, if it does solve it.
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

Ok Sinbad, I got it! If you (EDIT: animate) an effector, you *must* change it to FK to key. What happens is that while the bones are rotated, you can't simply "peek" at the current rotation value at a particular frame, which is what I thought you were doing. Worse yet, since it's a loop, it may well be what caused the animation to appear to be doing nothing. SetKey (K) doesn't work, nor can you use the marked parameters.

To key the bones directly, yet still enjoy the ease of curve/IK animation in XSI, or whatever method floats your boat:

1.) simply build your animation so it looks "the way you want."

2.) Select all of the bones in your animation.

3.) To keyframe your finished product: In "animation" mode, select "Create > Skeleton > Key All Bone Rotations" for for each keyframe (As this happens, you can watch the animation editor start to store the values) On the scuttlepod, it (mostly) works with a Key every 5th frame.

4.) If problems show up, tweak them out manually. (My scuttlepod like to "highstep" a little for a split second, but it has done that before.)

If you can call this pragmatically, you could make the exportor do the conversion (but it isn't hard to do by hand once you figure it out.)

the script command to make the keys is:

Code: Select all

KeyAllBoneRotations "bone,Thigh_Bone,Shin_Bone,Foot_Bone,Thigh_Bone1,Shin_Bone1,Foot_Bone1,Thigh_Bone2,Shin_Bone2,Foot_Bone2,bone1,Thigh_Bone3,Shin_Bone3,Foot_Bone3"
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

I'm still having trouble getting the FK to store into a clip however, it keeps telling me there is nothing to store.
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

Doh! I was mis-marking the parameters (I like to click the radios instead of the text...)

I'm emailing a new model with both the FKWalk and IKWalk animations. The process above applies to derive one from the other (IK->FK).

EDIT: Quesion: Do I need to animate/key the positions of feet separately, or is that still an issue?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Thanks, I'll take a look. Yeah, baking FK keyframes on all bones on a sample frequency (you mentioned every 5 frames) is something I was thinking of putting in the exporter. I'm not quite sure how to get XSI to do it, but your comments will certainly help. What I want to do is not necessarily create XSI keyframes, but to 'play back' your IK animation and sample the state of the bones at those points. If I can't do that, I might need to just work out how to create a FK source for each IK source, use the keyframe baking, export those, then delete the source again (so as not to clutter up your scene).

Provided I can figure out how to do this, that will mean an extra 2 fields on each animation source in the exporter, a checkbox to indicate that a sampling approach is required rather than direct keyframe reads, and the sampling frequency required. You could also manually FK the bones and uncheck the sampling box. I hope. :?

Thanks for all you help with this, it's really been invaluable.

As for the feet, so long as all the bones are keyframed everything should be ok. Typically the last useful bone is on the last model joint and not at the tip (which is kinda why the effector is nice, since it provides a visual cue to the direction / size of the final bone without actually requiring an extra bone at the end).
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Yes, this is a lot better, thanks. The animation still doesn't play quite right, but the result is a lot, lot better, I think I just have a transform issue somewhere. I have a couple of practical questions if you don't mind, I don't have a lot of time to experiment with the interface so it would be really useful to get some tips:

1. Oddly, I can't get the FK version to play in XSI, but I'm probably doing something wrong. To put the current animation setup into a source, you to Actions > Store > (whatever), but when I try to do the reverse, which I think is Actions > Apply > Paste Action.. or Actions > Apply > Action, it doesn't seem to work. If I paste the FK action I just get a strangely twitching scuttlepod. I'm sure I'm doing something wrong, any tips? Maybe I'm just not supposed to try to apply FK becuause of the way the bones are already rigged.

2. Is there a quick way to clear all the current working animation? Leaving it ready to apply a new animation.

3. If I wanted to try to generate this FK sequence, starting from the IK sequence you sent me earlier, I assume the steps are to clear the current animation, paste in the IK action into the current, then move the timeline according to the sampling frequency, creating keyframes on the bones as you described in your previous post. I think I can do that in code, provided I understand how to do 1 and 2, which sound simple but for some reason elude me.

Thanks :)
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

Eww, it looks like it didn't save properly - looks like the problem is on my end still. I'm getting the same twitch. I'll get right on that, it looks like I must have missed a marking or something. Shouldn't take long.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Thanks, I just made up my own little IK test and created a second FK source based on it, and everything worked fine so I'm glad, in a way :)
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

Thanks, cuz I'm gonna start over on this scuttlepod later, it's been a learning experience, I'll leave it at that. It turns out I mis-marked the parameters (again) and they were diminished because I didn't remove the constraint to the curves I had earlier. I redid the procedure above again, removed the curve constraints, and then tested the result in the mixer - worked like a charm.

To answer your questions:

1. I use the mixer for testing, it's for final renders, but it's good to see how they'll mix in ogre by turning on linear intrepetation/mixing. You did it correctly I suspect, the FKWalk was just borked (again).

2. From the docs:
# Select the object or mark the parameters from which you want to remove animation.
# From the Animation panel, choose Animation > Remove Animation and one of these commands:



* Choose from Marked Parameters to remove all keys from the selected objects’ marked parameters.
* Choose from Transforms to remove all scaling, rotation, and translation parameters of the selected objects. You can also choose to remove each of these types of transformations individually (X, Y, and Z parameters for each type) with their appropriate commands.
* Choose from All Parameters, Any Animation Type to remove all animation from all parameters on selected objects.
* Choose from Objects, Constraints to remove all constraints from the selected objects. You can also use the Constrain > Remove All Constraints command on the Constrain panel to do this.
* Choose from All Parameters, Expressions to remove only expressions from all parameters on selected objects. Choose from All Parameters, Fcurves to do the same for only fcurves, or from All Parameters, Scripted Operators to do the same for only scripted operators.
3. To "autogenerate" the FK procedurally - I'd reccommend.:

Code: Select all

1. Store the IK in an action, just in case something goes wrong. When storing, opt to "cut" the animation(it does by default), and make sure it no longer plays.

2.  Apply the IK in the animation mixer at frame 1. (play to make sure it works)

3.  Properly mark the parameters you wish to keyframe:
* press Clr on the animation bar (bottom right of the screen)
* Select all bones.

* Press ctrl-k to bring up the transformation properties

* Mark the bone rotations for keying by shift-clicking on X, Y, and Z under "bone rotations" (I always click the little radio button, DONT DO THAT, click the *name*)

* Press Ctrl-Shift-M to create the marking set.

4. Mark each keyframe in your animation by simply pressing K

5. Remove the original IK animation from the mixer. Press play, your FK should be working now.

6. Action->Store->Marked Parameters - All Animation or Current Values (THIS IS IMPORTANT: Be sure to select "Copy/Cut Keys" and not FCurves - which is the default, sadly.)

7.  Pressing play should yield nothing now (again).  Add the FK to the mixer to make sure it works.

8. Take a nap.
[EDIT] If you'd like I could email the verified one for you to try, but sounds like you've got it working.
Bill
Gremlin
Posts: 167
Joined: Sun Sep 26, 2004 11:50 pm
Location: Arkansas

Post by Bill »

sinbad wrote: I can't see any other way of doing this without going absolutely spare - I've been trawling about inside XSI's animation internals for several days now and feel like I'm getting nowhere
I feel your pain. :-)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

@zarthrag: Thanks for the tips. Please do send your updated model to me anyway, it can't hurt, although I'm planning on going back to your original IK-only model and seeing if I can auto-sample from that anyway.

@Bill: I feel like I'm dragging myself out of a dark tunnel at last. At first, I thought I understood XSI animation (and your code helped speed that initial learning up a lot in that, btw), but what I didn't understand was the typical artist process, which created something different to what I was expecting and left me floundering in the dark for a while! Now thanks to zarthrag I finally think I understand how most of it fits together, and how to map it onto what I need.

Thanks for everyone's help! More test models are always welcome but I think the major issues have now been bottomed out. Hopefully this will all be finished by the end of the weekend.
Bill
Gremlin
Posts: 167
Joined: Sun Sep 26, 2004 11:50 pm
Location: Arkansas

Post by Bill »

sinbad wrote: I'm planning on going back to your original IK-only model and seeing if I can auto-sample from that anyway.
I think this is a good idea. I have been tempted to do the same thing. It would make a big skeleton file, but but would fix a lot of the inconsistancies between Ogre and XSI.


Also, here is a couple of things to do when your testing your skeleton exporter. Try changing the length of the bones after they are attached to the structure. And try rotating/translating some of the objects that are under the control of the bones. (They won't actually rotate/translate after they are under control of a bone in XSI, but their parameters will change.)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Bill wrote:
sinbad wrote: I'm planning on going back to your original IK-only model and seeing if I can auto-sample from that anyway.
I think this is a good idea. I have been tempted to do the same thing. It would make a big skeleton file, but but would fix a lot of the inconsistancies between Ogre and XSI.
Yeah, I want to make it an option; if the artist wants to create the most efficient, tweaked animation they should manually FK it, but for speed uniform sampling could be good.
Also, here is a couple of things to do when your testing your skeleton exporter. Try changing the length of the bones after they are attached to the structure. And try rotating/translating some of the objects that are under the control of the bones. (They won't actually rotate/translate after they are under control of a bone in XSI, but their parameters will change.)
Thanks, I still have screwed up animation on the scuttlepod so I've clearly missed a transform step somewhere. I'll carry on playing.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Finally fixed the last of my problems with the scuttlepod :)
Image

I'm not sure if I'll add the IK->FK sampler, since it's really easy to FK the animation yourself and that allows much more control over the keying. I do want to clean up a couple of bits, and perhaps try to squeeze in a material export based on Bill's work too.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

And here's a preview release for anyone running XSI who wants to try it out:

http://prdownloads.sourceforge.net/ogre ... e?download
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

Here is part of what I get when trying a quick model:

Code: Select all

SelectObj "base", , True
'INFO : OGRE Exporter Version 1.0.1
SetValue "OgreMeshExportOptions.targetMeshFileName", "C:\Files\OGRE_meshes\Tanks.Treads1.base.mesh"
'INFO : ** Begin OGRE Mesh Export **
'INFO : -- Traversing base
'INFO : -- Queueing base
'FATAL : Invalid base type
'INFO : An exception has been thrown!
'
'-----------------------------------
'Details:
'-----------------------------------
'Error #: 4
'Function: VertexElement::multiplyTypeCount
'Description: Invalid base type. 
'File: \Projects\OgreCVS\Branches\Azathoth\ogrenew\OgreMain\src\OgreHardwareVertexBuffer.cpp
'Line: 176
'Stack unwinding: <<beginning of stack>>
'INFO : OGRE Exporter Version 1.0.1
SetValue "OgreMeshExportOptions.exportChildren", False
'INFO : ** Begin OGRE Mesh Export **
'INFO : -- Traversing base
'INFO : -- Queueing base
'FATAL : Invalid base type
'INFO : An exception has been thrown!
I'll see if I can work out what it is.

edit: two other objects in the scene seem to work just fine.

2nd edit: After playing around with texturing I think I got it to work by removing additional clusters that I didn't really need any more. Not 100% sure that was it but it works now.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

Hmm, that's an odd one. If you have the original model, can you send it to me and I'll see if I can trace what it didn't like.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

I didn't keep the older version of the model. It does work now though. It did export using Bill's exporter at that stage.

I'll let you know if I do something to create a problem again. I think it was the cluster groups because I didn't change much else.

When you get to a point that you're comfortable with the progress (maybe now) could you post some instructions on how best to get a basic animation exported?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

When you get to a point that you're comfortable with the progress (maybe now) could you post some instructions on how best to get a basic animation exported?
I tried to cover that in the docs that come with the exporter - let me know if it's too vague.
Slicky
Bronze Sponsor
Bronze Sponsor
Posts: 614
Joined: Mon Apr 14, 2003 11:48 pm
Location: Was LA now France
x 26

Post by Slicky »

Ok worked through the docs and I have a basic test model exported and the animation names show up in meshviewer. However, there is no movement.

There are lots of options under animate|actions|store. I tried various to see if that was it.

Here is a test model. Linky
Post Reply