PDA

View Full Version : Batch exporting an anim frame by frame?


drgonzo62
12-17-2007, 04:38 PM
Hi!

I'm looking for a script that allows me to export an anim frame by frame to individual 3DS
files, since the game engine I'm having to deal with requires this procedure. Suck..
Haven't had a need to do any scripting in max so far, I could use some help here.

I need a script that goes through every frame of an anim sequence and exports it as a
separate 3DS file, preferably with incrementing frame numbers (walk_01.3ds, walk_02.3ds).

Does anyone know of a script out there that I can adapt to my needs? I'm facing a deadline
and doing this procedure by hand would definitely blow that one.

Thanks!
(Running max 08)

drgonzo62
12-18-2007, 06:12 PM
Well.. who knew that this was THAT difficult..

RustyKnight
12-18-2007, 10:00 PM
Well.. who knew that this was THAT difficult..It's not, it's just tedious.

My immediate thought is that you can't simply skip to the next frame and say "hay save me as a file!"...because it will save EVERYTHING in the current scene - the whole animation.

My next thought would be to save the animation out into an XML file - via Save Animation and, using a default rig file, load the animation back in frame by frame, saving each sequence out as you go - making sure you reload the default rig each time...

But the question is how...

You will want to look at the LoadSaveAnimation interface from the docs.

This will allow you to save the animation in "segments" - ie by frame and the load each of those frames back into your master file, which can then be exported out into their individual 3ds files.

That's my idea...if all that sounds to hard, you have three options. 1. Look at ScriptSpot.com in hope someone else has had your problem; 2. Do it manually; 3. Pay some one to do it for you.

Shane

Rick Stirling
12-18-2007, 11:21 PM
Is this a commercial venture or just a hobby project? If this is a commercial venture, I'd strongly suggest looking at your tools pipeline.

Anyway, i'n not sure exactly what it is that you want to export - it sounds a bit like you are exporting vertex data. In that case you'd want to collapse your animated object on a per frame basis.

drgonzo62
12-19-2007, 05:43 AM
It's not, it's just tedious.
Thanks Shane.

I probably didn't explain my goals too well. I needed to export a character anim to
3DS files. That's all.
It took me about an hour this morning to figure out the script to this, so now I'm a bit
embarrassed for even asking for help on this..

This was all I needed:

for t = first_frame to last_frame do
(
sliderTime = t -- sequence time (given as frames)
filename = prefix + a as string + ".3ds"
exportFile filename #noPrompt selectedOnly:true
a = a + 1
)

RustyKnight
12-19-2007, 06:03 AM
Thanks Shane.

I probably didn't explain my goals too well. I needed to export a character anim to
3DS files. That's all.
It took me about an hour this morning to figure out the script to this, so now I'm a bit
embarrassed for even asking for help on this..

This was all I needed:

for t = first_frame to last_frame do
(
sliderTime = t -- sequence time (given as frames)
filename = prefix + a as string + ".3ds"
exportFile filename #noPrompt selectedOnly:true
a = a + 1
)I'm not sure if that would work...that was my first idea, but I would think that it will save out the "entire" scene, not just the current frame...now I could be wrong, but so long as you have checked the output and are happy with it, then you should be okay

Shane

drgonzo62
12-19-2007, 02:40 PM
I'm not sure if that would work...
Yeah, it's working fine.
The character is the only object in the scene and the environment will be created in the
game engine. During import into the engine, the individual 3DS files are combined into
a regular vertex animation.
This was the only way I could figure out to get a biped/morpher anim into that
engine, since it supports either or, but not both anim methods at the same time.. :rolleyes:

CGTalk Moderation
12-19-2007, 02:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.