Game Development Community

import simple dsq animation for my dts model?

by Peter Mowry · in Torque 3D Professional · 05/21/2009 (6:58 am) · 9 replies

I had no problem doing this in the TGEA demo, but now for some reason I am having trouble getting it working for Torque 3D beta 1...

Any quick walk-through pointers for this simple/basic task would be appreciated?

I was trying to do this:

...

datablock StaticShapeData(EggRobot)
{
category = "AnimatedObjects";
shapeFile = "./EggRobot.dts";
sequence0 = "./EggRobot_Root.dsq Root";
sequence1 = "./EggRobot_WalkCycle.dsq WalkCycle";
};

Or this:

datablock TSShapeConstructor(EggRobotDts)
{
category = "AnimatedObjects";
baseShape = "./EggRobot.dts";
sequence0 = "./EggRobot_Root Root";
sequence1 = "./EggRobot_WalkCycle.dsq WalkCycle";
};

...

But it's still TSStatic :-(


#1
05/21/2009 (7:04 am)
okay I put up my post about 30 seconds too fast.

Turns out my problem was:

game/art/datablocks/datablockExec.cs:
exec("art/shapes/Egg_Robot/Torque_Files/EggRobot.cs");

I just had an incorrect path:
exec("art/shapes/players/Egg_Robot/Torque_Files/EggRobot.cs");

Oops... Hope this helps someone else tho :-)

#2
05/21/2009 (7:06 am)
so I don't actually have the animation playing yet, but at least now it's StaticShape rather than TSStatic
#3
05/21/2009 (7:15 am)
I name him theEgg, then in the ~ console I do:

theEgg.playThread(0, "Root");

but he doesn't animate :-(

#4
05/21/2009 (5:00 pm)
I actually got it working... Hope this helps someone :-)

datablock TSShapeConstructor(EggRobotDts)
{
baseShape = "./EggRobot.dts";
sequence0 = "./EggRobot_WalkCycle.dsq Sequence_WalkCycle";
sequence1 = "./EggRobot_Root.dsq Sequence_Root";
};

datablock StaticShapeData(EggRobot)
{
category = "Hero_RobotCommander";
shapeFile = "./EggRobot.dts";
};

function EggRobot::onAdd(%this, %obj)
{
//%obj.playThread(0, "Sequence_WalkCycle");
//%obj.playThread(1, "Sequence_Root");
}

function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}

#5
05/21/2009 (5:12 pm)
So you got it working by not declaring it start an animation when it spawns?
#6
05/21/2009 (5:21 pm)
Would you really want to use a dsq sequence for a staticshape? Wouldn't an embedded animation sequence be better?

But yeah, Steve points out an interesting conundrum.
#7
05/21/2009 (5:54 pm)
@Steve: I called playThread() in the ~ console... I guess the fix part was Sequence_ and/or (sequence0 goes in TSShapeConstructor, not StaticShapeData)

@Michael: Hmmm... Not really sure, I am new to torque... Embedded animation sequence eh, I wonder what this is... You mean embedded into the dts (that doesn't seem relevant)? To me, StaticShapeData is just what I saw in some torque animation posts/etc. So far the only ones I know about are StaticShapeData and TSStatic O:-)

#8
05/21/2009 (8:27 pm)
embedded animations are part of the dts file and animate that shape only, dsq files are animations that you can allocate to more than one model with the same nodes/joints.

characters use DSQs because you can and probably will have dozens of different characters but they all walk the same way. I'm not sure theres any real performance impact for using one style over another though, i believe its more of a workflow issue, using a single DSQ for multiple models decreases workload and error possibilities.
#9
05/23/2009 (3:21 pm)
Oh... I was actually using my DSQ animations for just 1 DTS model, such as:
* EggRobot.dts
* EggRobot_Root.dsq
* EggRobot_Walk.dsq
* EggRobot_Run.dsq
* EggRobot_Deploy.dsq

For example, EggRobot_Walk.dsq is only for EggRobot.dts.

Hopefully there is nothing wrong with that O:-)

Also, I guess maybe long-term something will be shared. Like EggRobot_02.dts or EggRobot_WithCrackedEgg.dts or something.