Game Development Community

Help exporting a skinned animation from MAX 5.1

by Joseph England · in Torque Game Engine Advanced · 07/06/2004 (12:33 pm) · 5 replies

Hey all,

I've been trying unsuccessfully for a while now to get animation from a simple skinned mesh to export from MAX. I keep getting various errors as I fiddle with the setup, so I was kind of hoping for some input as to what I am doing wrong. I think it may have to do with how I have the setup linked, but I'll just outline all the steps I took here just in case. This was to create a simple tube that would bend slightly then return to initial position over 30 frames.

1: I created the tube in the top viewport and moved it to center (0,0,0) using the transform tools. I made it's name crap5.

2: I used Reset XForm on the tube.

3: I aligned the pivot of the tube to the world, so that it had proper XYZ alignment.

4: I put a UVW modifier on the stack for the tube.

5: I created a bounding box named "bounds" around the tube.

6: I created 2 bones inside the tube... a main bone and the nub. These two bones are linked and were created with the bone tools... no funky objects with the bone flag set.

7: I put a skin modifier on the mesh, added the bones, and made sure the envelopes encompassed all of the verticies in the tube mesh.

8: I created a detail5 dummy and moved it to position 0,0,0 using the transform tools.

9: I created a sequence helper object and set begin and end keys at 0 and 30 using the dope sheet.

10: I set keys for the default position of the nub bone, which I intended to use for the animation.

11: I moved to frame 15 and relocated the nub bone slightly to one side, making sure it stayed in the bounds box, and set the new keys. The animation appeared correctly in MAX.

12. I then simply copied the keys from from frame 0 to frame 30. The mesh moved as I expected in MAX... from default position, to the side and back again.

13: At this point I tried an export and got the error "Assertion failed on skin object". I looked in the code to see where this is coming from and it is the result of empty subtrees, which I am guessing means the linkage heirachy is messed up somehow. Note that when I tried this export that the only linking in the model was between the two individual bones.

What am I doing wrong? I've tried linking this thing up in all sorts of different ways, but nothing is working. I'm kinda frustrated since everything else I've tried has worked easily... Including exporting animation from non-skinned objects. It's probably something easy I know, but I can't figure out what it is.

TIA, J

#1
07/06/2004 (2:36 pm)
Try a setup like so:

base01 -(dummy)
..|
..--deatil_128 -(dummy)
..|
..-shape01 -(dummy)
.....|
.....- Your bones


YourSkinMesh128
YourSequenceMarker -(dts sequence helper object)


You need to specify a detail marker and tag the desired mesh with it's number, otherwise the exporter will not find anything to export. Leave the skinMesh and sequence object unLinked, but link your bones to a dummy called shape and link that to one called base (the names aren't hardcoded, but the naming convention can help you remember what goes where). And of course the detail dummy needs to be linked to the root object, in this case the one named base.
#2
07/06/2004 (2:42 pm)
Did you create the "base" dummy and link you detail markers and start dummies to it? plus have your mesh linked to the start dummy?

See image here.
#3
07/06/2004 (4:28 pm)
Thanks for the replies.

I setup the mesh I outlined above like Martin suggested.

base01 -> detail5
       -> shape01 -> bone01 -> bone02

crap5
sequence1
bounds

And now MAX crashes to desktop without an error. :) Well, at least it is something different.

I didn't really understand Alex's post... do I have to have another copy of the mesh *without* the skin in the hierarchy too? Linking the skinned mesh into the hierarchy gives an error telling me it must be unlinked. I can send someone the MAX file if they want to see it. Or if someone can set a simple working one up and EMAIL it to me at darkheron@alltel.net that might help too.

EDIT: Uh oh. I think my current crash may be related to memory allocation incompatabilities between the MAX 5.1 libraries and the memory allocation performed by VC .NET 2002. I was able to thwart these problems when I wrote an importer/exporter for Savage by using the Max_Mem.h headers, but I'm not sure if it is going to be possible because of the memory manager defined in platform.h. This is looking ugly. ... Unless I am still doing something fundamentally wrong that is hosing the export.

Thanks again, J
#4
07/07/2004 (2:07 pm)
First a note on the exporterd and max 5.1. The exporter for version four works just fine for 5.1, with one cavet; you must use the multires plugin from version 4, if you are going to be exporting with it applied. though you will find that it doesn't take much time to use the ver5 multiRes to generate multiple LOD meshes (each collapsed so it is lower poly and does not contain the multires modifier).

It sounds like your problem is with your particular exporter. to see, grab this file and see if it exports:

www.mechina.com/simpleskin.zip

This shows a complete skin mesh setup, albeit a rather simple one. I also included the setup for multires, which you might want to remove for your first test. To do so, simply delete the mesh named multires::simpleShape, delete two of the detail markers and append the proper number onto the name of the SimpleShape mesh. (I'm not trying to insult your intellegence or anything, just want to be clear on what I'm saying).

You will notice I used dummy boxes instead of actual bones objects. The skin modifier does not care if it's a bone, dummy or whatever you have the guts to try, so you don't need to redo your skeleton to use dummies. The other thing you will notice is that I have one big dummy which houses all the verts of the mesh, that's because I'm lazy and it's the fastest way to avoid the exporter error of having un weighted verts.

Give this one a try, if you can't get it to export then you should try a different verison of the exporter.
#5
07/07/2004 (4:50 pm)
Martin,

Thanks for all your help. The file you provided could not be opened correctly by MAX though. It claimed it was corrupted. Maybe you have a different version from my 5.1 or something. At any rate, it did make a "recovered" version of your file with enough of the objects left that I could verify my hierachy was right. The good news is I solved my problem. I feel pretty dumb, but since I'm a newbie I'm not gonna linger on it. :)

Here is what happened... basically, since I am so new to Torque, I started from scratch with the tutorials, and walked through them one by one to get a full understanding of how the exporting should work. Everything was fine until the skin tutorial / documentation. I was assuming that the skin scene / hierarchy setup was based on the setups provided for the simpler scenes... so basically, I set my meshes and bones up just like you would for a simple object... IE linked into the hierarchy just like a simple mesh. Then, because the documents said you should create a seperate file for each animation, and that you should delete the mesh to avoid errors, I believed that I should create a new file and XREF in all the objects that were required from the master file, unlink the mesh, and skin and animate it from there. So basically, I was using a shape that was exported from the "master" file and trying to apply my sequenced animations from the "animation" file. It was only out of pure frustation that I smacked on the Export->Whole Shape button from my animation file in a desperate attempt to fix things. Well, of course it worked. :) Now, I understand, after about two days of messing with this crap that *the hierachical format for SKINNED meshes REPLACES the format for simple meshes.... does not work in CONJUNCTION with it* heh. Like I say, I feel pretty dumb, but I'll get over it.

As for the MAX CTD I was having... I wasn't using the multires modifier at the time, so that was not it. I loaded up VC.NET and debuged the suspect export through MAX and discovered that it was dying on a legitimate free command inside the ObjectMimic destructor. I poked around a bit and I'm pretty sure it had to do with the memory incompatabilities between the MAX libs and my compiler. I made a half hearted attempt to include the MAX_Mem.h into the exporter source, but it was going to be problematic. I eventually just went over to a friends workstation that had VC6 on it and compiled from there. Seemed to fix the problem.

Anyway, thanks again, J