Game Development Community

TSShapeConstructor not working for .cached.DTS

by Ivan Mandzhukov · in Torque 3D Professional · 11/08/2009 (7:17 am) · 2 replies

guys,
I have this problem: I have setup my model to use DAE and its animations work flawlessly.
But when I decided to change everything to use the cached DTS file instead of DAE animations stopped working.

For clarification these are the objects datablock and its *.cs file with the ShapeConstructor with DAE (that works) :

datablock StaticShapeData(MyShape)
{
   category = "MyShape";
   shapeFile = "art/shapes/myShape/myShape.DAE";
};

//in the myShape.cs:
//--- OBJECT WRITE BEGIN ---
function myShapeDAE::onLoad(%this)
{
   %this.addSequence("AnimationClip", "root", 0, 25);
   %this.setSequenceCyclic("root", "1");
}

singleton TSShapeConstructor(myShapeDAE)
{
   baseShape = "art/shapes/myShape/myShape.DAE";
   upAxis = "DEFAULT";
   unit = "-1";
   lodType = "DetectDTS";
   singleDetailSize = "2";
   ignoreNodeScale = "0";
   adjustCenter = "0";
   adjustFloor = "0";
   forceUpdateMaterials = "0";
   canSaveDynamicFields = "1";
};
//--- OBJECT WRITE END ---

And these are the changed files to use the cached DTS file:

datablock StaticShapeData(MyShape)
{
   category = "MyShape";
   shapeFile = "art/shapes/myShape/myShape.cached.dts";
};

//in the myShape.cs:
//--- OBJECT WRITE BEGIN ---
function myShapeDAE::onLoad(%this)
{
   %this.addSequence("AnimationClip", "root", 0, 25);
   %this.setSequenceCyclic("root", "1");
}

singleton TSShapeConstructor(myShapeDAE)
{
   baseShape = "art/shapes/myShape/myShape.cached.dts";
   upAxis = "DEFAULT";
   unit = "-1";
   lodType = "DetectDTS";
   singleDetailSize = "2";
   ignoreNodeScale = "0";
   adjustCenter = "0";
   adjustFloor = "0";
   forceUpdateMaterials = "0";
   canSaveDynamicFields = "1";
};
//--- OBJECT WRITE END ---

#1
11/08/2009 (1:54 pm)
Have you tried renaming the .cached.dts to a .dts and loading it through there? Maybe the double dots are causing an issue someplace. I've been able to use TSShapeConstructor fine on DTS shapes in the past, only issue I've noticed was that saveshape causes it to crash.
#2
11/08/2009 (2:04 pm)
@J.C.Smith

Thanks for the answer.
Actually i solved this earlier today:

baseShape = "art/shapes/myShape/myShape.cached.dts";

should be replaced with:

baseShape = "art/shapes/myShape/myShape.dae";

then delete the *.dae file
Collada loader will see that the *.dae is missing and all will work the same for the cached.dts