Hey folks, got a small problem with some animations for a project we're working on. As it is now, we've got a few guns comprised of 80 odd separate parts, most of which animate using regular Max key-framing. We then used bones and skin modifiers for certain objects such as springs. The problem we're having is that in XNA it won't enable both regular Max key-framing and skinning using FBXs.
So a couple of solutions I've thought of included duplicating each object, converting it to a bone using the "Bone On" checker in Bone Tools and then adding a skin modifier to the original object and adding the duplicate as a bone. This will allow me to have a skinned object using a bone that has it's original animation.
Sounds kind of long winded I know, but it'd be easy to script and for the time spent on re-animating would be great. however, the only problem with this is that in XNA the new bone itself gives an error saying it has no skinning information. So it's obviously not acting like a "real" bone in XNA. I don't know how to get around this, is there a different way to convert geometry to a bone?
The only other thing I could think of is to create a bone for each object, link that bone to the object, and somehow copy the animation from the object to its' child. I don't know if that's even possible in Max (I don't do much animation). Then I'd be able to delete the original animation for the object, apple a skin and then add the bone.
Replies
Just make a script that steps through each frame on the timeline, samples the position/rotation of the source object at that time and sets the position/rotation of the bone to match.
Otherwise if you don't mind a manual step or two you can do this with max's XAF animation exporter (file > export animation) using the "key per frame" option. On import it'll let you make a remapping between the objects you exported from and the new export hierarchy in case the joint names need to be different or whatever.
the xaf import/export process can also be scripted once you have a process worked out if that makes it easier (i.e. if you're going to be doing this for every animation throughout your project)
Hope that helps a bit
I swore I'd seen some kind of nextKey function or something in MAXScript but now I can't find it. Any ideas?
Cheers for the help.
EDIT: I was closer than I thought, just found the getNextKeyTime function!
Double edit: Ok, so I just found the controller type, all is sorted. Thanks for the help again.