exporting animated 3ds max files via Collada into T3D
by Steve · in Artist Corner · 05/31/2009 (7:18 am) · 2 replies
I am using T3D. My artist is using 3ds max 2009. She exported an un-animated model (a gate, sort of) using the Collada exporter. I loaded it fine into T3D, no problems.
Now, she added an animation whereby the gate swings open and closed. Whenever I try to open this new .DAE file in T3D I get an "unhandled exception error". I get the option to debug in VS2008, and T3D crashes.
I know that I need to set up a datablock and an OnCreate function to get the animation to play. However, even if I did this incorrectly, should trying to import this .DAE file crash the whole game?
I don't know how to proceed. I have been trying to get this to work for about 2 days now, and the good news is I'm learning alot, lol. The bad news is, I can't get it to work. I know nothing about 3DMax. At this point, I am split 50 - 50 over whether the problem is in my T3D scripts or in something that needs to be set in 3DMax. Torsion detects no error in my scripts, but obviously, they may have logic errors.
I have searched the torque forums and I have not been able to find a step by step guide to writing the scripts necessary to get a .DAE animation to run. I can only find bits and pieces, and maybe of them were before the new Collada exporter. The closest I have come is Lara Engebretson's video, which I am told, is not up to date anymore. Can anyone find it in their heart to post an idiot's guide to creating these scripts? I am sure I could do it, if i just had a template to follow!
Also, can anyone please give me the basic minimum settings or a step by step guide to export via Collada the most basic animated object?
Here are the scripts I wrote:
in scripts/server/ I created gate.cs and put there:
datablock StaticShapeData(GateAnimated)
{
category = "AnimatedObjects";
shapeFile = "~/art/shapes/collada/New/GateAnimated.cached.dts";
};
function GateAnimated::onAdd(%this,%obj)
{
//%obj.playThread(0,"ambient");
}
function staticshapedata::create(%block)
{
%obj = new staticshape()
{
datablock = %block;
};
return(%obj);
}
and in server/scripts/game.cs :
exec("./gate.cs")
Thanks in advance for reading my post, and any help or even just pointing me to where I can figure this out for myself.
Now, she added an animation whereby the gate swings open and closed. Whenever I try to open this new .DAE file in T3D I get an "unhandled exception error". I get the option to debug in VS2008, and T3D crashes.
I know that I need to set up a datablock and an OnCreate function to get the animation to play. However, even if I did this incorrectly, should trying to import this .DAE file crash the whole game?
I don't know how to proceed. I have been trying to get this to work for about 2 days now, and the good news is I'm learning alot, lol. The bad news is, I can't get it to work. I know nothing about 3DMax. At this point, I am split 50 - 50 over whether the problem is in my T3D scripts or in something that needs to be set in 3DMax. Torsion detects no error in my scripts, but obviously, they may have logic errors.
I have searched the torque forums and I have not been able to find a step by step guide to writing the scripts necessary to get a .DAE animation to run. I can only find bits and pieces, and maybe of them were before the new Collada exporter. The closest I have come is Lara Engebretson's video, which I am told, is not up to date anymore. Can anyone find it in their heart to post an idiot's guide to creating these scripts? I am sure I could do it, if i just had a template to follow!
Also, can anyone please give me the basic minimum settings or a step by step guide to export via Collada the most basic animated object?
Here are the scripts I wrote:
in scripts/server/ I created gate.cs and put there:
datablock StaticShapeData(GateAnimated)
{
category = "AnimatedObjects";
shapeFile = "~/art/shapes/collada/New/GateAnimated.cached.dts";
};
function GateAnimated::onAdd(%this,%obj)
{
//%obj.playThread(0,"ambient");
}
function staticshapedata::create(%block)
{
%obj = new staticshape()
{
datablock = %block;
};
return(%obj);
}
and in server/scripts/game.cs :
exec("./gate.cs")
Thanks in advance for reading my post, and any help or even just pointing me to where I can figure this out for myself.
Torque Owner Joe Melton
Fails At Making Games