Hello. I'm trying to animate a model for the Spring engine, which for those that don't know handles animations on a piece-by-piece basis in code (it's
sliiightly outdated...). I've made an animation in 3dsmax, but I don't know how to get the rotations/translations (local axis) out per keyframe so I can use them in Spring's unit scripting system. Simply having the object selected with the rotation tool on the keyframe doesn't work, as the axis boxes at the bottom of the screen just display 0,0,0. Right clicking the keyframe can get them, but this is fiddly and time-consuming, whilst the curve editor doesn't give the precise rotations, and it doesn't seem to give in the local axis. I don't suppose there are any tools or plugins (or hell, a model format I could export to and open in Notepad++) that would export all this data at once, simply to make life easier?
This, incidentally, is the model in question:
(ignore the bird-running arms; I'll animate them later, once I have the walkscript working)
Any help, comments or advice welcome. Thanks for any help you can give!
Replies
also the use of 'in coordsys' command might be of use.
once you have an idea how to do those things in maxscript you'll be able to start to work it out.
good luck! any more qs ask again.
Current script is looking like this:
Need to figure out what the 'something!' should be. Pos? X/Y/Z tracks? Can I access that from a selected object? Long story short, I'm suspecting I've made a mistake or two somewhere...
u can use .pos for position I expect as I'm guessing the controllers are bog standard eulerXYZ?
as for angles, you get it from the object in a quaternion form IIRC and have to convert to euler and pull ut the bits you need.
Good luck!
I assume you will want to be working in parent space.
TrPos = in coordsys parent $.pos
TrRot = in coordsys parent $.rotation
You may need to use $.transform.pos and $.transform.rotation
Are you exporting bone animation data? Maxscript will also give you that information:
bone.position, bone.rotation. bone.transform gives you the position, rotation and scale as a matrix.
How do I get that for specific keyframes, though? I can get where the keyframes (.pos.controller.keys) are, and the values out of the first keyframe (.pos.controller.value), but that's as far as I've got. From as far as I can tell from the help files, you're meant to use something like .pos.controller.keys[key].value, but that just chucks up errors...