Torque3D Documentation / _generateds / tsShapeConstruct.cpp

tsShapeConstruct.cpp

Engine/source/ts/tsShapeConstruct.cpp

More...

Public Defines

define
CHECK_INDEX_IN_RANGE(func, index, maxIndex, ret)     ( ( index < 0 ) || ( index >= maxIndex ) )                     \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": index out of "    \
         "range (0-%d)", maxIndex-1);                                \
      return ret;                                                    \
   }
define
GET_MESH(func, var, name, ret)    * var = mShape->findMesh(name);                             \
    (!var)                                                         \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "mesh '%s'", name);                                         \
      return ret;                                                    \
   }
define
GET_NODE_INDEX_ALLOW_ROOT(func, var, name, ret)     var##Index = -1;                                              \
    (name[0])                                                      \
   {                                                                 \
      var##Index = mShape->findNode(name);                           \
       (var##Index < 0)                                            \
      {                                                              \
         ( "TSShapeConstructor::" #func ": Could not "    \
            "find node '%s'", name);                                 \
         return ret;                                                 \
      }                                                              \
   }                                                                 \
   * var = var##Index < 0 ?  : &(mShape->nodes[var##Index]); \
   (var##Index);                                        \
   (var)
define
GET_NODE_INDEX_NO_ROOT(func, var, name, ret)     var##Index = mShape->findNode(name);                          \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "node '%s'", name);                                         \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->nodes[var##Index]);                \
   (var##Index);                                        \
   (var)
define
GET_OBJECT(func, var, name, ret)     var##Index = mShape->findObject(name);                        \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "object '%s'", name);                                       \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->objects[var##Index]);            \
   (var##Index);                                        \
   (var)
define
GET_SEQUENCE(func, var, name, ret)     var##Index = mShape->findSequence(name);                      \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "sequence named '%s'", name);                               \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->sequences[var##Index]);        \
   (var##Index);                                        \
   (var);
define
define
RETURN_IF_MATCH(type)  (!(name, #type)) return Cmd##type

Public Variables

Called when the DTS or DAE resource is flushed from memory Not normally

Public Functions

ConsoleDocClass(TSShapeConstructor , "@brief An object used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DTS or COLLADA shape model after it has " "been loaded by <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Torque\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )
TiXmlElement *
createNodeWithText(const char * name, const char * text)
DefineTSShapeConstructorMethod(addImposter , S32 , (S32 size, S32 equatorSteps, S32 polarSteps, S32 dl, S32 dim, bool includePoles, F32 polarAngle) , (size, equatorSteps, polarSteps, dl, dim, includePoles, polarAngle) , - 1, "Add (or edit) an imposter detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "If the shape already contains an imposter detail level, this command will " "simply change the imposter <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">settings\n</a>" " @param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the imposter detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @param equatorSteps defines the number of snapshots <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> take around the " "equator. Imagine the object being rotated around the vertical axis, then " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> snapshot taken at regularly spaced <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">intervals.\n</a>" " @param polarSteps defines the number of snapshots taken between the poles " " , at each equator step. eg. At each equator snapshot, " "snapshots are taken at regular intervals between the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">poles.\n</a>" " @param dl the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use when generating the snapshots. Note that " "this is an array index rather than <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail size. So <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> an object has detail " "sizes of:200 , 150 , and 40, then setting @<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dl <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 1 will generate the snapshots " "using detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> 150.\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @param dim defines the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the imposter images in pixels. The larger the " " number, the more detailed the billboard will <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">be.\n</a>" " @param includePoles flag indicating whether <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> include the \"pole\" snapshots. " "ie. the views from the top and bottom of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@param polar_angle <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> pole snapshots are active  , this " "parameter defines the camera angle(in degrees) within which <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> the " "pole snapshot. eg. <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> polar_angle is set <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 25 degrees, then the snapshot " "taken at the pole(looking directly down or up at the object) will be rendered " "when the camera is within 25 degrees of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pole.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addImposter(2, 4, 0, 0, 64, false, 0);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.addImposter(2, 4, 2, 0, 64, true, 10);//this command would edit the existing imposter detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(addMesh , bool , (const char *meshName, const char *srcShape, const char *srcMesh) , (meshName, srcShape, srcMesh) , false , "Add geometry from another DTS or DAE shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> into this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "Any materials <a href="/coding/file/tsshapeconstruct_8cpp/#tsshapeconstruct_8cpp_1a21625ca11566389388a748ad1acc0990">required</a> by the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> mesh are also copied into this shape.<br>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param meshName full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> mesh. If " "no detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> is present at the end of the name, <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2 is used.< br >" "An underscore before the number at the end of the name will be interpreted as " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> negative sign. eg. \"MyMesh_4\" will be interpreted as \"MyMesh-4\".\n" "@param srcShape name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> (DTS or DAE) that contains the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh\n</a>" "@param srcMesh the full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "copy from the DTS/DAE <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> into this shape</li>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addMesh(\"ColMesh-1\", \"./collision.dts\", \"ColMesh\", \"Col-1\" );\n" "%this.addMesh( \"SimpleShape10\", \"./testShape.dae\", \"MyMesh2\", "" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(addNode , bool , (const char *name, const char *parentName, TransformF txfm, bool isWorld) , (TransformF::Identity, false) , (name, parentName, txfm, isWorld) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> node  , the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> node will be at the root level of the node <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hierarchy.\n</a>" " @param txfm(optional) transform string of the form:\"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n" "@param isworld (optional) flag <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the local-<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a>-parent or the global " "transform. If false, or not specified, the position and orientation are " "treated as relative <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addNode(\"Nose\", \"Bip01 Head\", \"0 2 2 0 0 1 0\" );\n" "%this.addNode( \"myRoot\", \"\", \"0 0 4 0 0 1 1.57\" );\n" "%this.addNode( \"Nodes\", \"Bip01 Head\", \"0 2 0 0 0 1 0\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(addSequence , bool , (const char *source, const char *name, S32 start, S32 end, bool padRot, bool padTrans) , (0, -1, true, false) , (source, name, start, end, padRot, padTrans) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> the name of an existing sequence, or the name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DTS or DAE " "shape or DSQ sequence file. When the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> contains more than one " " sequence, the desired sequence can be specified by appending the name <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the " "end of the shape file. eg. \"myShape.dts run\" would select the \"run\" " "sequence from the \"myShape.dts\" file.\n\n" "@param name name of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" "@param start (optional) first frame <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> copy. Defaults <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 0, the first frame in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" " @param end(optional) last frame <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> copy. Defaults <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> - 1, the last frame in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" " @param padRot(optional) copy root-pose rotation keys <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-animated nodes. This is useful <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence data has <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape, such as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> one character was " "in the <a href="/coding/group/group__engineapi__types/#group__engineapi__types_1ga16a0f7e7053a679c9bf4289b441a2be7">T</a> pose, and the other had arms at the side. Normally only nodes that are actually rotated by " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence have keyframes added, but setting this flag will also add keyframes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> nodes " "that are not animated, but have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose rotation <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @param padTrans(optional) copy root-pose translation keys <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-animated nodes. This is useful <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence data has <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape, such as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> one character was " "in the <a href="/coding/group/group__engineapi__types/#group__engineapi__types_1ga16a0f7e7053a679c9bf4289b441a2be7">T</a> pose, and the other had arms at the side. Normally only nodes that are actually moved by " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence have keyframes added, but setting this flag will also add keyframes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> nodes " "that are not animated, but have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose position <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addSequence(\"./testShape.dts ambient\", \"ambient\" );\n" "%this.addSequence( \"./myPlayer.dae run\", \"run\" );\n" "%this.addSequence( \"./player_look.dsq\", \"look\", 0, -1 ); // start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">end\n</a>" "%this.addSequence( \"walk\", \"walk_shortA\", 0, 4 ); // start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> frame 4\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.addSequence( \"walk\", \"walk_shortB\", 4, -1 ); // frame 4 <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">end\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(addTrigger , bool , (const char *name, S32 keyframe, S32 state) , (name, keyframe, state) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param keyframe keyframe of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" "@param state of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addTrigger(\"walk\", 3, 1 );\n" "%this.addTrigger( \"walk\", 5, -1 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(dumpShape , void , (const char *filename) , ("") , (filename) , "Dump the shape hierarchy <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the console or <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> file. Useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> reviewing " "the result of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> series of construction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">commands.\n</a>" "@param filename Destination filename. If not specified, dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">console.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.dumpShape();//dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">console\n</a>" "%this.dumpShape(\"./dump.txt\" ); // dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getBounds , Box3F , () , () , Box3F::Invalid , "Get the bounding box <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return Bounding box \"minX minY minZ maxX maxY maxZ\"" )
DefineTSShapeConstructorMethod(getDetailLevelCount , S32 , () , () , 0 , "Get the total number of detail levels in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return the number of detail levels in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n</a>" )
DefineTSShapeConstructorMethod(getDetailLevelIndex , S32 , (S32 size) , (size) , - 1, "Get the index of the detail level with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size.\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup\n</a>" "@return index of the detail level with the desired size, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> no such " "detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">exists\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(%this.getDetailLevelSize(32)==-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Error: This shape does not have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level at <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> 32\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getDetailLevelName , const char * , (S32 index) , (index) , "" )
DefineTSShapeConstructorMethod(getDetailLevelSize , S32 , (S32 index) , (index) , 0 )
DefineTSShapeConstructorMethod(getImposterDetailLevel , S32 , () , () , - 1, "Get the index of the imposter (auto-billboard) detail level (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return imposter detail level index, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the shape does not use " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">imposters.\n\n</a>" )
DefineTSShapeConstructorMethod(getImposterSettings , const char * , (S32 index) , (index) , "" )
DefineTSShapeConstructorMethod(getMeshCount , S32 , (const char *name) , (name) , 0 )
DefineTSShapeConstructorMethod(getMeshMaterial , const char * , (const char *name) , (name) , "" , "Get the name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh. Note that only the first " "material used by the mesh is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">returned.\n</a>" "@param name full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the mesh (suitable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> use with the <a href="/coding/class/classmaterial/">Material</a> mapTo field)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Mesh material is \" @ %this.sgetMeshMaterial( \"SimpleShape128\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getMeshName , const char * , (const char *name, S32 index) , (name, index) , "" )
DefineTSShapeConstructorMethod(getMeshSize , S32 , (const char *name, S32 index) , (name, index) , - 1, "Get the detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the indexed mesh <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param index index of the mesh (valid range is 0 - getMeshCount()-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the mesh detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// print sizes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all detail levels of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "% objName)
DefineTSShapeConstructorMethod(getMeshType , const char * , (const char *name) , (name) , "" , "Get the display type of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name name of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the string returned is one of:" "<dl><dt>normal</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> normal 3D mesh</dd>" "<dt>billboard</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh that always faces the camera</dd>" "<dt>billboardzaxis</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh that always faces the camera in the Z-axis</dd></dl>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Mesh type is \" @ %this.getMeshType( \"SimpleShape128\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getNodeChildCount , S32 , (const char *name) , (name) , 0 )
DefineTSShapeConstructorMethod(getNodeChildName , const char * , (const char *name, S32 index) , (name, index) , "" , "Get the name of the indexed child <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the parent node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" "@param index index of the child node (valid range is 0 - getNodeChildName()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed child <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "function dumpNode( %shape, %name, %indent )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( %indent @ %name );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = %shape.getNodeChildCount( %name );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> ( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> = 0; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> < %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a>++ )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      dumpNode( %shape, %shape.getNodeChildName( %name, %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> ), %indent @ \"   \" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "}\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "function dumpShape( %shape )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   // recursively dump node <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hierarchy\n</a>" "   %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = %shape.getNodeCount();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> ( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> = 0; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> < %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a>++ )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      // dump top level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">nodes\n</a>" "      %name = %shape.getNodeName( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> ( %shape.getNodeParentName( %name ) $= "" )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "         dumpNode( %shape, %name, \"\" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "}\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getNodeCount , S32 , () , () , 0 )
DefineTSShapeConstructorMethod(getNodeIndex , S32 , (const char *name) , (name) , - 1, "Get the index of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup.\n</a>" "@return the index of the named node)
DefineTSShapeConstructorMethod(getNodeName , const char * , (S32 index) , (index) , "" , "Get the name of the indexed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param index index of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> lookup (valid range is 0 - getNodeCount()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed node)
DefineTSShapeConstructorMethod(getNodeObjectCount , S32 , (const char *name) , (name) , 0 )
DefineTSShapeConstructorMethod(getNodeObjectName , const char * , (const char *name, S32 index) , (name, index) , "" )
DefineTSShapeConstructorMethod(getNodeParentName , const char * , (const char *name) , (name) , "" , "Get the name of the node's parent. If the node has no parent  , return an empty <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" " @return the name of the node 's parent, or \"\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the node is at the root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Bip01 Pelvis parent = \" @ %this.getNodeParentName( \"Bip01 Pelvis \") );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getNodeTransform , TransformF , (const char *name, bool isWorld) , (false) , (name, isWorld) , TransformF::Identity , "Get the base (ie. not animated) transform of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" "@param isWorld true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get the global transform)
DefineTSShapeConstructorMethod(getObjectCount , S32 , () , () , 0 )
DefineTSShapeConstructorMethod(getObjectIndex , S32 , (const char *name) , (name) , - 1)
DefineTSShapeConstructorMethod(getObjectName , const char * , (S32 index) , (index) , "" )
DefineTSShapeConstructorMethod(getObjectNode , const char * , (const char *name) , (name) , "" , "Get the name of the node this object is attached <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">get.\n</a>" "@return the name of the attached node, or an empty string <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this " "object is not attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node(usually the case <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> skinned meshes).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Hand is attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> \" @ %this.getObjectNode( \"Hand\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getSequenceBlend , const char * , (const char *name) , (name) , "" , "Get information about blended <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequences.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return TAB delimited string of the form: \"isBlend blendSeq blendFrame\" )
DefineTSShapeConstructorMethod(getSequenceCount , S32 , () , () , 0 , "Get the total number of sequences in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return the number of sequences in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" )
DefineTSShapeConstructorMethod(getSequenceCyclic , bool , (const char *name) , (name) , false , "Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this sequence is cyclic (looping).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this sequence is cyclic, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(!%this.getSequenceCyclic(\"ambient\" ) )\n" " error( \"ambient sequence is not cyclic!\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getSequenceFrameCount , S32 , (const char *name) , (name) , 0 , "Get the number of keyframes in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return number of keyframes in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Run has \" @ %this.getSequenceFrameCount( \"run\" ) @ \" keyframes\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getSequenceGroundSpeed , const char * , (const char *name) , (name) , "" )
DefineTSShapeConstructorMethod(getSequenceIndex , S32 , (const char *name) , (name) , - 1, "Find the index of the sequence with the given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup\n</a>" "@return index of the sequence with matching name, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">found\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given sequence exists in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(%this.getSequenceIndex(\"walk\" ) == -1 )\n" " <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Could not find 'walk' sequence\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getSequenceName , const char * , (S32 index) , (index) , "" )
DefineTSShapeConstructorMethod(getSequencePriority , F32 , (const char *name) , (name) , -1. 0f, "Get the priority setting of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return priority <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" )
DefineTSShapeConstructorMethod(getSequenceSource , const char * , (const char *name) , (name) , "" , "Get information about where the sequence data came <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "For example, whether it was loaded from an external DSQ <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file.\n</a>" " @param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return TAB delimited string of the form:\"from reserved start end total\" , where:" "< dl >" "< dt >from</dt >< dd >the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> of the animation data, such as the path <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DSQ file, or the name of an existing sequence in the shape. This field " "will be empty <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> sequences already embedded in the DTS or DAE file.</dd >" "< dt >reserved</dt >< dd >reserved <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a></dd >" "< dt >start</dt >< dd >the first frame in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> create this sequence</dd >" "< dt >end</dt >< dd >the last frame in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> create this sequence</dd >" "< dt >total</dt >< dd >the total number of frames in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence</dd >" "</dl >\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//print the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the walk <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">animation\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"walk source:\" SPC getField( %this.getSequenceSource( \"walk\" ), 0 ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(getTargetCount , S32 , () , () , 0 )
DefineTSShapeConstructorMethod(getTargetName , const char * , (S32 index) , (index) , "" )
DefineTSShapeConstructorMethod(getTrigger , const char * , (const char *name, S32 index) , (name, index) , "" )
DefineTSShapeConstructorMethod(getTriggerCount , S32 , (const char *name) , (name) , 0 , "Get the number of triggers in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return number of triggers in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" )
DefineTSShapeConstructorMethod(notifyShapeChanged , void , () , () , "Notify game objects that this shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> has changed, allowing them <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> update " "internal data <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> needed." )
DefineTSShapeConstructorMethod(removeDetailLevel , bool , (S32 index) , (index) , false , "Remove the detail level (including all meshes in the detail level)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeDetailLevel(2);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(removeImposter , bool , () , () , false , "() Remove the imposter detail level (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any) from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )
DefineTSShapeConstructorMethod(removeMesh , bool , (const char *name) , (name) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "If all geometry is removed from an object, the object is also <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">removed.\n</a>" " @param name full name(object name+detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeMesh(\"SimpleShape128\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(removeNode , bool , (const char *name) , (name) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "The named node is removed from the shape, including from any sequences that " "use the node. Child nodes and objects attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node are re-assigned " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeNode(\"Nose\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(removeObject , bool , (const char *name) , (name) , false , "Remove an object (including all meshes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> that object) from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful)
DefineTSShapeConstructorMethod(removeSequence , bool , (const char *name) , (name) , false , "Remove the sequence from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )
DefineTSShapeConstructorMethod(removeTrigger , bool , (const char *name, S32 keyframe, S32 state) , (name, keyframe, state) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> trigger from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param keyframe keyframe of the trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@param state of the trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeTrigger(\"walk\", 3, 1 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(renameDetailLevel , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n</a>" "@note Note that detail level names must be unique, so this command will " "fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameDetailLevel(\"detail-1\", \"collision-1\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(renameNode , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@note Note that node names must be unique, so this command will fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameNode(\"Bip01 L Hand\", \"mount5\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(renameObject , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename an <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@note Note that object names must be unique, so this command will fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "there is already an object with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameObject(\"MyBox\", \"Box\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(renameSequence , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@note Note that sequence names must be unique, so this command will fail " "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameSequence(\"walking\", \"walk\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(saveShape , void , (const char *filename) , (filename) , "Save the shape (with all current changes) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> DTS <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file.\n</a>" "@param filename Destination <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.saveShape( \"./myShape.dts\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setBounds , bool , (Box3F bbox) , (bbox) , false , "Set the shape bounds <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the given bounding <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">box.\n</a>" "@param Bounding box \"minX minY minZ maxX maxY maxZ\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n</a>" )
DefineTSShapeConstructorMethod(setDetailLevelSize , S32 , (S32 index, S32 newSize) , (index, newSize) , index , "Change the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level." "@note Note that detail levels are always sorted in decreasing <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> order, " "so this command may cause detail level indices <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">change.\n</a>" " @param index index of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param newSize <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @return <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setDetailLevelSize(2, 256);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setMeshMaterial , bool , (const char *meshName, const char *matName) , (meshName, matName) , false , "Set the name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param meshName full name  , or the name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> " "<a href="/coding/class/classmaterial/">Material</a> object already defined in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">script.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//set the mesh <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material\n</a>" "%this.setMeshMaterial(\"SimpleShape128\", \"test_mat\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setMeshSize , bool , (const char *name, S32 size) , (name, size) , false , "Change the detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the named <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name full name (object name + current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> ) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setMeshSize(\"SimpleShape128\", 64 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setMeshType , bool , (const char *name, const char *type) , (name, type) , false , "Set the display type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param type the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the mesh: \"normal\" , \"billboard\" or \"billboardzaxis\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//set the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">billboard\n</a>" "%this.setMeshType(\"SimpleShape64\", \"billboard\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setNodeParent , bool , (const char *name, const char *parentName) , (name, parentName) , false , "Set the parent of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param parentName name of the parent node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set (use \"\" <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> move the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the root level)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setNodeParent(\"Bip01 Pelvis\", \"start01\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setNodeTransform , bool , (const char *name, TransformF txfm, bool isWorld) , (false) , (name, txfm, isWorld) , false , "Set the base transform of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node. That is, the transform of the node when " "in the root(not-animated) <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param txfm transform string of the form:\"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n" "@param isworld (optional) flag <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the local-<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a>-parent or the global " "transform. If false, or not specified, the position and orientation are " "treated as relative <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setNodeTransform(\"mount0\", \"0 0 1 0 0 1 0\" );\n" "%this.setNodeTransform( \"mount0\", \"0 0 0 0 0 1 1.57\" );\n" "%this.setNodeTransform( \"mount0\", \"1 0 0 0 0 1 0\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setObjectNode , bool , (const char *objName, const char *nodeName) , (objName, nodeName) , false , "Set the node an object is attached <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "When the shape is rendered, the object geometry is rendered at the node 's " "current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform.\n</a>" " @param objName name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param nodeName name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> attach the object <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setObjectNode(\"Hand\", \"Bip01 LeftHand\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setSequenceBlend , bool , (const char *name, bool blend, const char *blendSeq, S32 blendFrame) , (name, blend, blendSeq, blendFrame) , false , "Mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> blend or non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">blend.\n</a>" "A blend sequence is one that will be added on top of any other playing " "sequences. This is done by storing the animated node transforms relative " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> reference frame, rather than as absolute <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transforms.\n</a>" " @param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param blend true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make the sequence <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> blend, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">blend\n</a>" " @param blendSeq the name of the sequence that contains the blend reference <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame\n</a>" " @param blendFrame the reference frame in the blendSeq <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceBlend(\"look\", true, \"root\", 0 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setSequenceCyclic , bool , (const char *name, bool cyclic) , (name, cyclic) , false , "Mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence as cyclic or non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cyclic.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param cyclic true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make the sequence cyclic, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cyclic\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceCyclic(\"ambient\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.setSequenceCyclic( \"shoot\", false );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setSequenceGroundSpeed , bool , (const char *name, Point3F transSpeed, Point3F rotSpeed) , (Point3F::Zero) , (name, transSpeed, rotSpeed) , false , "Set the translation and rotation ground speed of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "The ground speed of the sequence is set by generating ground transform " "keyframes. The ground translational and rotational speed is assumed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "be constant <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the duration of the sequence. Existing ground frames <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "the sequence (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any) will be <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">replaced.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param transSpeed translational speed (trans.x trans.y trans.z) in " "Torque units per <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame\n</a>" "@param rotSpeed (optional) rotational speed (rot.x rot.y rot.z) in " "radians per frame. Default is \"0 0 0\"\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceGroundSpeed(\"run\", \"5 0 0\" );\n" "%this.setSequenceGroundSpeed( \"spin\", \"0 0 0\", \"4 0 0\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )
DefineTSShapeConstructorMethod(setSequencePriority , bool , (const char *name, F32 priority) , (name, priority) , false , "Set the sequence <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">priority.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param priority <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> priority <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )
DefineTSShapeConstructorMethod(writeChangeSet , void , () , () , "Write the current change set <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a> script file. The " "name of the script <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> is the same as the model, but with ." TORQUE_SCRIPT_EXTENSION " extension. " "eg. myShape." TORQUE_SCRIPT_EXTENSION " for myShape.dts or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">myShape.dae.\n</a>" )
IMPLEMENT_CALLBACK(TSShapeConstructor , onLoad , void , () , () , "Called immediately after the DTS or DAE <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> has been loaded; before the " "shape data is available <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any other object (<a href="/coding/class/classstaticshape/">StaticShape</a>, <a href="/coding/class/classplayer/">Player</a> etc). This " "is where you should put any post-load commands <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify the shape in-memory " "such as addNode, renameSequence etc." )
ImplementEnumType(TSShapeConstructorAnimType , "\n\n" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )
ImplementEnumType(TSShapeConstructorLodType , "\n\n" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )
Called when the DTS or DAE resource is flushed from memory Not normally but may be useful to perform cleanup
ImplementEnumType(TSShapeConstructorUpAxis , "Axis <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> upwards direction when importing from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Collada.\n\n</a>" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )
bool
namesEqual(const String & nameA, const String & nameB)

Detailed Description

Public Defines

CHECK_INDEX_IN_RANGE(func, index, maxIndex, ret)     ( ( index < 0 ) || ( index >= maxIndex ) )                     \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": index out of "    \
         "range (0-%d)", maxIndex-1);                                \
      return ret;                                                    \
   }
GET_MESH(func, var, name, ret)    * var = mShape->findMesh(name);                             \
    (!var)                                                         \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "mesh '%s'", name);                                         \
      return ret;                                                    \
   }
GET_NODE_INDEX_ALLOW_ROOT(func, var, name, ret)     var##Index = -1;                                              \
    (name[0])                                                      \
   {                                                                 \
      var##Index = mShape->findNode(name);                           \
       (var##Index < 0)                                            \
      {                                                              \
         ( "TSShapeConstructor::" #func ": Could not "    \
            "find node '%s'", name);                                 \
         return ret;                                                 \
      }                                                              \
   }                                                                 \
   * var = var##Index < 0 ?  : &(mShape->nodes[var##Index]); \
   (var##Index);                                        \
   (var)
GET_NODE_INDEX_NO_ROOT(func, var, name, ret)     var##Index = mShape->findNode(name);                          \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "node '%s'", name);                                         \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->nodes[var##Index]);                \
   (var##Index);                                        \
   (var)
GET_OBJECT(func, var, name, ret)     var##Index = mShape->findObject(name);                        \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "object '%s'", name);                                       \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->objects[var##Index]);            \
   (var##Index);                                        \
   (var)
GET_SEQUENCE(func, var, name, ret)     var##Index = mShape->findSequence(name);                      \
    (var##Index < 0)                                               \
   {                                                                 \
      ( "TSShapeConstructor::" #func ": Could not find "  \
         "sequence named '%s'", name);                               \
      return ret;                                                    \
   }                                                                 \
   * var = &(mShape->sequences[var##Index]);        \
   (var##Index);                                        \
   (var);
MAX_PATH_LENGTH() 256
RETURN_IF_MATCH(type)  (!(name, #type)) return Cmd##type

Public Variables

 EndImplementEnumType 
 onUnload 
Called when the DTS or DAE resource is flushed from memory Not normally required 
 void 

Public Functions

ConsoleDocClass(TSShapeConstructor , "@brief An object used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DTS or COLLADA shape model after it has " "been loaded by <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Torque\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )

createNodeWithText(const char * name, const char * text)

DefineTSShapeConstructorMethod(addImposter , S32 , (S32 size, S32 equatorSteps, S32 polarSteps, S32 dl, S32 dim, bool includePoles, F32 polarAngle) , (size, equatorSteps, polarSteps, dl, dim, includePoles, polarAngle) , - 1, "Add (or edit) an imposter detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "If the shape already contains an imposter detail level, this command will " "simply change the imposter <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">settings\n</a>" " @param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the imposter detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @param equatorSteps defines the number of snapshots <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> take around the " "equator. Imagine the object being rotated around the vertical axis, then " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> snapshot taken at regularly spaced <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">intervals.\n</a>" " @param polarSteps defines the number of snapshots taken between the poles " " , at each equator step. eg. At each equator snapshot, " "snapshots are taken at regular intervals between the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">poles.\n</a>" " @param dl the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use when generating the snapshots. Note that " "this is an array index rather than <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail size. So <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> an object has detail " "sizes of:200 , 150 , and 40, then setting @<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dl <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 1 will generate the snapshots " "using detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> 150.\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @param dim defines the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the imposter images in pixels. The larger the " " number, the more detailed the billboard will <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">be.\n</a>" " @param includePoles flag indicating whether <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> include the \"pole\" snapshots. " "ie. the views from the top and bottom of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@param polar_angle <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> pole snapshots are active  , this " "parameter defines the camera angle(in degrees) within which <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/editortool_8cpp/#editortool_8cpp_1a4cb041169a32ea3d4cacadbb955e06b4">render</a> the " "pole snapshot. eg. <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> polar_angle is set <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 25 degrees, then the snapshot " "taken at the pole(looking directly down or up at the object) will be rendered " "when the camera is within 25 degrees of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pole.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addImposter(2, 4, 0, 0, 64, false, 0);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.addImposter(2, 4, 2, 0, 64, true, 10);//this command would edit the existing imposter detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(addMesh , bool , (const char *meshName, const char *srcShape, const char *srcMesh) , (meshName, srcShape, srcMesh) , false , "Add geometry from another DTS or DAE shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> into this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "Any materials <a href="/coding/file/tsshapeconstruct_8cpp/#tsshapeconstruct_8cpp_1a21625ca11566389388a748ad1acc0990">required</a> by the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> mesh are also copied into this shape.<br>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param meshName full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> mesh. If " "no detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> is present at the end of the name, <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of 2 is used.< br >" "An underscore before the number at the end of the name will be interpreted as " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> negative sign. eg. \"MyMesh_4\" will be interpreted as \"MyMesh-4\".\n" "@param srcShape name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> (DTS or DAE) that contains the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh\n</a>" "@param srcMesh the full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "copy from the DTS/DAE <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> into this shape</li>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addMesh(\"ColMesh-1\", \"./collision.dts\", \"ColMesh\", \"Col-1\" );\n" "%this.addMesh( \"SimpleShape10\", \"./testShape.dae\", \"MyMesh2\", "" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(addNode , bool , (const char *name, const char *parentName, TransformF txfm, bool isWorld) , (TransformF::Identity, false) , (name, parentName, txfm, isWorld) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> node  , the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> node will be at the root level of the node <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hierarchy.\n</a>" " @param txfm(optional) transform string of the form:\"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n" "@param isworld (optional) flag <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the local-<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a>-parent or the global " "transform. If false, or not specified, the position and orientation are " "treated as relative <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addNode(\"Nose\", \"Bip01 Head\", \"0 2 2 0 0 1 0\" );\n" "%this.addNode( \"myRoot\", \"\", \"0 0 4 0 0 1 1.57\" );\n" "%this.addNode( \"Nodes\", \"Bip01 Head\", \"0 2 0 0 0 1 0\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(addSequence , bool , (const char *source, const char *name, S32 start, S32 end, bool padRot, bool padTrans) , (0, -1, true, false) , (source, name, start, end, padRot, padTrans) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> the name of an existing sequence, or the name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DTS or DAE " "shape or DSQ sequence file. When the shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> contains more than one " " sequence, the desired sequence can be specified by appending the name <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the " "end of the shape file. eg. \"myShape.dts run\" would select the \"run\" " "sequence from the \"myShape.dts\" file.\n\n" "@param name name of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" "@param start (optional) first frame <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> copy. Defaults <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> 0, the first frame in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" " @param end(optional) last frame <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> copy. Defaults <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> - 1, the last frame in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" " @param padRot(optional) copy root-pose rotation keys <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-animated nodes. This is useful <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence data has <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape, such as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> one character was " "in the <a href="/coding/group/group__engineapi__types/#group__engineapi__types_1ga16a0f7e7053a679c9bf4289b441a2be7">T</a> pose, and the other had arms at the side. Normally only nodes that are actually rotated by " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence have keyframes added, but setting this flag will also add keyframes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> nodes " "that are not animated, but have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose rotation <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @param padTrans(optional) copy root-pose translation keys <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-animated nodes. This is useful <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence data has <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape, such as <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> one character was " "in the <a href="/coding/group/group__engineapi__types/#group__engineapi__types_1ga16a0f7e7053a679c9bf4289b441a2be7">T</a> pose, and the other had arms at the side. Normally only nodes that are actually moved by " "the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence have keyframes added, but setting this flag will also add keyframes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> nodes " "that are not animated, but have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> different root-pose position <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the target shape root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addSequence(\"./testShape.dts ambient\", \"ambient\" );\n" "%this.addSequence( \"./myPlayer.dae run\", \"run\" );\n" "%this.addSequence( \"./player_look.dsq\", \"look\", 0, -1 ); // start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">end\n</a>" "%this.addSequence( \"walk\", \"walk_shortA\", 0, 4 ); // start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> frame 4\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.addSequence( \"walk\", \"walk_shortB\", 4, -1 ); // frame 4 <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">end\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(addTrigger , bool , (const char *name, S32 keyframe, S32 state) , (name, keyframe, state) , false , "Add <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param keyframe keyframe of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" "@param state of the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">trigger\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.addTrigger(\"walk\", 3, 1 );\n" "%this.addTrigger( \"walk\", 5, -1 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(dumpShape , void , (const char *filename) , ("") , (filename) , "Dump the shape hierarchy <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the console or <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> file. Useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> reviewing " "the result of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> series of construction <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">commands.\n</a>" "@param filename Destination filename. If not specified, dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">console.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.dumpShape();//dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">console\n</a>" "%this.dumpShape(\"./dump.txt\" ); // dump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getBounds , Box3F , () , () , Box3F::Invalid , "Get the bounding box <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return Bounding box \"minX minY minZ maxX maxY maxZ\"" )

DefineTSShapeConstructorMethod(getDetailLevelCount , S32 , () , () , 0 , "Get the total number of detail levels in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return the number of detail levels in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n</a>" )

DefineTSShapeConstructorMethod(getDetailLevelIndex , S32 , (S32 size) , (size) , - 1, "Get the index of the detail level with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size.\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup\n</a>" "@return index of the detail level with the desired size, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> no such " "detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">exists\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(%this.getDetailLevelSize(32)==-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Error: This shape does not have <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level at <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> 32\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getDetailLevelName , const char * , (S32 index) , (index) , "" )

DefineTSShapeConstructorMethod(getDetailLevelSize , S32 , (S32 index) , (index) , 0 )

DefineTSShapeConstructorMethod(getImposterDetailLevel , S32 , () , () , - 1, "Get the index of the imposter (auto-billboard) detail level (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return imposter detail level index, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the shape does not use " "<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">imposters.\n\n</a>" )

DefineTSShapeConstructorMethod(getImposterSettings , const char * , (S32 index) , (index) , "" )

DefineTSShapeConstructorMethod(getMeshCount , S32 , (const char *name) , (name) , 0 )

DefineTSShapeConstructorMethod(getMeshMaterial , const char * , (const char *name) , (name) , "" , "Get the name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh. Note that only the first " "material used by the mesh is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">returned.\n</a>" "@param name full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the mesh (suitable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> use with the <a href="/coding/class/classmaterial/">Material</a> mapTo field)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Mesh material is \" @ %this.sgetMeshMaterial( \"SimpleShape128\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getMeshName , const char * , (const char *name, S32 index) , (name, index) , "" )

DefineTSShapeConstructorMethod(getMeshSize , S32 , (const char *name, S32 index) , (name, index) , - 1, "Get the detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the indexed mesh <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@param index index of the mesh (valid range is 0 - getMeshCount()-1)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the mesh detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// print sizes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all detail levels of this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" "% objName)

DefineTSShapeConstructorMethod(getMeshType , const char * , (const char *name) , (name) , "" , "Get the display type of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name name of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return the string returned is one of:" "<dl><dt>normal</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> normal 3D mesh</dd>" "<dt>billboard</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh that always faces the camera</dd>" "<dt>billboardzaxis</dt><dd><a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh that always faces the camera in the Z-axis</dd></dl>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Mesh type is \" @ %this.getMeshType( \"SimpleShape128\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getNodeChildCount , S32 , (const char *name) , (name) , 0 )

DefineTSShapeConstructorMethod(getNodeChildName , const char * , (const char *name, S32 index) , (name, index) , "" , "Get the name of the indexed child <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the parent node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" "@param index index of the child node (valid range is 0 - getNodeChildName()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed child <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "function dumpNode( %shape, %name, %indent )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( %indent @ %name );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = %shape.getNodeChildCount( %name );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> ( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> = 0; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> < %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a>++ )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      dumpNode( %shape, %shape.getNodeChildName( %name, %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> ), %indent @ \"   \" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "}\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "function dumpShape( %shape )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   // recursively dump node <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hierarchy\n</a>" "   %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a> = %shape.getNodeCount();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> ( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> = 0; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> < %<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>; %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a>++ )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      // dump top level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">nodes\n</a>" "      %name = %shape.getNodeName( %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "      <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> ( %shape.getNodeParentName( %name ) $= "" )\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "         dumpNode( %shape, %name, \"\" );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "   }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "}\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getNodeCount , S32 , () , () , 0 )

DefineTSShapeConstructorMethod(getNodeIndex , S32 , (const char *name) , (name) , - 1, "Get the index of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup.\n</a>" "@return the index of the named node)

DefineTSShapeConstructorMethod(getNodeName , const char * , (S32 index) , (index) , "" , "Get the name of the indexed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param index index of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> lookup (valid range is 0 - getNodeCount()-1).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return the name of the indexed node)

DefineTSShapeConstructorMethod(getNodeObjectCount , S32 , (const char *name) , (name) , 0 )

DefineTSShapeConstructorMethod(getNodeObjectName , const char * , (const char *name, S32 index) , (name, index) , "" )

DefineTSShapeConstructorMethod(getNodeParentName , const char * , (const char *name) , (name) , "" , "Get the name of the node's parent. If the node has no parent  , return an empty <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" " @return the name of the node 's parent, or \"\" <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the node is at the root <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Bip01 Pelvis parent = \" @ %this.getNodeParentName( \"Bip01 Pelvis \") );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getNodeTransform , TransformF , (const char *name, bool isWorld) , (false) , (name, isWorld) , TransformF::Identity , "Get the base (ie. not animated) transform of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query.\n</a>" "@param isWorld true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get the global transform)

DefineTSShapeConstructorMethod(getObjectCount , S32 , () , () , 0 )

DefineTSShapeConstructorMethod(getObjectIndex , S32 , (const char *name) , (name) , - 1)

DefineTSShapeConstructorMethod(getObjectName , const char * , (S32 index) , (index) , "" )

DefineTSShapeConstructorMethod(getObjectNode , const char * , (const char *name) , (name) , "" , "Get the name of the node this object is attached <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">get.\n</a>" "@return the name of the attached node, or an empty string <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this " "object is not attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node(usually the case <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> skinned meshes).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Hand is attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> \" @ %this.getObjectNode( \"Hand\" ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getSequenceBlend , const char * , (const char *name) , (name) , "" , "Get information about blended <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequences.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return TAB delimited string of the form: \"isBlend blendSeq blendFrame\" )

DefineTSShapeConstructorMethod(getSequenceCount , S32 , () , () , 0 , "Get the total number of sequences in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return the number of sequences in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n\n</a>" )

DefineTSShapeConstructorMethod(getSequenceCyclic , bool , (const char *name) , (name) , false , "Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this sequence is cyclic (looping).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> this sequence is cyclic, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(!%this.getSequenceCyclic(\"ambient\" ) )\n" " error( \"ambient sequence is not cyclic!\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getSequenceFrameCount , S32 , (const char *name) , (name) , 0 , "Get the number of keyframes in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return number of keyframes in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Run has \" @ %this.getSequenceFrameCount( \"run\" ) @ \" keyframes\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getSequenceGroundSpeed , const char * , (const char *name) , (name) , "" )

DefineTSShapeConstructorMethod(getSequenceIndex , S32 , (const char *name) , (name) , - 1, "Find the index of the sequence with the given <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lookup\n</a>" "@return index of the sequence with matching name, or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">found\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Check <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> given sequence exists in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape\n</a>" "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a>(%this.getSequenceIndex(\"walk\" ) == -1 )\n" " <a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>( \"Could not find 'walk' sequence\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getSequenceName , const char * , (S32 index) , (index) , "" )

DefineTSShapeConstructorMethod(getSequencePriority , F32 , (const char *name) , (name) , -1. 0f, "Get the priority setting of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return priority <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" )

DefineTSShapeConstructorMethod(getSequenceSource , const char * , (const char *name) , (name) , "" , "Get information about where the sequence data came <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "For example, whether it was loaded from an external DSQ <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file.\n</a>" " @param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" " @return TAB delimited string of the form:\"from reserved start end total\" , where:" "< dl >" "< dt >from</dt >< dd >the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> of the animation data, such as the path <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> DSQ file, or the name of an existing sequence in the shape. This field " "will be empty <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> sequences already embedded in the DTS or DAE file.</dd >" "< dt >reserved</dt >< dd >reserved <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a></dd >" "< dt >start</dt >< dd >the first frame in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> create this sequence</dd >" "< dt >end</dt >< dd >the last frame in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> create this sequence</dd >" "< dt >total</dt >< dd >the total number of frames in the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> sequence</dd >" "</dl >\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//print the <a href="/coding/file/pointer_8h/#pointer_8h_1adb82dfe18535e9a30aa97d275f82bd55">source</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the walk <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">animation\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"walk source:\" SPC getField( %this.getSequenceSource( \"walk\" ), 0 ) );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(getTargetCount , S32 , () , () , 0 )

DefineTSShapeConstructorMethod(getTargetName , const char * , (S32 index) , (index) , "" )

DefineTSShapeConstructorMethod(getTrigger , const char * , (const char *name, S32 index) , (name, index) , "" )

DefineTSShapeConstructorMethod(getTriggerCount , S32 , (const char *name) , (name) , 0 , "Get the number of triggers in the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">query\n</a>" "@return number of triggers in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n\n</a>" )

DefineTSShapeConstructorMethod(notifyShapeChanged , void , () , () , "Notify game objects that this shape <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> has changed, allowing them <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> update " "internal data <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> needed." )

DefineTSShapeConstructorMethod(removeDetailLevel , bool , (S32 index) , (index) , false , "Remove the detail level (including all meshes in the detail level)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeDetailLevel(2);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(removeImposter , bool , () , () , false , "() Remove the imposter detail level (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any) from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )

DefineTSShapeConstructorMethod(removeMesh , bool , (const char *name) , (name) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "If all geometry is removed from an object, the object is also <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">removed.\n</a>" " @param name full name(object name+detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeMesh(\"SimpleShape128\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(removeNode , bool , (const char *name) , (name) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "The named node is removed from the shape, including from any sequences that " "use the node. Child nodes and objects attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node are re-assigned " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeNode(\"Nose\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(removeObject , bool , (const char *name) , (name) , false , "Remove an object (including all meshes <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> that object) from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param name name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful)

DefineTSShapeConstructorMethod(removeSequence , bool , (const char *name) , (name) , false , "Remove the sequence from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">shape.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )

DefineTSShapeConstructorMethod(removeTrigger , bool , (const char *name, S32 keyframe, S32 state) , (name, keyframe, state) , false , "Remove <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> trigger from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param keyframe keyframe of the trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@param state of the trigger <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.removeTrigger(\"walk\", 3, 1 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(renameDetailLevel , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n</a>" "@note Note that detail level names must be unique, so this command will " "fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameDetailLevel(\"detail-1\", \"collision-1\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(renameNode , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@note Note that node names must be unique, so this command will fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameNode(\"Bip01 L Hand\", \"mount5\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(renameObject , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename an <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n</a>" "@note Note that object names must be unique, so this command will fail <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> " "there is already an object with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameObject(\"MyBox\", \"Box\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(renameSequence , bool , (const char *oldName, const char *newName) , (oldName, newName) , false , "Rename <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "@note Note that sequence names must be unique, so this command will fail " "<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is already <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence with the desired <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">name\n</a>" " @param oldName current name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @param newName <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> name of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.renameSequence(\"walking\", \"walk\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(saveShape , void , (const char *filename) , (filename) , "Save the shape (with all current changes) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> DTS <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">file.\n</a>" "@param filename Destination <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">filename.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.saveShape( \"./myShape.dts\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setBounds , bool , (Box3F bbox) , (bbox) , false , "Set the shape bounds <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the given bounding <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">box.\n</a>" "@param Bounding box \"minX minY minZ maxX maxY maxZ\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n</a>" )

DefineTSShapeConstructorMethod(setDetailLevelSize , S32 , (S32 index, S32 newSize) , (index, newSize) , index , "Change the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> detail level." "@note Note that detail levels are always sorted in decreasing <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> order, " "so this command may cause detail level indices <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">change.\n</a>" " @param index index of the detail level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param newSize <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n</a>" " @return <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setDetailLevelSize(2, 256);\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setMeshMaterial , bool , (const char *meshName, const char *matName) , (meshName, matName) , false , "Set the name of the material attached <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param meshName full name  , or the name of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> " "<a href="/coding/class/classmaterial/">Material</a> object already defined in <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">script.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//set the mesh <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">material\n</a>" "%this.setMeshMaterial(\"SimpleShape128\", \"test_mat\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setMeshSize , bool , (const char *name, S32 size) , (name, size) , false , "Change the detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> of the named <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name full name (object name + current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> ) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> detail level <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">size\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setMeshSize(\"SimpleShape128\", 64 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setMeshType , bool , (const char *name, const char *type) , (name, type) , false , "Set the display type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">mesh.\n</a>" "@param name full name (object name + detail <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1ab7d671599a7b25ca99a487fa341bc33a">size</a>) of the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param type the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> type <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the mesh: \"normal\" , \"billboard\" or \"billboardzaxis\"\n" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//set the mesh <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">billboard\n</a>" "%this.setMeshType(\"SimpleShape64\", \"billboard\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setNodeParent , bool , (const char *name, const char *parentName) , (name, parentName) , false , "Set the parent of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">node.\n</a>" "@param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param parentName name of the parent node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set (use \"\" <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> move the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the root level)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">failed\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setNodeParent(\"Bip01 Pelvis\", \"start01\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setNodeTransform , bool , (const char *name, TransformF txfm, bool isWorld) , (false) , (name, txfm, isWorld) , false , "Set the base transform of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> node. That is, the transform of the node when " "in the root(not-animated) <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pose.\n</a>" " @param name name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param txfm transform string of the form:\"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n" "@param isworld (optional) flag <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the local-<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a>-parent or the global " "transform. If false, or not specified, the position and orientation are " "treated as relative <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the node 's <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">parent.\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setNodeTransform(\"mount0\", \"0 0 1 0 0 1 0\" );\n" "%this.setNodeTransform( \"mount0\", \"0 0 0 0 0 1 1.57\" );\n" "%this.setNodeTransform( \"mount0\", \"1 0 0 0 0 1 0\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setObjectNode , bool , (const char *objName, const char *nodeName) , (objName, nodeName) , false , "Set the node an object is attached <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "When the shape is rendered, the object geometry is rendered at the node 's " "current <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transform.\n</a>" " @param objName name of the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param nodeName name of the node <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> attach the object <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setObjectNode(\"Hand\", \"Bip01 LeftHand\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setSequenceBlend , bool , (const char *name, bool blend, const char *blendSeq, S32 blendFrame) , (name, blend, blendSeq, blendFrame) , false , "Mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> blend or non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">blend.\n</a>" "A blend sequence is one that will be added on top of any other playing " "sequences. This is done by storing the animated node transforms relative " "<a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> reference frame, rather than as absolute <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">transforms.\n</a>" " @param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" " @param blend true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make the sequence <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> blend, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">blend\n</a>" " @param blendSeq the name of the sequence that contains the blend reference <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame\n</a>" " @param blendFrame the reference frame in the blendSeq <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceBlend(\"look\", true, \"root\", 0 );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setSequenceCyclic , bool , (const char *name, bool cyclic) , (name, cyclic) , false , "Mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> sequence as cyclic or non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cyclic.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param cyclic true <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> make the sequence cyclic, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> non-<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cyclic\n</a>" " @return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceCyclic(\"ambient\", true );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%this.setSequenceCyclic( \"shoot\", false );\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setSequenceGroundSpeed , bool , (const char *name, Point3F transSpeed, Point3F rotSpeed) , (Point3F::Zero) , (name, transSpeed, rotSpeed) , false , "Set the translation and rotation ground speed of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sequence.\n</a>" "The ground speed of the sequence is set by generating ground transform " "keyframes. The ground translational and rotational speed is assumed <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "be constant <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the duration of the sequence. Existing ground frames <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "the sequence (<a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> any) will be <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">replaced.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param transSpeed translational speed (trans.x trans.y trans.z) in " "Torque units per <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">frame\n</a>" "@param rotSpeed (optional) rotational speed (rot.x rot.y rot.z) in " "radians per frame. Default is \"0 0 0\"\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "%this.setSequenceGroundSpeed(\"run\", \"5 0 0\" );\n" "%this.setSequenceGroundSpeed( \"spin\", \"0 0 0\", \"4 0 0\" );\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n</a>" )

DefineTSShapeConstructorMethod(setSequencePriority , bool , (const char *name, F32 priority) , (name, priority) , false , "Set the sequence <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">priority.\n</a>" "@param name name of the sequence <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">modify\n</a>" "@param priority <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> priority <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" "@return true <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> successful, false <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">otherwise\n\n</a>" )

DefineTSShapeConstructorMethod(writeChangeSet , void , () , () , "Write the current change set <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a> script file. The " "name of the script <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> is the same as the model, but with ." TORQUE_SCRIPT_EXTENSION " extension. " "eg. myShape." TORQUE_SCRIPT_EXTENSION " for myShape.dts or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">myShape.dae.\n</a>" )

IMPLEMENT_CALLBACK(TSShapeConstructor , onLoad , void , () , () , "Called immediately after the DTS or DAE <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a702945180aa732857b380a007a7e2a21">file</a> has been loaded; before the " "shape data is available <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> any other object (<a href="/coding/class/classstaticshape/">StaticShape</a>, <a href="/coding/class/classplayer/">Player</a> etc). This " "is where you should put any post-load commands <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify the shape in-memory " "such as addNode, renameSequence etc." )

IMPLEMENT_CONOBJECT(TSShapeConstructor )

ImplementEnumType(TSShapeConstructorAnimType , "\n\n" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )

ImplementEnumType(TSShapeConstructorLodType , "\n\n" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )

ImplementEnumType(TSShapeConstructorUpAxis , "Axis <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> upwards direction when importing from <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Collada.\n\n</a>" "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )

namesEqual(const String & nameA, const String & nameB)

SplitSequencePathAndName(String & srcPath, String & srcName)

   1
   2//-----------------------------------------------------------------------------
   3// Copyright (c) 2012 GarageGames, LLC
   4//
   5// Permission is hereby granted, free of charge, to any person obtaining a copy
   6// of this software and associated documentation files (the "Software"), to
   7// deal in the Software without restriction, including without limitation the
   8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   9// sell copies of the Software, and to permit persons to whom the Software is
  10// furnished to do so, subject to the following conditions:
  11//
  12// The above copyright notice and this permission notice shall be included in
  13// all copies or substantial portions of the Software.
  14//
  15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21// IN THE SOFTWARE.
  22//-----------------------------------------------------------------------------
  23
  24#include "platform/platform.h"
  25#include "ts/tsShapeConstruct.h"
  26
  27#include "ts/tsShapeInstance.h"
  28#include "ts/tsMaterialList.h"
  29#include "console/consoleTypes.h"
  30#include "console/engineAPI.h"
  31#include "core/resourceManager.h"
  32#include "core/stream/bitStream.h"
  33#include "core/stream/fileStream.h"
  34#include "core/stream/memStream.h"
  35#include "core/fileObject.h"
  36
  37#define MAX_PATH_LENGTH 256
  38
  39
  40//#define DEBUG_SPEW
  41
  42ConsoleDocClass( TSShapeConstructor,
  43   "@brief An object used to modify a DTS or COLLADA shape model after it has "
  44   "been loaded by Torque\n\n"
  45   "@ingroup gameObjects\n"
  46);
  47
  48IMPLEMENT_CALLBACK( TSShapeConstructor, onLoad, void, (), (),
  49   "Called immediately after the DTS or DAE file has been loaded; before the "
  50   "shape data is available to any other object (StaticShape, Player etc). This "
  51   "is where you should put any post-load commands to modify the shape in-memory "
  52   "such as addNode, renameSequence etc." )
  53
  54IMPLEMENT_CALLBACK( TSShapeConstructor, onUnload, void, (), (),
  55   "Called when the DTS or DAE resource is flushed from memory. Not normally "
  56   "<a href="/coding/file/tsshapeconstruct_8cpp/#tsshapeconstruct_8cpp_1a21625ca11566389388a748ad1acc0990">required</a>, but may be useful <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> perform cleanup." )
  57
  58ImplementEnumType( TSShapeConstructorUpAxis,
  59   "Axis <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> use <a href="/coding/file/types_8visualc_8h/#types_8visualc_8h_1aad3a54ef5fb260160ec7493483246022">for</a> upwards direction when importing from Collada.\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>"
  60   "@ingroup <a href="/coding/class/classtsshapeconstructor/">TSShapeConstructor</a>" )
  61   { UPAXISTYPE_X_UP,   "X_AXIS" },
  62   { UPAXISTYPE_Y_UP,   "Y_AXIS" },
  63   { UPAXISTYPE_Z_UP,   "Z_AXIS" },
  64   { UPAXISTYPE_COUNT,  "DEFAULT" }
  65EndImplementEnumType;
  66
  67ImplementEnumType( TSShapeConstructorLodType,
  68   "\n\n"
  69   "@ingroup TSShapeConstructor" )
  70   { ColladaUtils::ImportOptions::DetectDTS,       "DetectDTS" },
  71   { ColladaUtils::ImportOptions::SingleSize,      "SingleSize" },
  72   { ColladaUtils::ImportOptions::TrailingNumber,  "TrailingNumber" },
  73EndImplementEnumType;
  74
  75ImplementEnumType(TSShapeConstructorAnimType,
  76   "\n\n"
  77   "@ingroup TSShapeConstructor" )
  78   { ColladaUtils::ImportOptions::FrameCount,      "Frames" },
  79   { ColladaUtils::ImportOptions::Seconds,         "Seconds" },
  80   { ColladaUtils::ImportOptions::Milliseconds,    "Milliseconds" },
  81EndImplementEnumType;
  82
  83
  84//-----------------------------------------------------------------------------
  85
  86String TSShapeConstructor::smCapsuleShapePath("tools/shapes/unit_capsule.dts");
  87String TSShapeConstructor::smCubeShapePath("tools/shapes/unit_cube.dts");
  88String TSShapeConstructor::smSphereShapePath("tools/shapes/unit_sphere.dts");
  89
  90ResourceRegisterPostLoadSignal< TSShape> TSShapeConstructor::_smAutoLoad( &TSShapeConstructor::_onTSShapeLoaded );
  91ResourceRegisterUnloadSignal< TSShape> TSShapeConstructor::_smAutoUnload( &TSShapeConstructor::_onTSShapeUnloaded );
  92
  93void TSShapeConstructor::_onTSShapeLoaded( Resource< TSShape>& resource )
  94{
  95   TSShapeConstructor* ctor = findShapeConstructor( resource.getPath().getFullPath() );
  96   if( ctor )
  97      ctor->_onLoad( resource );
  98
  99   if (ctor && ctor->mShape && ctor->mShape->needsReinit())
 100   {
 101      ctor->mShape->init();
 102   }
 103}
 104
 105void TSShapeConstructor::_onTSShapeUnloaded( const Torque::Path& path, TSShape* shape )
 106{
 107   TSShapeConstructor* ctor = findShapeConstructor( path.getFullPath() );
 108   if( ctor && ( ctor->getShape() == shape ) )
 109      ctor->_onUnload();
 110}
 111
 112// TSShape names are case insensitive
 113static inline bool namesEqual( const String& nameA, const String& nameB )
 114{
 115   return nameA.equal( nameB, String::NoCase );
 116}
 117
 118static void SplitSequencePathAndName( String& srcPath, String& srcName )
 119{
 120   srcName = "";
 121
 122   // Determine if there is a sequence name at the end of the source string, and
 123   // if so, split the filename from the sequence name
 124   S32 split = srcPath.find(' ', 0, String::Right);
 125   S32 split2 = srcPath.find('\t', 0, String::Right);
 126   if ((split == String::NPos) || (split2 > split))
 127      split = split2;
 128   if (split != String::NPos)
 129   {
 130      split2 = split + 1;
 131      while ((srcPath[split2] != '\0') && dIsspace(srcPath[split2]))
 132         split2++;
 133
 134      // now 'split' is at the end of the path, and 'split2' is at the start of the sequence name
 135      srcName = srcPath.substr(split2);
 136      srcPath = srcPath.erase(split, srcPath.length()-split);
 137   }
 138}
 139
 140//-----------------------------------------------------------------------------
 141
 142IMPLEMENT_CONOBJECT(TSShapeConstructor);
 143
 144TSShapeConstructor::TSShapeConstructor()
 145 : mShapePath(""), mLoadingShape(false)
 146{
 147   mOptions.upAxis = UPAXISTYPE_COUNT;
 148   mOptions.unit = -1.0f;
 149   mOptions.lodType = ColladaUtils::ImportOptions::TrailingNumber;
 150   mOptions.singleDetailSize = 2;
 151   mOptions.matNamePrefix = "";
 152   mOptions.alwaysImport = "";
 153   mOptions.neverImport = String(Con::getVariable("$TSShapeConstructor::neverImport"));
 154   mOptions.alwaysImportMesh = "";
 155   mOptions.neverImportMesh = String(Con::getVariable("$TSShapeConstructor::neverImportMesh"));
 156   mOptions.neverImportMat = String(Con::getVariable("$TSShapeConstructor::neverImportMat"));
 157   mOptions.ignoreNodeScale = false;
 158   mOptions.adjustCenter = false;
 159   mOptions.adjustFloor = false;
 160   mOptions.forceUpdateMaterials = false;
 161   mOptions.useDiffuseNames = false;
 162
 163   mOptions.convertLeftHanded = false;
 164   mOptions.calcTangentSpace = false;
 165   mOptions.genUVCoords = false;
 166   mOptions.transformUVCoords = false;
 167   mOptions.flipUVCoords = true;
 168   mOptions.findInstances = false;
 169   mOptions.limitBoneWeights = false;
 170   mOptions.joinIdenticalVerts = true;
 171   mOptions.reverseWindingOrder = true;
 172   mOptions.invertNormals = false;
 173   mOptions.removeRedundantMats = true;
 174   mOptions.animTiming = ColladaUtils::ImportOptions::Seconds;
 175   mOptions.animFPS = 30;
 176   mOptions.formatScaleFactor = 1.0f;
 177
 178   mShape = NULL;
 179}
 180
 181TSShapeConstructor::~TSShapeConstructor()
 182{
 183}
 184
 185bool TSShapeConstructor::addSequenceFromField( void *obj, const char *index, const char *data )
 186{
 187   TSShapeConstructor *pObj = static_cast<TSShapeConstructor*>( obj );
 188
 189   if ( data && data[0] )
 190      pObj->mSequences.push_back( FileName(data) );
 191
 192   return false;
 193}
 194
 195void TSShapeConstructor::initPersistFields()
 196{
 197   addGroup( "Media" );
 198   addField( "baseShape", TypeStringFilename, Offset(mShapePath, TSShapeConstructor),
 199      "Specifies the path to the DTS or DAE file to be operated on by this object.\n"
 200      "Since the TSShapeConstructor script must be in the same folder as the DTS or "
 201      "DAE file, it is recommended to use a relative path so that the shape and "
 202      "script files can be copied to another location without having to modify the "
 203      "path." );
 204   endGroup( "Media" );
 205
 206   addGroup( "Collada" );
 207   addField( "upAxis", TYPEID< domUpAxisType >(), Offset(mOptions.upAxis, TSShapeConstructor),
 208      "Override the <up_axis> element in the COLLADA (.dae) file. No effect for DTS files.\n"
 209      "Set to one of the following values:\n"
 210      "<dl><dt>X_AXIS</dt><dd>Positive X points up. Model will be rotated into Torque's coordinate system (Z up).</dd>"
 211      "<dt>Y_AXIS</dt><dd>Positive Y points up. Model will be rotated into Torque's coordinate system (Z up).</dd>"
 212      "<dt>Z_AXIS</dt><dd>Positive Z points up. No rotation will be applied to the model.</dd>"
 213      "<dt>DEFAULT</dt><dd>The default value. Use the value in the .dae file (defaults to Z_AXIS if the <up_axis> element is not present).</dd></dl>" );
 214
 215   addField( "unit", TypeF32, Offset(mOptions.unit, TSShapeConstructor),
 216      "Override the <unit> element in the COLLADA (.dae) file. No effect for DTS files.\n"
 217      "COLLADA (.dae) files usually contain a <unit> element that indicates the "
 218      "'real world' units that the model is described in. It means you can work "
 219      "in sensible and meaningful units in your modeling app.<br>\n"
 220      "For example, if you were modeling a small object like a cup, it might make "
 221      "sense to work in inches (1 MAX unit = 1 inch), but if you were modeling a "
 222      "building, it might make more sense to work in feet (1 MAX unit = 1 foot). "
 223      "If you export both models to COLLADA, T3D will automatically scale them "
 224      "appropriately. 1 T3D unit = 1 meter, so the cup would be scaled down by 0.0254, "
 225      "and the building scaled down by 0.3048, given them both the correct scale "
 226      "relative to each other.<br>\n"
 227      "Omit the field or set to -1 to use the value in the .dae file (1.0 if the "
 228      "<unit> element is not present)" );
 229
 230   addField( "lodType", TYPEID< ColladaUtils::ImportOptions::eLodType >(), Offset(mOptions.lodType, TSShapeConstructor),
 231      "Control how the COLLADA (.dae) importer interprets LOD in the model. No effect for DTS files.\n"
 232      "Set to one of the following values:\n"
 233      "<dl><dt>DetectDTS</dt><dd>The default value. Instructs the importer to search for a 'baseXXX->startXXX' node hierarchy at the root level. If found, the importer acts as if ''TrailingNumber'' was set. Otherwise, all geometry is imported at a single detail size.</dd>"
 234      "<dt>SingleSize</dt><dd>All geometry is imported at a fixed detail size. Numbers at the end of geometry node's are ignored.</dd>"
 235      "<dt>TrailingNumber</dt><dd>Numbers at the end of geometry node's name are interpreted as the detail size (similar to DTS exporting). Geometry instances with the same base name but different trailing number are grouped into the same object.</dd>"
 236      "<dt>DEFAULT</dt><dd>The default value. Use the value in the .dae file (defaults to Z_AXIS if the <up_axis> element is not present).</dd></dl>" );
 237
 238   addField( "singleDetailSize", TypeS32, Offset(mOptions.singleDetailSize, TSShapeConstructor),
 239      "Sets the detail size when lodType is set to SingleSize. No effect otherwise, and no effect for DTS files.\n"
 240      "@see lodType" );
 241
 242   addField( "matNamePrefix", TypeRealString, Offset(mOptions.matNamePrefix, TSShapeConstructor),
 243      "Prefix to apply to all material map names in the COLLADA (.dae) file. No effect for DTS files.\n"
 244      "This field is useful to avoid material name clashes for exporters that generate generic material "
 245      "names like \"texture0\" or \"material1\"." );
 246
 247   addField( "alwaysImport", TypeRealString, Offset(mOptions.alwaysImport, TSShapeConstructor),
 248      "TAB separated patterns of nodes to import even if in neverImport list. No effect for DTS files.\n"
 249      "Torque allows unwanted nodes in COLLADA (.dae) files to to be ignored "
 250      "during import. This field contains a TAB separated list of patterns to "
 251      "match node names. Any node that matches one of the patterns in the list "
 252      "will <b>always</b> be imported, even if it also matches the neverImport list\n"
 253      "@see neverImport\n\n"
 254      "@tsexample\n"
 255      "singleton TSShapeConstructor(MyShapeDae)\n"
 256      "{\n"
 257      "   baseShape = \"./myShape.dae\";\n"
 258      "   alwaysImport = \"mount*\" TAB \"eye\";\n"
 259      "   neverImport = \"*-PIVOT\";\n"
 260      "}\n"
 261      "@endtsexample" );
 262
 263   addField( "neverImport", TypeRealString, Offset(mOptions.neverImport, TSShapeConstructor),
 264      "TAB separated patterns of nodes to ignore on loading. No effect for DTS files.\n"
 265      "Torque allows unwanted nodes in COLLADA (.dae) files to to be ignored "
 266      "during import. This field contains a TAB separated list of patterns to "
 267      "match node names. Any node that matches one of the patterns in the list will "
 268      "not be imported (unless it matches the alwaysImport list.\n"
 269      "@see alwaysImport" );
 270
 271   addField( "alwaysImportMesh", TypeRealString, Offset(mOptions.alwaysImportMesh, TSShapeConstructor),
 272      "TAB separated patterns of meshes to import even if in neverImportMesh list. No effect for DTS files.\n"
 273      "Torque allows unwanted meshes in COLLADA (.dae) files to to be ignored "
 274      "during import. This field contains a TAB separated list of patterns to "
 275      "match mesh names. Any mesh that matches one of the patterns in the list "
 276      "will <b>always</b> be imported, even if it also matches the neverImportMesh list\n"
 277      "@see neverImportMesh\n\n"
 278      "@tsexample\n"
 279      "singleton TSShapeConstructor(MyShapeDae)\n"
 280      "{\n"
 281      "   baseShape = \"./myShape.dae\";\n"
 282      "   alwaysImportMesh = \"body*\" TAB \"armor\" TAB \"bounds\";\n"
 283      "   neverImportMesh = \"*-dummy\";\n"
 284      "}\n"
 285      "@endtsexample" );
 286
 287   addField( "neverImportMesh", TypeRealString, Offset(mOptions.neverImportMesh, TSShapeConstructor),
 288      "TAB separated patterns of meshes to ignore on loading. No effect for DTS files.\n"
 289      "Torque allows unwanted meshes in COLLADA (.dae) files to to be ignored "
 290      "during import. This field contains a TAB separated list of patterns to "
 291      "match mesh names. Any mesh that matches one of the patterns in the list will "
 292      "not be imported (unless it matches the alwaysImportMesh list.\n"
 293      "@see alwaysImportMesh" );
 294
 295   addField("neverImportMat", TypeRealString, Offset(mOptions.neverImportMat, TSShapeConstructor),
 296      "TAB separated patterns of materials to ignore on loading. No effect for DTS files.\n"
 297      "Torque allows unwanted materials in COLLADA (.dae) files to to be ignored "
 298      "during import. This field contains a TAB separated list of patterns to "
 299      "match material names. Any material that matches one of the patterns in the list will "
 300      "not be imported");
 301
 302   addField( "ignoreNodeScale", TypeBool, Offset(mOptions.ignoreNodeScale, TSShapeConstructor),
 303      "Ignore <scale> elements inside COLLADA <node>s. No effect for DTS files.\n"
 304      "This field is a workaround for certain exporters that generate bad node "
 305      "scaling, and is not usually required." );
 306
 307   addField( "adjustCenter", TypeBool, Offset(mOptions.adjustCenter, TSShapeConstructor),
 308      "Translate COLLADA model on import so the origin is at the center. No effect for DTS files." );
 309
 310   addField( "adjustFloor", TypeBool, Offset(mOptions.adjustFloor, TSShapeConstructor),
 311      "Translate COLLADA model on import so origin is at the (Z axis) bottom of the model. No effect for DTS files.\n"
 312      "This can be used along with adjustCenter to have the origin at the "
 313      "center of the bottom of the model.\n"
 314      "@see adjustCenter" );
 315
 316   addField( "forceUpdateMaterials", TypeBool, Offset(mOptions.forceUpdateMaterials, TSShapeConstructor),
 317      "Forces update of the materials." TORQUE_SCRIPT_EXTENSION " file in the same folder as the COLLADA "
 318      "(.dae) file, even if Materials already exist. No effect for DTS files.\n"
 319      "Normally only Materials that are not already defined are written to materials." TORQUE_SCRIPT_EXTENSION "." );
 320
 321   // Fields added for assimp options
 322   addField( "convertLeftHanded", TypeBool, Offset(mOptions.convertLeftHanded, TSShapeConstructor),
 323      "Convert to left handed coordinate system." );
 324   addField( "calcTangentSpace", TypeBool, Offset(mOptions.calcTangentSpace, TSShapeConstructor),
 325      "Calculate tangents and bitangents, if possible." );
 326   addField( "genUVCoords", TypeBool, Offset(mOptions.genUVCoords, TSShapeConstructor),
 327      "Convert spherical, cylindrical, box and planar mapping to proper UVs." );
 328   addField( "transformUVCoords", TypeBool, Offset(mOptions.transformUVCoords, TSShapeConstructor),
 329      "Preprocess UV transformations (scaling, translation ...)." );
 330   addField( "flipUVCoords", TypeBool, Offset(mOptions.flipUVCoords, TSShapeConstructor),
 331      "This step flips all UV coordinates along the y-axis and adjusts material settings and bitangents accordingly.\n"
 332      "Assimp uses TL(0,0):BR(1,1). T3D uses TL(0,1):BR(1,0). This will be needed for most textured models." );
 333   addField( "findInstances", TypeBool, Offset(mOptions.findInstances, TSShapeConstructor),
 334      "Search for instanced meshes and remove them by references to one master." );
 335   addField( "limitBoneWeights", TypeBool, Offset(mOptions.limitBoneWeights, TSShapeConstructor),
 336      "Limit bone weights to 4 per vertex." );
 337   addField( "joinIdenticalVerts", TypeBool, Offset(mOptions.joinIdenticalVerts, TSShapeConstructor),
 338      "Identifies and joins identical vertex data sets within all imported meshes." );
 339   addField( "reverseWindingOrder", TypeBool, Offset(mOptions.reverseWindingOrder, TSShapeConstructor),
 340      "This step adjusts the output face winding order to be clockwise. The default assimp face winding order is counter clockwise." );
 341   addField( "invertNormals", TypeBool, Offset(mOptions.invertNormals, TSShapeConstructor),
 342      "Reverse the normal vector direction for all normals." );
 343   addField( "removeRedundantMats", TypeBool, Offset(mOptions.removeRedundantMats, TSShapeConstructor),
 344      "Removes redundant materials." );
 345   addField( "animTiming", TYPEID< ColladaUtils::ImportOptions::eAnimTimingType >(), Offset(mOptions.animTiming, TSShapeConstructor),
 346      "How to import timing data as frames, seconds or milliseconds." );
 347   addField("animFPS", TypeS32, Offset(mOptions.animFPS, TSShapeConstructor),
 348      "FPS value to use if timing is set in frames and the animations does not have an fps set.");
 349   endGroup( "Collada" );
 350
 351   addGroup( "Sequences" );
 352   addProtectedField( "sequence", TypeStringFilename, NULL, &addSequenceFromField, &emptyStringProtectedGetFn,
 353      "Legacy method of adding sequences to a DTS or DAE shape after loading.\n\n"
 354      "@tsexample\n"
 355      "singleton TSShapeConstructor(MyShapeDae)\n"
 356      "{\n"
 357      "   baseShape = \"./myShape.dae\";\n"
 358      "   sequence = \"../anims/root.dae root\";\n"
 359      "   sequence = \"../anims/walk.dae walk\";\n"
 360      "   sequence = \"../anims/jump.dsq jump\";\n"
 361      "}\n"
 362      "@endtsexample" );
 363   endGroup( "Sequences" );
 364
 365   Parent::initPersistFields();
 366}
 367
 368void TSShapeConstructor::consoleInit()
 369{
 370   Parent::consoleInit();
 371
 372   Con::addVariable( "$pref::TSShapeConstructor::CapsuleShapePath", TypeRealString, &TSShapeConstructor::smCapsuleShapePath, 
 373      "The file path to the capsule shape used by tsMeshFit.\n\n"
 374      "@ingroup MeshFit\n" );
 375
 376   Con::addVariable( "$pref::TSShapeConstructor::CubeShapePath", TypeRealString, &TSShapeConstructor::smCubeShapePath, 
 377      "The file path to the cube shape used by tsMeshFit.\n\n"
 378      "@ingroup MeshFit\n" );
 379
 380   Con::addVariable( "$pref::TSShapeConstructor::SphereShapePath", TypeRealString, &TSShapeConstructor::smSphereShapePath, 
 381      "The file path to the sphere shape used by tsMeshFit.\n\n"
 382      "@ingroup MeshFit\n" );
 383}
 384
 385TSShapeConstructor* TSShapeConstructor::findShapeConstructor(const FileName& path)
 386{
 387   SimGroup *group;
 388   if (Sim::findObject( "TSShapeConstructorGroup", group ))
 389   {
 390      // Find the TSShapeConstructor object for the given shape file
 391      for (S32 i = 0; i < group->size(); i++)
 392      {
 393         TSShapeConstructor* tss = dynamic_cast<TSShapeConstructor*>( group->at(i) );
 394         FileName shapePath = tss->mShapePath;
 395
 396         char buf[1024];
 397         FileName fullShapePath = String(Platform::makeFullPathName(shapePath, buf, sizeof(buf)));
 398         if (shapePath.equal( path, String::NoCase ) || fullShapePath.equal(path, String::NoCase))
 399            return tss;
 400      }
 401   }
 402   return NULL;
 403}
 404
 405//-----------------------------------------------------------------------------
 406bool TSShapeConstructor::onAdd()
 407{
 408   if ( !Parent::onAdd() )
 409      return false;
 410
 411   // Prevent multiple objects pointing at the same shape file
 412   TSShapeConstructor* tss = findShapeConstructor( mShapePath );
 413   if ( tss )
 414   {
 415      Con::errorf("TSShapeConstructor::onAdd failed: %s is already referenced by "
 416         "another TSShapeConstructor object (%s - %d)", mShapePath.c_str(),
 417         tss->getName(), tss->getId());
 418      return false;
 419   }
 420
 421   // Add to the TSShapeConstructor group (for lookups)
 422   SimGroup *group;
 423   if ( !Sim::findObject( "TSShapeConstructorGroup", group ) )
 424   {
 425      group = new SimGroup();
 426      if ( !group->registerObject("TSShapeConstructorGroup") )
 427      {
 428         SAFE_DELETE(group);
 429
 430         Con::errorf("TSShapeConstructor::onAdd failed: Could not register "
 431            "TSShapeConstructorGroup");
 432         return false;
 433      }
 434      Sim::getRootGroup()->addObject( group );
 435   }
 436   group->addObject( this );
 437
 438   // This is only here for backwards compatibility!
 439   //
 440   // If we have no sequences, it may be using the older sequence# syntax.
 441   // Check for dynamic fields of that pattern and add them into the sequence vector.
 442   if ( mSequences.empty() )
 443   {
 444      for ( U32 idx = 0; idx < MaxLegacySequences; idx++ )
 445      {
 446         String field = String::ToString( "sequence%d", idx );
 447         const char *data = getDataField( StringTable->insert(field.c_str()), NULL );
 448
 449         // Break at first field not used
 450         if ( !data || !data[0] )
 451            break;
 452
 453         // By pushing the field thru Con::setData for TypeStringFilename
 454         // we get the default filename expansion.  If we didn't do this
 455         // then we would have unexpanded ~/ in the file paths.
 456         String expanded;
 457         Con::setData( TypeStringFilename, &expanded, 0, 1, &data );
 458         addSequenceFromField( this, NULL, expanded.c_str() );
 459      }
 460   }
 461
 462   // If an instance of this shape has already been loaded, call onLoad now
 463   Resource<TSShape> shape = ResourceManager::get().find( mShapePath );
 464
 465   if ( shape )
 466      _onLoad( shape );
 467
 468   if (mShape && mShape->needsReinit())
 469   {
 470      mShape->init();
 471   }
 472
 473   return true;
 474}
 475
 476//-----------------------------------------------------------------------------
 477
 478void TSShapeConstructor::_onLoad(TSShape* shape)
 479{
 480   // Check if we should unload first
 481   if ( mShape )
 482      _onUnload();
 483
 484   #ifdef DEBUG_SPEW
 485   Con::printf( "[TSShapeConstructor] attaching to shape '%s'", mShapePath.c_str() );
 486   #endif
 487
 488   mShape = shape;
 489   mChangeSet.clear();
 490   mLoadingShape = true;
 491
 492   // Add sequences defined using field syntax
 493   for ( S32 i = 0; i < mSequences.size(); i++ )
 494   {
 495      if ( mSequences[i].isEmpty() )
 496         continue;
 497
 498      // Split the sequence path from the target sequence name
 499      String destName;
 500      String srcPath( mSequences[i] );
 501      SplitSequencePathAndName( srcPath, destName );
 502
 503      addSequence( srcPath, destName );
 504   }
 505
 506   // Call script function
 507   onLoad_callback();
 508   mLoadingShape = false;
 509}
 510
 511//-----------------------------------------------------------------------------
 512
 513void TSShapeConstructor::_onUnload()
 514{
 515   #ifdef DEBUG_SPEW
 516   Con::printf( "[TSShapeConstructor] detaching from '%s'", mShapePath.c_str() );
 517   #endif
 518
 519   onUnload_callback();
 520
 521   mShape = NULL;
 522}
 523
 524//-----------------------------------------------------------------------------
 525// Storage
 526
 527bool TSShapeConstructor::writeField(StringTableEntry fieldname, const char *value)
 528{
 529   // Ignore the sequence fields (these are written as 'addSequence' commands instead)
 530   if ( dStrnicmp( fieldname, "sequence", 8 ) == 0 )
 531      return false;
 532   else if ( dStrnicmp( fieldname, "baseShape", 9 ) == 0 )
 533   {
 534      // Small hack to only write the base filename (no path) since the
 535      // TSShapeConstructor script must be in the same folder as the model, and
 536      // then we can easily copy both around without having to change the field
 537      const char* filename = dStrrchr( value, '/' );
 538      if ( filename > value )
 539      {
 540         S32 len = dStrlen( filename );
 541         dMemmove((void*)(value + 1), filename, len );
 542         ((char*)value)[0] = '.';
 543         ((char*)value)[len + 1] = '\0';
 544      }
 545      return true;
 546   }
 547
 548   return Parent::writeField( fieldname, value );
 549}
 550
 551//-----------------------------------------------------------------------------
 552// Console utility methods
 553
 554// These macros take care of doing node, sequence and object lookups, including
 555// printing error messages to the console if the element cannot be found.
 556
 557// Check that the given index is valid (0 - max-1). If not, generate an
 558// error and return.
 559#define CHECK_INDEX_IN_RANGE(func, index, maxIndex, ret)             \
 560   if ( ( index < 0 ) || ( index >= maxIndex ) )                     \
 561   {                                                                 \
 562      Con::errorf( "TSShapeConstructor::" #func ": index out of "    \
 563         "range (0-%d)", maxIndex-1);                                \
 564      return ret;                                                    \
 565   }
 566
 567// Do a node lookup and allow the root node name ("")
 568#define GET_NODE_INDEX_ALLOW_ROOT(func, var, name, ret)              \
 569   S32 var##Index = -1;                                              \
 570   if (name[0])                                                      \
 571   {                                                                 \
 572      var##Index = mShape->findNode(name);                           \
 573      if (var##Index < 0)                                            \
 574      {                                                              \
 575         Con::errorf( "TSShapeConstructor::" #func ": Could not "    \
 576            "find node '%s'", name);                                 \
 577         return ret;                                                 \
 578      }                                                              \
 579   }                                                                 \
 580   TSShape::Node* var = var##Index < 0 ? NULL : &(mShape->nodes[var##Index]); \
 581   TORQUE_UNUSED(var##Index);                                        \
 582   TORQUE_UNUSED(var)
 583
 584// Do a node lookup, root node ("") is not allowed
 585#define GET_NODE_INDEX_NO_ROOT(func, var, name, ret)                 \
 586   S32 var##Index = mShape->findNode(name);                          \
 587   if (var##Index < 0)                                               \
 588   {                                                                 \
 589      Con::errorf( "TSShapeConstructor::" #func ": Could not find "  \
 590         "node '%s'", name);                                         \
 591      return ret;                                                    \
 592   }                                                                 \
 593   TSShape::Node* var = &(mShape->nodes[var##Index]);                \
 594   TORQUE_UNUSED(var##Index);                                        \
 595   TORQUE_UNUSED(var)
 596
 597// Do an object lookup
 598#define GET_OBJECT(func, var, name, ret)                             \
 599   S32 var##Index = mShape->findObject(name);                        \
 600   if (var##Index < 0)                                               \
 601   {                                                                 \
 602      Con::errorf( "TSShapeConstructor::" #func ": Could not find "  \
 603         "object '%s'", name);                                       \
 604      return ret;                                                    \
 605   }                                                                 \
 606   TSShape::Object* var = &(mShape->objects[var##Index]);            \
 607   TORQUE_UNUSED(var##Index);                                        \
 608   TORQUE_UNUSED(var)
 609
 610// Do a mesh lookup
 611#define GET_MESH(func, var, name, ret)                               \
 612   TSMesh* var = mShape->findMesh(name);                             \
 613   if (!var)                                                         \
 614   {                                                                 \
 615      Con::errorf( "TSShapeConstructor::" #func ": Could not find "  \
 616         "mesh '%s'", name);                                         \
 617      return ret;                                                    \
 618   }
 619
 620// Do a sequence lookup
 621#define GET_SEQUENCE(func, var, name, ret)                           \
 622   S32 var##Index = mShape->findSequence(name);                      \
 623   if (var##Index < 0)                                               \
 624   {                                                                 \
 625      Con::errorf( "TSShapeConstructor::" #func ": Could not find "  \
 626         "sequence named '%s'", name);                               \
 627      return ret;                                                    \
 628   }                                                                 \
 629   TSShape::Sequence* var = &(mShape->sequences[var##Index]);        \
 630   TORQUE_UNUSED(var##Index);                                        \
 631   TORQUE_UNUSED(var);
 632
 633
 634//-----------------------------------------------------------------------------
 635// DUMP
 636DefineTSShapeConstructorMethod( dumpShape, void, ( const char* filename ), ( "" ),
 637   ( filename ),,
 638   "Dump the shape hierarchy to the console or to a file. Useful for reviewing "
 639   "the result of a series of construction commands.\n"
 640   "@param filename Destination filename. If not specified, dump to console.\n\n"
 641   "@tsexample\n"
 642   "%this.dumpShape();               // dump to console\n"
 643   "%this.dumpShape( \"./dump.txt\" ); // dump to file\n"
 644   "@endtsexample\n" )
 645{
 646   TSShapeInstance* tsi = new TSShapeInstance( mShape, false );
 647
 648   if ( dStrEqual( filename, "" ) )
 649   {
 650      // Dump the constructed shape to a memory stream
 651      MemStream* dumpStream = new MemStream( 8192 );
 652      tsi->dump( *dumpStream );
 653
 654      // Write stream to the console
 655      U32 end = dumpStream->getPosition();
 656      dumpStream->setPosition( 0 );
 657      while ( dumpStream->getPosition() < end )
 658      {
 659         char line[1024];
 660         dumpStream->readLine( (U8*)line, sizeof(line) );
 661         Con::printf( line );
 662      }
 663
 664      delete dumpStream;
 665   }
 666   else
 667   {
 668      // Dump constructed shape to file
 669      char filenameBuf[1024];
 670      Con::expandScriptFilename( filenameBuf, sizeof(filenameBuf), filename );
 671
 672      FileStream* dumpStream = new FileStream;
 673      if ( dumpStream->open( filenameBuf, Torque::FS::File::Write ) )
 674      {
 675         tsi->dump( *dumpStream );
 676         dumpStream->close();
 677      }
 678      else
 679         Con::errorf( "dumpShape failed: Could not open file '%s' for writing", filenameBuf );
 680
 681      delete dumpStream;
 682   }
 683
 684   delete tsi;
 685}}
 686
 687DefineTSShapeConstructorMethod( saveShape, void, ( const char* filename ),,
 688   ( filename ),,
 689   "Save the shape (with all current changes) to a new DTS file.\n"
 690   "@param filename Destination filename.\n\n"
 691   "@tsexample\n"
 692   "%this.saveShape( \"./myShape.dts\" );\n"
 693   "@endtsexample\n" )
 694{
 695   char filenameBuf[1024];
 696   Con::expandScriptFilename( filenameBuf, sizeof(filenameBuf), filename );
 697
 698   FileStream* dtsStream = new FileStream;
 699   if ( dtsStream->open( filenameBuf, Torque::FS::File::Write ) )
 700   {
 701      mShape->write( dtsStream );
 702      dtsStream->close();
 703   }
 704   else
 705   {
 706      Con::errorf( "saveShape failed: Could not open '%s' for writing", filenameBuf );
 707   }
 708   delete dtsStream;
 709}}
 710
 711DefineTSShapeConstructorMethod( writeChangeSet, void, (),,
 712   (),,
 713   "Write the current change set to a TSShapeConstructor script file. The "
 714   "name of the script file is the same as the model, but with ." TORQUE_SCRIPT_EXTENSION " extension. "
 715   "eg. myShape." TORQUE_SCRIPT_EXTENSION " for myShape.dts or myShape.dae.\n" )
 716{
 717   Torque::Path scriptPath( mShapePath );
 718   scriptPath.setExtension(TORQUE_SCRIPT_EXTENSION);
 719
 720   // Read current file contents
 721   FileObject f;
 722   f.readMemory( scriptPath.getFullPath() );
 723
 724   // Write new file
 725   FileStream *stream;
 726   if ((stream = FileStream::createAndOpen( scriptPath.getFullPath(), Torque::FS::File::Write )) == NULL)
 727   {
 728      Con::errorf( "Failed to write TSShapeConstructor change set to %s", scriptPath.getFullPath().c_str() );
 729      return;
 730   }
 731
 732   // Write existing file contents up to the start of the onLoad function
 733   String beginMessage( avar( "function %s::onLoad(%%this)", getName() ) );
 734   String endMessage( "}" );
 735
 736   while ( !f.isEOF() )
 737   {
 738      const char* buffer = (const char *) f.readLine();
 739      if ( !String::compare( buffer, beginMessage ))
 740         break;
 741      stream->writeText( buffer );
 742      stream->writeText( "\r\n" );
 743   }
 744
 745   // Write the new contents
 746   if ( f.isEOF() )
 747      stream->writeText( "\r\n" );
 748   stream->writeText( beginMessage );
 749   stream->writeText( "\r\n{\r\n" );
 750
 751   mChangeSet.write( mShape, *stream, scriptPath.getPath() );
 752
 753   stream->writeText( endMessage );
 754   stream->writeText( "\r\n" );
 755
 756   // Now skip the contents of the function
 757   while ( !f.isEOF() )
 758   {
 759      const char* buffer = (const char *) f.readLine();
 760      if ( !String::compare( buffer, endMessage ))
 761         break;
 762   }
 763
 764   // Write the remainder of the existing file contents
 765   while( !f.isEOF() )
 766   {
 767      const char* buffer = (const char *) f.readLine();
 768      stream->writeText( buffer );
 769      stream->writeText( "\r\n" );
 770   }
 771
 772   delete stream;
 773}}
 774
 775DefineTSShapeConstructorMethod( notifyShapeChanged, void, (),,
 776   (),,
 777   "Notify game objects that this shape file has changed, allowing them to update "
 778   "internal data if needed." )
 779{
 780   ResourceManager::get().getChangedSignal().trigger( mShapePath );
 781}}
 782
 783//-----------------------------------------------------------------------------
 784// NODES
 785DefineTSShapeConstructorMethod( getNodeCount, S32, (),,
 786   (), 0,
 787   "Get the total number of nodes in the shape.\n"
 788   "@return the number of nodes in the shape.\n\n"
 789   "@tsexample\n"
 790   "%count = %this.getNodeCount();\n"
 791   "@endtsexample\n" )
 792{
 793   return mShape->nodes.size();
 794}}
 795
 796DefineTSShapeConstructorMethod( getNodeIndex, S32, ( const char* name ),,
 797   ( name ), -1,
 798   "Get the index of the node.\n"
 799   "@param name name of the node to lookup.\n"
 800   "@return the index of the named node, or -1 if no such node exists.\n\n"
 801   "@tsexample\n"
 802   "// get the index of Bip01 Pelvis node in the shape\n"
 803   "%index = %this.getNodeIndex( \"Bip01 Pelvis\" );\n"
 804   "@endtsexample\n" )
 805{
 806   return mShape->findNode( name );
 807}}
 808
 809DefineTSShapeConstructorMethod( getNodeName, const char*, ( S32 index ),,
 810   ( index ), "",
 811   "Get the name of the indexed node.\n"
 812   "@param index index of the node to lookup (valid range is 0 - getNodeCount()-1).\n"
 813   "@return the name of the indexed node, or \"\" if no such node exists.\n\n"
 814   "@tsexample\n"
 815   "// print the names of all the nodes in the shape\n"
 816   "%count = %this.getNodeCount();\n"
 817   "for (%i = 0; %i < %count; %i++)\n"
 818   "   echo(%i SPC %this.getNodeName(%i));\n"
 819   "@endtsexample\n" )
 820{
 821   CHECK_INDEX_IN_RANGE( getNodeName, index, mShape->nodes.size(), "" );
 822   return mShape->getName( mShape->nodes[index].nameIndex );
 823}}
 824
 825DefineTSShapeConstructorMethod( getNodeParentName, const char*, ( const char* name ),,
 826   ( name ), "",
 827   "Get the name of the node's parent. If the node has no parent (ie. it is at "
 828   "the root level), return an empty string.\n"
 829   "@param name name of the node to query.\n"
 830   "@return the name of the node's parent, or \"\" if the node is at the root level\n\n"
 831   "@tsexample\n"
 832   "echo( \"Bip01 Pelvis parent = \" @ %this.getNodeParentName( \"Bip01 Pelvis \") );\n"
 833   "@endtsexample\n" )
 834{
 835   GET_NODE_INDEX_NO_ROOT( getNodeParentName, node, name, "" );
 836
 837   if ( node->parentIndex < 0 )
 838      return "";
 839   else
 840      return mShape->getName( mShape->nodes[node->parentIndex].nameIndex );
 841}}
 842
 843DefineTSShapeConstructorMethod( setNodeParent, bool, ( const char* name, const char* parentName ),,
 844   ( name, parentName ), false,
 845  "Set the parent of a node.\n"
 846  "@param name name of the node to modify\n"
 847  "@param parentName name of the parent node to set (use \"\" to move the node to the root level)\n"
 848  "@return true if successful, false if failed\n\n"
 849  "@tsexample\n"
 850  "%this.setNodeParent( \"Bip01 Pelvis\", \"start01\" );\n"
 851  "@endtsexample\n" )
 852{
 853   GET_NODE_INDEX_NO_ROOT( setNodeParent, node, name, false );
 854   GET_NODE_INDEX_ALLOW_ROOT( setNodeParent, parent, parentName, false );
 855
 856   node->parentIndex = parentIndex;
 857   ADD_TO_CHANGE_SET();
 858
 859   return true;
 860}}
 861
 862DefineTSShapeConstructorMethod( getNodeChildCount, S32, ( const char* name ),,
 863   ( name ), 0,
 864   "Get the number of children of this node.\n"
 865   "@param name name of the node to query.\n"
 866   "@return the number of child nodes.\n\n"
 867   "@tsexample\n"
 868   "%count = %this.getNodeChildCount( \"Bip01 Pelvis\" );\n"
 869   "@endtsexample\n" )
 870{
 871   GET_NODE_INDEX_ALLOW_ROOT( getNodeChildCount, node, name, 0 );
 872
 873   Vector<S32> nodeChildren;
 874   mShape->getNodeChildren( nodeIndex, nodeChildren );
 875   return nodeChildren.size();
 876}}
 877
 878DefineTSShapeConstructorMethod( getNodeChildName, const char*, ( const char* name, S32 index ),,
 879   ( name, index ), "",
 880   "Get the name of the indexed child node.\n"
 881   "@param name name of the parent node to query.\n"
 882   "@param index index of the child node (valid range is 0 - getNodeChildName()-1).\n"
 883   "@return the name of the indexed child node.\n\n"
 884   "@tsexample\n"
 885   "function dumpNode( %shape, %name, %indent )\n"
 886   "{\n"
 887   "   echo( %indent @ %name );\n"
 888   "   %count = %shape.getNodeChildCount( %name );\n"
 889   "   for ( %i = 0; %i < %count; %i++ )\n"
 890   "      dumpNode( %shape, %shape.getNodeChildName( %name, %i ), %indent @ \"   \" );\n"
 891   "}\n\n"
 892   "function dumpShape( %shape )\n"
 893   "{\n"
 894   "   // recursively dump node hierarchy\n"
 895   "   %count = %shape.getNodeCount();\n"
 896   "   for ( %i = 0; %i < %count; %i++ )\n"
 897   "   {\n"
 898   "      // dump top level nodes\n"
 899   "      %name = %shape.getNodeName( %i );\n"
 900   "      if ( %shape.getNodeParentName( %name ) $= "" )\n"
 901   "         dumpNode( %shape, %name, \"\" );\n"
 902   "   }\n"
 903   "}\n"
 904   "@endtsexample\n" )
 905{
 906   GET_NODE_INDEX_ALLOW_ROOT( getNodeChildName, node, name, "" );
 907
 908   Vector<S32> nodeChildren;
 909   mShape->getNodeChildren( nodeIndex, nodeChildren );
 910   CHECK_INDEX_IN_RANGE( getNodeChildName, index, nodeChildren.size(), "" );
 911
 912   return mShape->getName( mShape->nodes[nodeChildren[index]].nameIndex );
 913}}
 914
 915DefineTSShapeConstructorMethod( getNodeObjectCount, S32, ( const char* name ),,
 916   ( name ), 0,
 917   "Get the number of geometry objects attached to this node.\n"
 918   "@param name name of the node to query.\n"
 919   "@return the number of attached objects.\n\n"
 920   "@tsexample\n"
 921   "%count = %this.getNodeObjectCount( \"Bip01 Head\" );\n"
 922   "@endtsexample\n" )
 923{
 924   GET_NODE_INDEX_ALLOW_ROOT( getNodeObjectCount, node, name, 0 );
 925
 926   Vector<S32> nodeObjects;
 927   mShape->getNodeObjects( nodeIndex, nodeObjects );
 928   return nodeObjects.size();
 929}}
 930
 931DefineTSShapeConstructorMethod( getNodeObjectName, const char*, ( const char* name, S32 index ),,
 932   ( name, index ), "",
 933   "Get the name of the indexed object.\n"
 934   "@param name name of the node to query.\n"
 935   "@param index index of the object (valid range is 0 - getNodeObjectCount()-1).\n"
 936   "@return the name of the indexed object.\n\n"
 937   "@tsexample\n"
 938   "// print the names of all objects attached to the node\n"
 939   "%count = %this.getNodeObjectCount( \"Bip01 Head\" );\n"
 940   "for ( %i = 0; %i < %count; %i++ )\n"
 941   "   echo( %this.getNodeObjectName( \"Bip01 Head\", %i ) );\n"
 942   "@endtsexample\n" )
 943{
 944   GET_NODE_INDEX_ALLOW_ROOT( getNodeObjectName, node, name, "" );
 945
 946   Vector<S32> nodeObjects;
 947   mShape->getNodeObjects( nodeIndex, nodeObjects );
 948   CHECK_INDEX_IN_RANGE( getNodeObjectName, index, nodeObjects.size(), "" );
 949
 950   return mShape->getName( mShape->objects[nodeObjects[index]].nameIndex );
 951}}
 952
 953DefineTSShapeConstructorMethod( getNodeTransform, TransformF, ( const char* name, bool isWorld ), ( false ),
 954   ( name, isWorld ), TransformF::Identity,
 955   "Get the base (ie. not animated) transform of a node.\n"
 956   "@param name name of the node to query.\n"
 957   "@param isWorld true to get the global transform, false (or omitted) to get "
 958   "the local-to-parent transform.\n"
 959   "@return the node transform in the form \"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\".\n\n"
 960   "@tsexample\n"
 961   "%ret = %this.getNodeTransform( \"mount0\" );\n"
 962   "%this.setNodeTransform( \"mount4\", %ret );\n"
 963   "@endtsexample\n" )
 964{
 965   GET_NODE_INDEX_NO_ROOT( getNodeTransform, node, name, TransformF::Identity );
 966
 967   // Get the node transform
 968   Point3F pos;
 969   AngAxisF aa;
 970
 971   if ( isWorld )
 972   {
 973      // World transform
 974      MatrixF mat;
 975      mShape->getNodeWorldTransform( nodeIndex, &mat );
 976      pos = mat.getPosition();
 977      aa.set( mat );
 978   }
 979   else
 980   {
 981      // Local transform
 982      pos = mShape->defaultTranslations[nodeIndex];
 983      const Quat16& q16 = mShape->defaultRotations[nodeIndex];
 984      aa.set( q16.getQuatF() );
 985   }
 986
 987   return TransformF( pos, aa );
 988}}
 989
 990DefineTSShapeConstructorMethod( setNodeTransform, bool, ( const char* name, TransformF txfm, bool isWorld ), ( false ),
 991   ( name, txfm, isWorld ), false,
 992   "Set the base transform of a node. That is, the transform of the node when "
 993   "in the root (not-animated) pose.\n"
 994   "@param name name of the node to modify\n"
 995   "@param txfm transform string of the form: \"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n"
 996   "@param isworld (optional) flag to set the local-to-parent or the global "
 997   "transform. If false, or not specified, the position and orientation are "
 998   "treated as relative to the node's parent.\n"
 999   "@return true if successful, false otherwise\n\n"
1000   "@tsexample\n"
1001   "%this.setNodeTransform( \"mount0\", \"0 0 1 0 0 1 0\" );\n"
1002   "%this.setNodeTransform( \"mount0\", \"0 0 0 0 0 1 1.57\" );\n"
1003   "%this.setNodeTransform( \"mount0\", \"1 0 0 0 0 1 0\", true );\n"
1004   "@endtsexample\n" )
1005{
1006   GET_NODE_INDEX_NO_ROOT( setNodeTransform, node, name, false );
1007
1008   Point3F pos( txfm.getPosition() );
1009   QuatF rot( txfm.getOrientation() );
1010
1011   if ( isWorld )
1012   {
1013      // World transform
1014
1015      // Get the node's parent (if any)
1016      if ( node->parentIndex != -1 )
1017      {
1018         MatrixF mat;
1019         mShape->getNodeWorldTransform( node->parentIndex, &mat );
1020
1021         // Pre-multiply by inverse of parent's world transform to get
1022         // local node transform
1023         mat.inverse();
1024         mat.mul( txfm.getMatrix() );
1025
1026         rot.set( mat );
1027         pos = mat.getPosition();
1028      }
1029   }
1030
1031   if ( !mShape->setNodeTransform( name, pos, rot) )
1032      return false;
1033
1034   ADD_TO_CHANGE_SET();
1035   return true;
1036}}
1037
1038DefineTSShapeConstructorMethod( renameNode, bool, ( const char* oldName, const char* newName ),,
1039   ( oldName, newName ), false,
1040   "Rename a node.\n"
1041   "@note Note that node names must be unique, so this command will fail if "
1042   "there is already a node with the desired name\n"
1043   "@param oldName current name of the node\n"
1044   "@param newName new name of the node\n"
1045   "@return true if successful, false otherwise\n\n"
1046   "@tsexample\n"
1047   "%this.renameNode( \"Bip01 L Hand\", \"mount5\" );\n"
1048   "@endtsexample\n" )
1049{
1050   GET_NODE_INDEX_NO_ROOT( renameNode, node, oldName, false );
1051
1052   if ( !mShape->renameNode( oldName, newName ) )
1053      return false;
1054
1055   ADD_TO_CHANGE_SET();
1056   return true;
1057}}
1058
1059DefineTSShapeConstructorMethod( addNode, bool, ( const char* name, const char* parentName, TransformF txfm, bool isWorld ), ( TransformF::Identity, false ),
1060   ( name, parentName, txfm, isWorld ), false,
1061   "Add a new node.\n"
1062   "@param name name for the new node (must not already exist)\n"
1063   "@param parentName name of an existing node to be the parent of the new node. "
1064   "If empty (\"\"), the new node will be at the root level of the node hierarchy.\n"
1065   "@param txfm (optional) transform string of the form: \"pos.x pos.y pos.z rot.x rot.y rot.z rot.angle\"\n"
1066   "@param isworld (optional) flag to set the local-to-parent or the global "
1067   "transform. If false, or not specified, the position and orientation are "
1068   "treated as relative to the node's parent.\n"
1069   "@return true if successful, false otherwise\n\n"
1070   "@tsexample\n"
1071   "%this.addNode( \"Nose\", \"Bip01 Head\", \"0 2 2 0 0 1 0\" );\n"
1072   "%this.addNode( \"myRoot\", \"\", \"0 0 4 0 0 1 1.57\" );\n"
1073   "%this.addNode( \"Nodes\", \"Bip01 Head\", \"0 2 0 0 0 1 0\", true );\n"
1074   "@endtsexample\n" )
1075{
1076   Point3F pos( txfm.getPosition() );
1077   QuatF rot( txfm.getOrientation() );
1078
1079   if ( isWorld )
1080   {
1081      // World transform
1082
1083      // Get the node's parent (if any)
1084      S32 parentIndex = mShape->findNode( parentName );
1085      if ( parentIndex != -1 )
1086      {
1087         MatrixF mat;
1088         mShape->getNodeWorldTransform( parentIndex, &mat );
1089
1090         // Pre-multiply by inverse of parent's world transform to get
1091         // local node transform
1092         mat.inverse();
1093         mat.mul( txfm.getMatrix() );
1094
1095         rot.set( mat );
1096         pos = mat.getPosition();
1097      }
1098   }
1099
1100   if ( !mShape->addNode( name, parentName, pos, rot ) )
1101      return false;
1102
1103   ADD_TO_CHANGE_SET();
1104   return true;
1105}}
1106
1107DefineTSShapeConstructorMethod( removeNode, bool, ( const char* name ),,
1108   ( name ), false,
1109   "Remove a node from the shape.\n"
1110   "The named node is removed from the shape, including from any sequences that "
1111   "use the node. Child nodes and objects attached to the node are re-assigned "
1112   "to the node's parent.\n"
1113   "@param name name of the node to remove.\n"
1114   "@return true if successful, false otherwise.\n\n"
1115   "@tsexample\n"
1116   "%this.removeNode( \"Nose\" );\n"
1117   "@endtsexample\n" )
1118{
1119   GET_NODE_INDEX_NO_ROOT( removeNode, node, name, false );
1120
1121   if ( !mShape->removeNode( name ) )
1122      return false;
1123
1124   ADD_TO_CHANGE_SET();
1125   return true;
1126}}
1127
1128//-----------------------------------------------------------------------------
1129// MATERIALS
1130
1131DefineTSShapeConstructorMethod( getTargetCount, S32, (),, (), 0,
1132   "Get the number of materials in the shape.\n"
1133   "@return the number of materials in the shape.\n\n"
1134   "@tsexample\n"
1135   "%count = %this.getTargetCount();\n"
1136   "@endtsexample\n" )
1137{
1138   return mShape->getTargetCount();
1139}}
1140
1141DefineTSShapeConstructorMethod( getTargetName, const char*, ( S32 index ),,
1142   ( index ), "",
1143   "Get the name of the indexed shape material.\n"
1144   "@param index index of the material to get (valid range is 0 - getTargetCount()-1).\n"
1145   "@return the name of the indexed material.\n\n"
1146   "@tsexample\n"
1147   "%count = %this.getTargetCount();\n"
1148   "for ( %i = 0; %i < %count; %i++ )\n"
1149   "   echo( \"Target \" @ %i @ \": \" @ %this.getTargetName( %i ) );\n"
1150   "@endtsexample\n" )
1151{
1152   return mShape->getTargetName( index );
1153}}
1154
1155//-----------------------------------------------------------------------------
1156// OBJECTS
1157
1158DefineTSShapeConstructorMethod( getObjectCount, S32, (),, (), 0,
1159   "Get the total number of objects in the shape.\n"
1160   "@return the number of objects in the shape.\n\n"
1161   "@tsexample\n"
1162   "%count = %this.getObjectCount();\n"
1163   "@endtsexample\n" )
1164{
1165   return mShape->objects.size();
1166}}
1167
1168DefineTSShapeConstructorMethod( getObjectName, const char*, ( S32 index ),,
1169   ( index ), "",
1170   "Get the name of the indexed object.\n"
1171   "@param index index of the object to get (valid range is 0 - getObjectCount()-1).\n"
1172   "@return the name of the indexed object.\n\n"
1173   "@tsexample\n"
1174   "// print the names of all objects in the shape\n"
1175   "%count = %this.getObjectCount();\n"
1176   "for ( %i = 0; %i < %count; %i++ )\n"
1177   "   echo( %i SPC %this.getObjectName( %i ) );\n"
1178   "@endtsexample\n" )
1179{
1180   CHECK_INDEX_IN_RANGE( getObjectName, index, mShape->objects.size(), "" );
1181
1182   return mShape->getName( mShape->objects[index].nameIndex );
1183}}
1184
1185DefineTSShapeConstructorMethod( getObjectIndex, S32, ( const char* name ),,
1186   ( name ), -1,
1187   "Get the index of the first object with the given name.\n"
1188   "@param name name of the object to get.\n"
1189   "@return the index of the named object.\n\n"
1190   "@tsexample\n"
1191   "%index = %this.getObjectIndex( \"Head\" );\n"
1192   "@endtsexample\n" )
1193{
1194   return mShape->findObject( name );
1195}}
1196
1197DefineTSShapeConstructorMethod( getObjectNode, const char*, ( const char* name ),,
1198   ( name ), "",
1199   "Get the name of the node this object is attached to.\n"
1200   "@param name name of the object to get.\n"
1201   "@return the name of the attached node, or an empty string if this "
1202   "object is not attached to a node (usually the case for skinned meshes).\n\n"
1203   "@tsexample\n"
1204   "echo( \"Hand is attached to \" @ %this.getObjectNode( \"Hand\" ) );\n"
1205   "@endtsexample\n" )
1206{
1207   GET_OBJECT( getObjectNode, obj, name, 0 );
1208   if ( obj->nodeIndex < 0 )
1209      return "";
1210   else
1211      return mShape->getName( mShape->nodes[obj->nodeIndex].nameIndex );
1212}}
1213
1214DefineTSShapeConstructorMethod( setObjectNode, bool, ( const char* objName, const char* nodeName ),,
1215   ( objName, nodeName ), false,
1216   "Set the node an object is attached to.\n"
1217   "When the shape is rendered, the object geometry is rendered at the node's "
1218   "current transform.\n"
1219   "@param objName name of the object to modify\n"
1220   "@param nodeName name of the node to attach the object to\n"
1221   "@return true if successful, false otherwise\n\n"
1222   "@tsexample\n"
1223   "%this.setObjectNode( \"Hand\", \"Bip01 LeftHand\" );\n"
1224   "@endtsexample\n" )
1225{
1226   if ( !mShape->setObjectNode( objName, nodeName ) )
1227      return false;
1228
1229   ADD_TO_CHANGE_SET();
1230   return true;
1231}}
1232
1233DefineTSShapeConstructorMethod( renameObject, bool, ( const char* oldName, const char* newName ),,
1234   ( oldName, newName ), false,
1235   "Rename an object.\n"
1236   "@note Note that object names must be unique, so this command will fail if "
1237   "there is already an object with the desired name\n"
1238   "@param oldName current name of the object\n"
1239   "@param newName new name of the object\n"
1240   "@return true if successful, false otherwise\n\n"
1241   "@tsexample\n"
1242   "%this.renameObject( \"MyBox\", \"Box\" );\n"
1243   "@endtsexample\n" )
1244{
1245   if ( !mShape->renameObject( oldName, newName ) )
1246      return false;
1247
1248   ADD_TO_CHANGE_SET();
1249   return true;
1250}}
1251
1252DefineTSShapeConstructorMethod( removeObject, bool, ( const char* name ),,
1253   ( name ), false,
1254   "Remove an object (including all meshes for that object) from the shape.\n"
1255   "@param name name of the object to remove.\n"
1256   "@return true if successful, false otherwise.\n\n"
1257   "@tsexample\n"
1258   "// clear all objects in the shape\n"
1259   "%count = %this.getObjectCount();\n"
1260   "for ( %i = %count-1; %i >= 0; %i-- )\n"
1261   "   %this.removeObject( %this.getObjectName(%i) );\n"
1262   "@endtsexample\n" )
1263{
1264   if ( !mShape->removeObject( name ) )
1265      return false;
1266
1267   ADD_TO_CHANGE_SET();
1268   return true;
1269}}
1270
1271//-----------------------------------------------------------------------------
1272// MESHES
1273DefineTSShapeConstructorMethod( getMeshCount, S32, ( const char* name ),,
1274   ( name ), 0,
1275   "Get the number of meshes (detail levels) for the specified object.\n"
1276   "@param name name of the object to query\n"
1277   "@return the number of meshes for this object.\n\n"
1278   "@tsexample\n"
1279   "%count = %this.getMeshCount( \"SimpleShape\" );\n"
1280   "@endtsexample\n" )
1281{
1282   GET_OBJECT( getMeshCount, obj, name, 0 );
1283
1284   Vector<S32> objectDetails;
1285   mShape->getObjectDetails( objIndex, objectDetails );
1286   return objectDetails.size();
1287}}
1288
1289DefineTSShapeConstructorMethod( getMeshName, const char*, ( const char* name, S32 index ),,
1290   ( name, index ), "",
1291   "Get the name of the indexed mesh (detail level) for the specified object.\n"
1292   "@param name name of the object to query\n"
1293   "@param index index of the mesh (valid range is 0 - getMeshCount()-1)\n"
1294   "@return the mesh name.\n\n"
1295   "@tsexample\n"
1296   "// print the names of all meshes in the shape\n"
1297   "%objCount = %this.getObjectCount();\n"
1298   "for ( %i = 0; %i < %objCount; %i++ )\n"
1299   "{\n"
1300   "   %objName = %this.getObjectName( %i );\n"
1301   "   %meshCount = %this.getMeshCount( %objName );\n"
1302   "   for ( %j = 0; %j < %meshCount; %j++ )\n"
1303   "      echo( %this.getMeshName( %objName, %j ) );\n"
1304   "}\n"
1305   "@endtsexample\n" )
1306{
1307   GET_OBJECT( getMeshName, obj, name, "" );
1308
1309   Vector<S32> objectDetails;
1310   mShape->getObjectDetails(objIndex, objectDetails);
1311
1312   CHECK_INDEX_IN_RANGE( getMeshName, index, objectDetails.size(), "" );
1313
1314   static const U32 bufSize = 256;
1315   char* returnBuffer = Con::getReturnBuffer(bufSize);
1316   dSprintf(returnBuffer, bufSize, "%s %d", name, (S32)mShape->details[objectDetails[index]].size);
1317   return returnBuffer;
1318}}
1319
1320DefineTSShapeConstructorMethod( getMeshSize, S32, ( const char* name, S32 index ),,
1321   ( name, index ), -1,
1322   "Get the detail level size of the indexed mesh for the specified object.\n"
1323   "@param name name of the object to query\n"
1324   "@param index index of the mesh (valid range is 0 - getMeshCount()-1)\n"
1325   "@return the mesh detail level size.\n\n"
1326   "@tsexample\n"
1327   "// print sizes for all detail levels of this object\n"
1328   "%objName = \"trunk\";\n"
1329   "%count = %this.getMeshCount( %objName );\n"
1330   "for ( %i = 0; %i < %count; %i++ )\n"
1331   "   echo( %this.getMeshSize( %objName, %i ) );\n"
1332   "@endtsexample\n" )
1333{
1334   GET_OBJECT( getMeshName, obj, name, -1 );
1335
1336   Vector<S32> objectDetails;
1337   mShape->getObjectDetails( objIndex, objectDetails );
1338
1339   CHECK_INDEX_IN_RANGE( getMeshName, index, objectDetails.size(), -1 );
1340
1341   return (S32)mShape->details[objectDetails[index]].size;
1342}}
1343
1344DefineTSShapeConstructorMethod( setMeshSize, bool, ( const char* name, S32 size ),,
1345   ( name, size ), false,
1346   "Change the detail level size of the named mesh.\n"
1347   "@param name full name (object name + current size ) of the mesh to modify\n"
1348   "@param size new detail level size\n"
1349   "@return true if successful, false otherwise.\n\n"
1350   "@tsexample\n"
1351   "%this.setMeshSize( \"SimpleShape128\", 64 );\n"
1352   "@endtsexample\n" )
1353{
1354   if ( !mShape->setMeshSize( name, size ) )
1355      return false;
1356
1357   ADD_TO_CHANGE_SET();
1358   return true;
1359}}
1360
1361DefineTSShapeConstructorMethod( getMeshType, const char*, ( const char* name ),,
1362   ( name ), "",
1363   "Get the display type of the mesh.\n"
1364   "@param name name of the mesh to query\n"
1365   "@return the string returned is one of:"
1366   "<dl><dt>normal</dt><dd>a normal 3D mesh</dd>"
1367   "<dt>billboard</dt><dd>a mesh that always faces the camera</dd>"
1368   "<dt>billboardzaxis</dt><dd>a mesh that always faces the camera in the Z-axis</dd></dl>\n\n"
1369   "@tsexample\n"
1370   "echo( \"Mesh type is \" @ %this.getMeshType( \"SimpleShape128\" ) );\n"
1371   "@endtsexample\n" )
1372{
1373   GET_MESH( getMeshType, mesh, name, "normal" );
1374
1375   if (mesh->getFlags(TSMesh::BillboardZAxis))
1376      return "billboardzaxis";
1377   else if (mesh->getFlags(TSMesh::Billboard))
1378      return "billboard";
1379   else
1380      return "normal";
1381}}
1382
1383DefineTSShapeConstructorMethod( setMeshType, bool, ( const char* name, const char* type ),,
1384   ( name, type ), false,
1385   "Set the display type for the mesh.\n"
1386   "@param name full name (object name + detail size) of the mesh to modify\n"
1387   "@param type the new type for the mesh: \"normal\", \"billboard\" or \"billboardzaxis\"\n"
1388   "@return true if successful, false otherwise\n\n"
1389   "@tsexample\n"
1390   "// set the mesh to be a billboard\n"
1391   "%this.setMeshType( \"SimpleShape64\", \"billboard\" );\n"
1392   "@endtsexample\n" )
1393{
1394   GET_MESH( setMeshType, mesh, name, false );
1395
1396   // Update the mesh flags
1397   mesh->clearFlags( TSMesh::Billboard | TSMesh::BillboardZAxis );
1398   if ( dStrEqual( type, "billboard" ) )
1399      mesh->setFlags( TSMesh::Billboard );
1400   else if ( dStrEqual( type, "billboardzaxis" ) )
1401      mesh->setFlags( TSMesh::Billboard | TSMesh::BillboardZAxis );
1402   else if ( !dStrEqual( type, "normal" ) )
1403   {
1404      Con::printf( "setMeshType: Unknown mesh type '%s'", type );
1405      return false;
1406   }
1407
1408   ADD_TO_CHANGE_SET();
1409   return true;
1410}}
1411
1412DefineTSShapeConstructorMethod( getMeshMaterial, const char*, ( const char* name ),,
1413   ( name ), "",
1414   "Get the name of the material attached to a mesh. Note that only the first "
1415   "material used by the mesh is returned.\n"
1416   "@param name full name (object name + detail size) of the mesh to query\n"
1417   "@return name of the material attached to the mesh (suitable for use with the Material mapTo field)\n\n"
1418   "@tsexample\n"
1419   "echo( \"Mesh material is \" @ %this.sgetMeshMaterial( \"SimpleShape128\" ) );\n"
1420   "@endtsexample\n" )
1421{
1422   GET_MESH( getMeshMaterial, mesh, name, "" );
1423
1424   // Return the name of the first material attached to this mesh
1425   S32 matIndex = mesh->mPrimitives[0].matIndex & TSDrawPrimitive::MaterialMask;
1426   if ((matIndex >= 0) && (matIndex < mShape->materialList->size()))
1427      return mShape->materialList->getMaterialName( matIndex );
1428   else
1429      return "";
1430}}
1431
1432DefineTSShapeConstructorMethod( setMeshMaterial, bool, ( const char* meshName, const char* matName ),,
1433   ( meshName, matName ), false,
1434   "Set the name of the material attached to the mesh.\n"
1435   "@param meshName full name (object name + detail size) of the mesh to modify\n"
1436   "@param matName name of the material to attach. This could be the base name of "
1437   "the diffuse texture (eg. \"test_mat\" for \"test_mat.jpg\"), or the name of a "
1438   "Material object already defined in script.\n"
1439   "@return true if successful, false otherwise\n\n"
1440   "@tsexample\n"
1441   "// set the mesh material\n"
1442   "%this.setMeshMaterial( \"SimpleShape128\", \"test_mat\" );\n"
1443   "@endtsexample\n" )
1444{
1445   GET_MESH( setMeshMaterial, mesh, meshName, false );
1446
1447   // Check if this material is already in the shape
1448   S32 matIndex;
1449   for ( matIndex = 0; matIndex < mShape->materialList->size(); matIndex++ )
1450   {
1451      if ( dStrEqual( matName, mShape->materialList->getMaterialName( matIndex ) ) )
1452         break;
1453   }
1454   if ( matIndex == mShape->materialList->size() )
1455   {
1456      // Add a new material to the shape
1457      U32 flags = TSMaterialList::S_Wrap | TSMaterialList::T_Wrap;
1458      mShape->materialList->push_back( matName, flags );
1459   }
1460
1461   // Set this material for all primitives in the mesh
1462   for ( S32 i = 0; i < mesh->mPrimitives.size(); i++ )
1463   {
1464      U32 matType = mesh->mPrimitives[i].matIndex & ( TSDrawPrimitive::TypeMask | TSDrawPrimitive::Indexed );
1465      mesh->mPrimitives[i].matIndex = ( matType | matIndex );
1466   }
1467
1468   ADD_TO_CHANGE_SET();
1469   return true;
1470}}
1471
1472DefineTSShapeConstructorMethod( addMesh, bool, ( const char* meshName, const char* srcShape, const char* srcMesh ),,
1473   ( meshName, srcShape, srcMesh ), false,
1474   "Add geometry from another DTS or DAE shape file into this shape.\n"
1475   "Any materials required by the source mesh are also copied into this shape.<br>\n"
1476   "@param meshName full name (object name + detail size) of the new mesh. If "
1477      "no detail size is present at the end of the name, a value of 2 is used.<br>"
1478      "An underscore before the number at the end of the name will be interpreted as "
1479      "a negative sign. eg. \"MyMesh_4\" will be interpreted as \"MyMesh-4\".\n"
1480   "@param srcShape name of a shape file (DTS or DAE) that contains the mesh\n"
1481   "@param srcMesh the full name (object name + detail size) of the mesh to "
1482      "copy from the DTS/DAE file into this shape</li>"
1483   "@return true if successful, false otherwise\n\n"
1484   "@tsexample\n"
1485   "%this.addMesh( \"ColMesh-1\", \"./collision.dts\", \"ColMesh\", \"Col-1\" );\n"
1486   "%this.addMesh( \"SimpleShape10\", \"./testShape.dae\", \"MyMesh2\", "" );\n"
1487   "@endtsexample\n" )
1488{
1489   // Load the shape source file
1490   char filenameBuf[1024];
1491   Con::expandScriptFilename(filenameBuf, sizeof(filenameBuf), srcShape);
1492
1493   Resource<TSShape> hSrcShape = ResourceManager::get().load( filenameBuf );
1494   if ( !bool(hSrcShape) )
1495   {
1496      Con::errorf( "addMesh failed: Could not load source shape: '%s'", filenameBuf );
1497      return false;
1498   }
1499
1500   TSShape* shape = const_cast<TSShape*>( (const TSShape*)hSrcShape );
1501   if ( !mShape->addMesh( shape, srcMesh, meshName ) )
1502      return false;
1503
1504   ADD_TO_CHANGE_SET();
1505   return true;
1506}}
1507
1508DefineTSShapeConstructorMethod( removeMesh, bool, ( const char* name ),,
1509   ( name ), false,
1510   "Remove a mesh from the shape.\n"
1511   "If all geometry is removed from an object, the object is also removed.\n"
1512   "@param name full name (object name + detail size) of the mesh to remove\n"
1513   "@return true if successful, false otherwise\n\n"
1514   "@tsexample\n"
1515   "%this.removeMesh( \"SimpleShape128\" );\n"
1516   "@endtsexample\n" )
1517{
1518   if ( !mShape->removeMesh( name ) )
1519      return false;
1520
1521   ADD_TO_CHANGE_SET();
1522   return true;
1523}}
1524
1525DefineTSShapeConstructorMethod( getBounds, Box3F, (),,
1526   (), Box3F::Invalid,
1527   "Get the bounding box for the shape.\n"
1528   "@return Bounding box \"minX minY minZ maxX maxY maxZ\"" )
1529{
1530   return mShape->mBounds;
1531}}
1532
1533DefineTSShapeConstructorMethod( setBounds, bool, ( Box3F bbox ),,
1534   ( bbox ), false,
1535   "Set the shape bounds to the given bounding box.\n"
1536   "@param Bounding box \"minX minY minZ maxX maxY maxZ\"\n"
1537   "@return true if successful, false otherwise\n" )
1538{
1539   // Set shape bounds
1540   TSShape* shape = mShape;
1541
1542   shape->mBounds = bbox;
1543   shape->mBounds.getCenter( &shape->center );
1544   shape->mRadius = ( shape->mBounds.maxExtents - shape->center ).len();
1545   shape->tubeRadius = shape->mRadius;
1546
1547   ADD_TO_CHANGE_SET();
1548   return true;
1549}}
1550
1551//-----------------------------------------------------------------------------
1552// DETAILS
1553DefineTSShapeConstructorMethod( getDetailLevelCount, S32, (),, (), 0,
1554   "Get the total number of detail levels in the shape.\n"
1555   "@return the number of detail levels in the shape\n" )
1556{
1557   return mShape->details.size();
1558}}
1559
1560DefineTSShapeConstructorMethod( getDetailLevelName, const char*, ( S32 index ),,
1561   ( index ), "",
1562   "Get the name of the indexed detail level.\n"
1563   "@param index detail level index (valid range is 0 - getDetailLevelCount()-1)\n"
1564   "@return the detail level name\n\n"
1565   "@tsexample\n"
1566   "// print the names of all detail levels in the shape\n"
1567   "%count = %this.getDetailLevelCount();\n"
1568   "for ( %i = 0; %i < %count; %i++ )\n"
1569   "   echo( %i SPC %this.getDetailLevelName( %i ) );\n"
1570   "@endtsexample\n" )
1571{
1572   CHECK_INDEX_IN_RANGE( getDetailLevelName, index, mShape->details.size(), "" );
1573
1574   return mShape->getName(mShape->details[index].nameIndex);
1575}}
1576
1577DefineTSShapeConstructorMethod( getDetailLevelSize, S32, ( S32 index),,
1578   ( index ), 0,
1579   "Get the size of the indexed detail level.\n"
1580   "@param index detail level index (valid range is 0 - getDetailLevelCount()-1)\n"
1581   "@return the detail level size\n\n"
1582   "@tsexample\n"
1583   "// print the sizes of all detail levels in the shape\n"
1584   "%count = %this.getDetailLevelCount();\n"
1585   "for ( %i = 0; %i < %count; %i++ )\n"
1586   "   echo( \"Detail\" @ %i @ \" has size \" @ %this.getDetailLevelSize( %i ) );\n"
1587   "@endtsexample\n" )
1588{
1589   CHECK_INDEX_IN_RANGE( getDetailLevelSize, index, mShape->details.size(), 0 );
1590
1591   return (S32)mShape->details[index].size;
1592}}
1593
1594DefineTSShapeConstructorMethod( getDetailLevelIndex, S32, ( S32 size ),,
1595   ( size ), -1,
1596   "Get the index of the detail level with a given size.\n"
1597   "@param size size of the detail level to lookup\n"
1598   "@return index of the detail level with the desired size, or -1 if no such "
1599   "detail exists\n\n"
1600   "@tsexample\n"
1601   "if ( %this.getDetailLevelSize( 32 ) == -1 )\n"
1602   "   echo( \"Error: This shape does not have a detail level at size 32\" );\n"
1603   "@endtsexample\n" )
1604{
1605   return mShape->findDetailBySize( size );
1606}}
1607
1608DefineTSShapeConstructorMethod( renameDetailLevel, bool, ( const char* oldName, const char* newName ),,
1609   ( oldName, newName ), false,
1610   "Rename a detail level.\n"
1611   "@note Note that detail level names must be unique, so this command will "
1612   "fail if there is already a detail level with the desired name\n"
1613   "@param oldName current name of the detail level\n"
1614   "@param newName new name of the detail level\n"
1615   "@return true if successful, false otherwise\n\n"
1616   "@tsexample\n"
1617   "%this.renameDetailLevel( \"detail-1\", \"collision-1\" );\n"
1618   "@endtsexample\n" )
1619{
1620   if ( !mShape->renameDetail( oldName, newName ) )
1621      return false;
1622
1623   ADD_TO_CHANGE_SET();
1624   return true;
1625}}
1626
1627DefineTSShapeConstructorMethod( removeDetailLevel, bool, ( S32 index ),,
1628   ( index ), false,
1629   "Remove the detail level (including all meshes in the detail level)\n"
1630   "@param size size of the detail level to remove\n"
1631   "@return true if successful, false otherwise\n"
1632   "@tsexample\n"
1633   "%this.removeDetailLevel( 2 );\n"
1634   "@endtsexample\n" )
1635{
1636   if ( !mShape->removeDetail( index ) )
1637      return false;
1638
1639   ADD_TO_CHANGE_SET();
1640   return true;
1641}}
1642
1643DefineTSShapeConstructorMethod( setDetailLevelSize, S32, ( S32 index, S32 newSize ),,
1644   ( index, newSize ), index,
1645   "Change the size of a detail level."
1646   "@note Note that detail levels are always sorted in decreasing size order, "
1647   "so this command may cause detail level indices to change.\n"
1648   "@param index index of the detail level to modify\n"
1649   "@param newSize new size for the detail level\n"
1650   "@return new index for this detail level\n\n"
1651   "@tsexample\n"
1652   "%this.setDetailLevelSize( 2, 256 );\n"
1653   "@endtsexample\n" )
1654{
1655   S32 dl = mShape->setDetailSize( index, newSize );
1656   if ( dl >= 0 )
1657      ADD_TO_CHANGE_SET();
1658   return dl;
1659}}
1660
1661DefineTSShapeConstructorMethod( getImposterDetailLevel, S32, (),, (), -1,
1662   "Get the index of the imposter (auto-billboard) detail level (if any).\n"
1663   "@return imposter detail level index, or -1 if the shape does not use "
1664   "imposters.\n\n" )
1665{
1666   for ( S32 i = 0; i < mShape->details.size(); i++ )
1667   {
1668      if ( mShape->details[i].subShapeNum < 0 )
1669         return i;
1670   }
1671   return -1;
1672}}
1673
1674DefineTSShapeConstructorMethod( getImposterSettings, const char*, ( S32 index ),,
1675   ( index ), "",
1676   "Get the settings used to generate imposters for the indexed detail level.\n"
1677   "@param index index of the detail level to query (does not need to be an "
1678   "imposter detail level\n"
1679   "@return string of the form: \"valid eqSteps pSteps dl dim poles angle\", where:"
1680   "<dl>"
1681      "<dt>valid</dt><dd>1 if this detail level generates imposters, 0 otherwise</dd>"
1682      "<dt>eqSteps</dt><dd>number of steps around the equator</dd>"
1683      "<dt>pSteps</dt><dd>number of steps between the poles</dd>"
1684      "<dt>dl</dt><dd>index of the detail level used to generate imposters</dd>"
1685      "<dt>dim</dt><dd>size (in pixels) of each imposter image</dd>"
1686      "<dt>poles</dt><dd>1 to include pole images, 0 otherwise</dd>"
1687      "<dt>angle</dt><dd>angle at which to display pole images</dd>"
1688   "</dl>\n\n"
1689   "@tsexample\n"
1690   "// print the imposter detail level settings\n"
1691   "%index = %this.getImposterDetailLevel();\n"
1692   "if ( %index != -1 )\n"
1693   "   echo( \"Imposter settings: \" @ %this.getImposterSettings( %index ) );\n"
1694   "@endtsexample\n" )
1695{
1696   CHECK_INDEX_IN_RANGE( getImposterSettings, index, mShape->details.size(), "" );
1697
1698   // Return information about the detail level
1699   const TSShape::Detail& det = mShape->details[index];
1700
1701   static const U32 bufSize = 512;
1702   char* returnBuffer = Con::getReturnBuffer(bufSize);
1703   dSprintf(returnBuffer, bufSize, "%d\t%d\t%d\t%d\t%d\t%d\t%g",
1704      (S32)( det.subShapeNum < 0 ),          // isImposter
1705      det.bbEquatorSteps,
1706      det.bbPolarSteps,
1707      det.bbDetailLevel,
1708      det.bbDimension,
1709      det.bbIncludePoles,
1710      det.bbPolarAngle );
1711
1712   return returnBuffer;
1713}}
1714
1715DefineTSShapeConstructorMethod( addImposter, S32, ( S32 size, S32 equatorSteps, S32 polarSteps, S32 dl, S32 dim, bool includePoles, F32 polarAngle ),,
1716   ( size, equatorSteps, polarSteps, dl, dim, includePoles, polarAngle ), -1,
1717   "Add (or edit) an imposter detail level to the shape.\n"
1718   "If the shape already contains an imposter detail level, this command will "
1719   "simply change the imposter settings\n"
1720   "@param size size of the imposter detail level\n"
1721   "@param equatorSteps defines the number of snapshots to take around the "
1722   "equator. Imagine the object being rotated around the vertical axis, then "
1723   "a snapshot taken at regularly spaced intervals.\n"
1724   "@param polarSteps defines the number of snapshots taken between the poles "
1725   "(top and bottom), at each equator step. eg. At each equator snapshot, "
1726   "snapshots are taken at regular intervals between the poles.\n"
1727   "@param dl the detail level to use when generating the snapshots. Note that "
1728   "this is an array index rather than a detail size. So if an object has detail "
1729   "sizes of: 200, 150, and 40, then setting @a dl to 1 will generate the snapshots "
1730   "using detail size 150.\n"
1731   "@param dim defines the size of the imposter images in pixels. The larger the "
1732   "number, the more detailed the billboard will be.\n"
1733   "@param includePoles flag indicating whether to include the \"pole\" snapshots. "
1734   "ie. the views from the top and bottom of the object.\n"
1735   "@param polar_angle if pole snapshots are active (@a includePoles is true), this "
1736   "parameter defines the camera angle (in degrees) within which to render the "
1737   "pole snapshot. eg. if polar_angle is set to 25 degrees, then the snapshot "
1738   "taken at the pole (looking directly down or up at the object) will be rendered "
1739   "when the camera is within 25 degrees of the pole.\n"
1740   "@return true if successful, false otherwise\n\n"
1741   "@tsexample\n"
1742   "%this.addImposter( 2, 4, 0, 0, 64, false, 0 );\n"
1743   "%this.addImposter( 2, 4, 2, 0, 64, true, 10 );   // this command would edit the existing imposter detail level\n"
1744   "@endtsexample\n" )
1745{
1746   // Add the imposter detail level
1747   dl = mShape->addImposter( getShapePath(), size, equatorSteps, polarSteps, dl, dim, includePoles, polarAngle);
1748   if ( dl != -1 )
1749      ADD_TO_CHANGE_SET();
1750   return dl;
1751}}
1752
1753DefineTSShapeConstructorMethod( removeImposter, bool, (),, (), false,
1754   "() Remove the imposter detail level (if any) from the shape.\n"
1755   "@return true if successful, false otherwise\n\n" )
1756{
1757   if ( !mShape->removeImposter() )
1758      return false;
1759
1760   ADD_TO_CHANGE_SET();
1761   return true;
1762}}
1763
1764//-----------------------------------------------------------------------------
1765// SEQUENCES
1766DefineTSShapeConstructorMethod( getSequenceCount, S32, (),, (), 0,
1767   "Get the total number of sequences in the shape.\n"
1768   "@return the number of sequences in the shape\n\n" )
1769{
1770   return mShape->sequences.size();
1771}}
1772
1773DefineTSShapeConstructorMethod( getSequenceIndex, S32, ( const char* name),,
1774   ( name ), -1,
1775   "Find the index of the sequence with the given name.\n"
1776   "@param name name of the sequence to lookup\n"
1777   "@return index of the sequence with matching name, or -1 if not found\n\n"
1778   "@tsexample\n"
1779   "// Check if a given sequence exists in the shape\n"
1780   "if ( %this.getSequenceIndex( \"walk\" ) == -1 )\n"
1781   "   echo( \"Could not find 'walk' sequence\" );\n"
1782   "@endtsexample\n" )
1783{
1784   return mShape->findSequence( name );
1785}}
1786
1787DefineTSShapeConstructorMethod( getSequenceName, const char*, ( S32 index ),,
1788   ( index ), "",
1789   "Get the name of the indexed sequence.\n"
1790   "@param index index of the sequence to query (valid range is 0 - getSequenceCount()-1)\n"
1791   "@return the name of the sequence\n\n"
1792   "@tsexample\n"
1793   "// print the name of all sequences in the shape\n"
1794   "%count = %this.getSequenceCount();\n"
1795   "for ( %i = 0; %i < %count; %i++ )\n"
1796   "   echo( %i SPC %this.getSequenceName( %i ) );\n"
1797   "@endtsexample\n" )
1798{
1799   CHECK_INDEX_IN_RANGE( getSequenceName, index, mShape->sequences.size(), "" );
1800
1801   return mShape->getName( mShape->sequences[index].nameIndex );
1802}}
1803
1804DefineTSShapeConstructorMethod( getSequenceSource, const char*, ( const char* name ),,
1805   ( name ), "",
1806   "Get information about where the sequence data came from.\n"
1807   "For example, whether it was loaded from an external DSQ file.\n"
1808   "@param name name of the sequence to query\n"
1809   "@return TAB delimited string of the form: \"from reserved start end total\", where:"
1810   "<dl>"
1811      "<dt>from</dt><dd>the source of the animation data, such as the path to "
1812      "a DSQ file, or the name of an existing sequence in the shape. This field "
1813      "will be empty for sequences already embedded in the DTS or DAE file.</dd>"
1814      "<dt>reserved</dt><dd>reserved value</dd>"
1815      "<dt>start</dt><dd>the first frame in the source sequence used to create this sequence</dd>"
1816      "<dt>end</dt><dd>the last frame in the source sequence used to create this sequence</dd>"
1817      "<dt>total</dt><dd>the total number of frames in the source sequence</dd>"
1818   "</dl>\n\n"
1819   "@tsexample\n"
1820   "// print the source for the walk animation\n"
1821   "echo( \"walk source:\" SPC getField( %this.getSequenceSource( \"walk\" ), 0 ) );\n"
1822   "@endtsexample\n" )
1823{
1824   GET_SEQUENCE( getSequenceSource, seq, name, "" );
1825
1826   // Return information about the source data for this sequence
1827   static const U32 bufSize = 512;
1828   char* returnBuffer = Con::getReturnBuffer(bufSize);
1829   dSprintf( returnBuffer, bufSize, "%s\t%d\t%d\t%d",
1830      seq->sourceData.from.c_str(), seq->sourceData.start,
1831      seq->sourceData.end, seq->sourceData.total );
1832   return returnBuffer;
1833}}
1834
1835DefineTSShapeConstructorMethod( getSequenceFrameCount, S32, ( const char* name ),,
1836   ( name ), 0,
1837   "Get the number of keyframes in the sequence.\n"
1838   "@param name name of the sequence to query\n"
1839   "@return number of keyframes in the sequence\n\n"
1840   "@tsexample\n"
1841   "echo( \"Run has \" @ %this.getSequenceFrameCount( \"run\" ) @ \" keyframes\" );\n"
1842   "@endtsexample\n" )
1843{
1844   GET_SEQUENCE( getSequenceFrameCount, seq, name, 0 );
1845   return seq->numKeyframes;
1846}}
1847
1848DefineTSShapeConstructorMethod( getSequencePriority, F32, ( const char* name ),,
1849   ( name ), -1.0f,
1850   "Get the priority setting of the sequence.\n"
1851   "@param name name of the sequence to query\n"
1852   "@return priority value of the sequence\n\n" )
1853{
1854   GET_SEQUENCE( getSequencePriority, seq, name, 0.0f );
1855   return seq->priority;
1856}}
1857
1858DefineTSShapeConstructorMethod( setSequencePriority, bool, ( const char* name, F32 priority ),,
1859   ( name, priority ), false,
1860   "Set the sequence priority.\n"
1861   "@param name name of the sequence to modify\n"
1862   "@param priority new priority value\n"
1863   "@return true if successful, false otherwise\n\n" )
1864{
1865   GET_SEQUENCE( setSequencePriority, seq, name, false );
1866
1867   seq->priority = priority;
1868   ADD_TO_CHANGE_SET();
1869   return true;
1870}}
1871
1872DefineTSShapeConstructorMethod( getSequenceGroundSpeed, const char*, ( const char* name ),,
1873   ( name ), "",
1874   "Get the ground speed of the sequence.\n"
1875   "@note Note that only the first 2 ground frames of the sequence are "
1876   "examined; the speed is assumed to be constant throughout the sequence.\n"
1877   "@param name name of the sequence to query\n"
1878   "@return string of the form: \"trans.x trans.y trans.z rot.x rot.y rot.z\"\n\n"
1879   "@tsexample\n"
1880   "%speed = VectorLen( getWords( %this.getSequenceGroundSpeed( \"run\" ), 0, 2 ) );\n"
1881   "   echo( \"Run moves at \" @ %speed @ \" units per frame\" );\n"
1882   "@endtsexample\n" )
1883{
1884   // Find the sequence and return the ground speed (assumed to be constant)
1885   GET_SEQUENCE( getSequenceGroundSpeed, seq, name, "" );
1886
1887   Point3F trans(0,0,0), rot(0,0,0);
1888   if ( seq->numGroundFrames > 0 )
1889   {
1890      const Point3F& p1 = mShape->groundTranslations[seq->firstGroundFrame];
1891      const Point3F& p2 = mShape->groundTranslations[seq->firstGroundFrame + 1];
1892      trans = p2 - p1;
1893
1894      QuatF r1 = mShape->groundRotations[seq->firstGroundFrame].getQuatF();
1895      QuatF r2 = mShape->groundRotations[seq->firstGroundFrame + 1].getQuatF();
1896      r2 -= r1;
1897
1898      MatrixF mat;
1899      r2.setMatrix(&mat);
1900      rot = mat.toEuler();
1901   }
1902
1903   static const U32 bufSize = 256;
1904   char* returnBuffer = Con::getReturnBuffer(bufSize);
1905   dSprintf( returnBuffer, bufSize, "%g %g %g %g %g %g",
1906      trans.x, trans.y, trans.z, rot.x, rot.y, rot.z );
1907   return returnBuffer;
1908}}
1909
1910DefineTSShapeConstructorMethod( setSequenceGroundSpeed, bool, ( const char* name, Point3F transSpeed, Point3F rotSpeed ), ( Point3F::Zero ),
1911   ( name, transSpeed, rotSpeed ), false,
1912   "Set the translation and rotation ground speed of the sequence.\n"
1913   "The ground speed of the sequence is set by generating ground transform "
1914   "keyframes. The ground translational and rotational speed is assumed to "
1915   "be constant for the duration of the sequence. Existing ground frames for "
1916   "the sequence (if any) will be replaced.\n"
1917   "@param name name of the sequence to modify\n"
1918   "@param transSpeed translational speed (trans.x trans.y trans.z) in "
1919   "Torque units per frame\n"
1920   "@param rotSpeed (optional) rotational speed (rot.x rot.y rot.z) in "
1921   "radians per frame. Default is \"0 0 0\"\n"
1922   "@return true if successful, false otherwise\n\n"
1923   "@tsexample\n"
1924   "%this.setSequenceGroundSpeed( \"run\", \"5 0 0\" );\n"
1925   "%this.setSequenceGroundSpeed( \"spin\", \"0 0 0\", \"4 0 0\" );\n"
1926   "@endtsexample\n" )
1927{
1928   if ( !mShape->setSequenceGroundSpeed( name, transSpeed, rotSpeed ) )
1929      return false;
1930
1931   ADD_TO_CHANGE_SET();
1932   return true;
1933}}
1934
1935DefineTSShapeConstructorMethod( getSequenceCyclic, bool, ( const char* name ),,
1936   ( name ), false,
1937   "Check if this sequence is cyclic (looping).\n"
1938   "@param name name of the sequence to query\n"
1939   "@return true if this sequence is cyclic, false if not\n\n"
1940   "@tsexample\n"
1941   "if ( !%this.getSequenceCyclic( \"ambient\" ) )\n"
1942   "   error( \"ambient sequence is not cyclic!\" );\n"
1943   "@endtsexample\n" )
1944{
1945   GET_SEQUENCE( getSequenceCyclic, seq, name, false );
1946   return seq->isCyclic();
1947}}
1948
1949DefineTSShapeConstructorMethod( setSequenceCyclic, bool, ( const char* name, bool cyclic ),,
1950   ( name, cyclic ), false,
1951   "Mark a sequence as cyclic or non-cyclic.\n"
1952   "@param name name of the sequence to modify\n"
1953   "@param cyclic true to make the sequence cyclic, false for non-cyclic\n"
1954   "@return true if successful, false otherwise\n\n"
1955   "@tsexample\n"
1956   "%this.setSequenceCyclic( \"ambient\", true );\n"
1957   "%this.setSequenceCyclic( \"shoot\", false );\n"
1958   "@endtsexample\n" )
1959{
1960   GET_SEQUENCE( setSequenceCyclic, seq, name, false );
1961
1962   // update cyclic flag
1963   if (cyclic != seq->isCyclic())
1964   {
1965      if (cyclic && !seq->isCyclic())
1966         seq->flags |= TSShape::Cyclic;
1967      else if (!cyclic && seq->isCyclic())
1968         seq->flags &= (~(TSShape::Cyclic));
1969
1970      ADD_TO_CHANGE_SET();
1971   }
1972   return true;
1973}}
1974
1975DefineTSShapeConstructorMethod( getSequenceBlend, const char*, ( const char* name ),,
1976   ( name ), "",
1977   "Get information about blended sequences.\n"
1978   "@param name name of the sequence to query\n"
1979   "@return TAB delimited string of the form: \"isBlend blendSeq blendFrame\", where:"
1980   "<dl>"
1981   "<dt>blend_flag</dt><dd>a boolean flag indicating whether this sequence is a blend</dd>"
1982   "<dt>blend_seq_name</dt><dd>the name of the sequence that contains the reference "
1983   "frame (empty for blend sequences embedded in DTS files)</dd>"
1984   "<dt>blend_seq_frame</dt><dd>the blend reference frame (empty for blend sequences "
1985   "embedded in DTS files)</dd>"
1986   "</dl>\n"
1987   "@note Note that only sequences set to be blends using the setSequenceBlend "
1988   "command will contain the blendSeq and blendFrame information.\n\n"
1989   "@tsexample\n"
1990   "%blendData = %this.getSequenceBlend( \"look\" );\n"
1991   "if ( getField( %blendData, 0 ) )\n"
1992   "   echo( \"look is a blend, reference: \" @ getField( %blendData, 1 ) );\n"
1993   "@endtsexample\n" )
1994{
1995   GET_SEQUENCE( getSequenceBlend, seq, name, "0" );
1996
1997   // Return the blend information (flag reference_sequence reference_frame)
1998   static const U32 bufSize = 512;
1999   char* returnBuffer = Con::getReturnBuffer(bufSize);
2000   dSprintf( returnBuffer, bufSize, "%d\t%s\t%d", (int)seq->isBlend(),
2001      seq->sourceData.blendSeq.c_str(), seq->sourceData.blendFrame );
2002   return returnBuffer;
2003}}
2004
2005DefineTSShapeConstructorMethod( setSequenceBlend, bool, ( const char* name, bool blend, const char* blendSeq, S32 blendFrame ),,
2006   ( name, blend, blendSeq, blendFrame ), false,
2007   "Mark a sequence as a blend or non-blend.\n"
2008   "A blend sequence is one that will be added on top of any other playing "
2009   "sequences. This is done by storing the animated node transforms relative "
2010   "to a reference frame, rather than as absolute transforms.\n"
2011   "@param name name of the sequence to modify\n"
2012   "@param blend true to make the sequence a blend, false for a non-blend\n"
2013   "@param blendSeq the name of the sequence that contains the blend reference frame\n"
2014   "@param blendFrame the reference frame in the blendSeq sequence\n"
2015   "@return true if successful, false otherwise\n\n"
2016   "@tsexample\n"
2017   "%this.setSequenceBlend( \"look\", true, \"root\", 0 );\n"
2018   "@endtsexample\n" )
2019{
2020   GET_SEQUENCE( setSequenceBlend, seq, name, false );
2021
2022   if ( !mShape->setSequenceBlend( name, blend, blendSeq, blendFrame ) )
2023      return false;
2024
2025   ADD_TO_CHANGE_SET();
2026   return true;
2027}}
2028
2029DefineTSShapeConstructorMethod( renameSequence, bool, ( const char* oldName, const char* newName ),,
2030   ( oldName, newName ), false,
2031   "Rename a sequence.\n"
2032   "@note Note that sequence names must be unique, so this command will fail "
2033   "if there is already a sequence with the desired name\n"
2034   "@param oldName current name of the sequence\n"
2035   "@param newName new name of the sequence\n"
2036   "@return true if successful, false otherwise\n\n"
2037   "@tsexample\n"
2038   "%this.renameSequence( \"walking\", \"walk\" );\n"
2039   "@endtsexample\n" )
2040{
2041   GET_SEQUENCE( renameSequence, seq, oldName, false );
2042
2043   if ( !mShape->renameSequence( oldName, newName ) )
2044      return false;
2045
2046   ADD_TO_CHANGE_SET();
2047   return true;
2048}}
2049
2050DefineTSShapeConstructorMethod( addSequence, bool,
2051   ( const char* source, const char* name, S32 start, S32 end, bool padRot, bool padTrans ),
2052   ( 0, -1, true, false ), ( source, name, start, end, padRot, padTrans ), false,
2053   "Add a new sequence to the shape.\n"
2054   "@param source the name of an existing sequence, or the name of a DTS or DAE "
2055   "shape or DSQ sequence file. When the shape file contains more than one "
2056   "sequence, the desired sequence can be specified by appending the name to the "
2057   "end of the shape file. eg. \"myShape.dts run\" would select the \"run\" "
2058   "sequence from the \"myShape.dts\" file.\n\n"
2059   "@param name name of the new sequence\n"
2060   "@param start (optional) first frame to copy. Defaults to 0, the first frame in the sequence.\n"
2061   "@param end (optional) last frame to copy. Defaults to -1, the last frame in the sequence.\n"
2062   "@param padRot (optional) copy root-pose rotation keys for non-animated nodes. This is useful if "
2063   "the source sequence data has a different root-pose to the target shape, such as if one character was "
2064   "in the T pose, and the other had arms at the side. Normally only nodes that are actually rotated by "
2065   "the source sequence have keyframes added, but setting this flag will also add keyframes for nodes "
2066   "that are not animated, but have a different root-pose rotation to the target shape root pose.\n"
2067   "@param padTrans (optional) copy root-pose translation keys for non-animated nodes.  This is useful if "
2068   "the source sequence data has a different root-pose to the target shape, such as if one character was "
2069   "in the T pose, and the other had arms at the side. Normally only nodes that are actually moved by "
2070   "the source sequence have keyframes added, but setting this flag will also add keyframes for nodes "
2071   "that are not animated, but have a different root-pose position to the target shape root pose.\n"
2072   "@return true if successful, false otherwise\n\n"
2073   "@tsexample\n"
2074   "%this.addSequence( \"./testShape.dts ambient\", \"ambient\" );\n"
2075   "%this.addSequence( \"./myPlayer.dae run\", \"run\" );\n"
2076   "%this.addSequence( \"./player_look.dsq\", \"look\", 0, -1 );     // start to end\n"
2077   "%this.addSequence( \"walk\", \"walk_shortA\", 0, 4 );            // start to frame 4\n"
2078   "%this.addSequence( \"walk\", \"walk_shortB\", 4, -1 );           // frame 4 to end\n"
2079   "@endtsexample\n" )
2080{
2081   String srcName;
2082   String srcPath( source );
2083   SplitSequencePathAndName( srcPath, srcName );
2084
2085   if ( !mShape->addSequence( srcPath, srcName, name, start, end, padRot, padTrans ) )
2086      return false;
2087
2088   ADD_TO_CHANGE_SET();
2089   return true;
2090}}
2091
2092DefineTSShapeConstructorMethod( removeSequence, bool, ( const char* name ),,
2093   ( name ), false,
2094   "Remove the sequence from the shape.\n"
2095   "@param name name of the sequence to remove\n"
2096   "@return true if successful, false otherwise\n\n" )
2097{
2098   if ( !mShape->removeSequence( name ) )
2099      return false;
2100
2101   ADD_TO_CHANGE_SET();
2102   return true;
2103}}
2104
2105//-----------------------------------------------------------------------------
2106// TRIGGERS
2107DefineTSShapeConstructorMethod( getTriggerCount, S32, ( const char* name ),,
2108   ( name ), 0,
2109   "Get the number of triggers in the specified sequence.\n"
2110   "@param name name of the sequence to query\n"
2111   "@return number of triggers in the sequence\n\n" )
2112{
2113   GET_SEQUENCE( getTriggerCount, seq, name, 0 );
2114   return seq->numTriggers;
2115}}
2116
2117DefineTSShapeConstructorMethod( getTrigger, const char*, ( const char* name, S32 index ),,
2118   ( name, index ), "",
2119   "Get information about the indexed trigger\n"
2120   "@param name name of the sequence to query\n"
2121   "@param index index of the trigger (valid range is 0 - getTriggerCount()-1)\n"
2122   "@return string of the form \"frame state\"\n\n"
2123   "@tsexample\n"
2124   "// print all triggers in the sequence\n"
2125   "%count = %this.getTriggerCount( \"back\" );\n"
2126   "for ( %i = 0; %i < %count; %i++ )\n"
2127   "   echo( %i SPC %this.getTrigger( \"back\", %i ) );\n"
2128   "@endtsexample\n" )
2129{  
2130   // Find the sequence and return the indexed trigger (frame and state)
2131   GET_SEQUENCE( getTrigger, seq, name, "" );
2132
2133   CHECK_INDEX_IN_RANGE( getTrigger, index, seq->numTriggers, "" );
2134
2135   const TSShape::Trigger& trig = mShape->triggers[seq->firstTrigger + index];
2136   S32 frame = trig.pos * seq->numKeyframes;
2137   S32 state = getBinLog2(trig.state & TSShape::Trigger::StateMask) + 1;
2138   if (!(trig.state & TSShape::Trigger::StateOn))
2139      state = -state;
2140
2141   static const U32 bufSize = 32;
2142   char* returnBuffer = Con::getReturnBuffer(bufSize);
2143   dSprintf(returnBuffer, bufSize, "%d %d", frame, state);
2144   return returnBuffer;
2145}}
2146
2147DefineTSShapeConstructorMethod( addTrigger, bool, ( const char* name, S32 keyframe, S32 state ),,
2148   ( name, keyframe, state ), false,
2149   "Add a new trigger to the sequence.\n"
2150   "@param name name of the sequence to modify\n"
2151   "@param keyframe keyframe of the new trigger\n"
2152   "@param state of the new trigger\n"
2153   "@return true if successful, false otherwise\n\n"
2154   "@tsexample\n"
2155   "%this.addTrigger( \"walk\", 3, 1 );\n"
2156   "%this.addTrigger( \"walk\", 5, -1 );\n"
2157   "@endtsexample\n" )
2158{
2159   if ( !mShape->addTrigger( name, keyframe, state ) )
2160      return false;
2161
2162   ADD_TO_CHANGE_SET();
2163   return true;
2164}}
2165
2166DefineTSShapeConstructorMethod( removeTrigger, bool, ( const char* name, S32 keyframe, S32 state ),,
2167   ( name, keyframe, state ), false,
2168   "Remove a trigger from the sequence.\n"
2169   "@param name name of the sequence to modify\n"
2170   "@param keyframe keyframe of the trigger to remove\n"
2171   "@param state of the trigger to remove\n"
2172   "@return true if successful, false otherwise\n\n"
2173   "@tsexample\n"
2174   "%this.removeTrigger( \"walk\", 3, 1 );\n"
2175   "@endtsexample\n" )
2176{
2177   if ( !mShape->removeTrigger( name, keyframe, state ) )
2178      return false;
2179
2180   ADD_TO_CHANGE_SET();
2181   return true;
2182}}
2183
2184
2185//-----------------------------------------------------------------------------
2186// Change-Set manipulation
2187TSShapeConstructor::ChangeSet::eCommandType TSShapeConstructor::ChangeSet::getCmdType(const char* name)
2188{
2189   #define RETURN_IF_MATCH(type)   if (!dStricmp(name, #type)) return Cmd##type
2190
2191   RETURN_IF_MATCH(AddNode);
2192   else RETURN_IF_MATCH(RemoveNode);
2193   else RETURN_IF_MATCH(RenameNode);
2194   else RETURN_IF_MATCH(SetNodeTransform);
2195   else RETURN_IF_MATCH(SetNodeParent);
2196
2197   else RETURN_IF_MATCH(AddMesh);
2198   else RETURN_IF_MATCH(AddPrimitive);
2199   else RETURN_IF_MATCH(SetMeshSize);
2200   else RETURN_IF_MATCH(SetMeshType);
2201   else RETURN_IF_MATCH(SetMeshMaterial);
2202   else RETURN_IF_MATCH(RemoveMesh);
2203
2204   else RETURN_IF_MATCH(SetObjectNode);
2205   else RETURN_IF_MATCH(RenameObject);
2206   else RETURN_IF_MATCH(RemoveObject);
2207   else RETURN_IF_MATCH(SetBounds);
2208
2209   else RETURN_IF_MATCH(SetDetailLevelSize);
2210   else RETURN_IF_MATCH(RenameDetailLevel);
2211   else RETURN_IF_MATCH(RemoveDetailLevel);
2212   else RETURN_IF_MATCH(AddImposter);
2213   else RETURN_IF_MATCH(RemoveImposter);
2214   else RETURN_IF_MATCH(AddCollisionDetail);
2215
2216   else RETURN_IF_MATCH(AddSequence);
2217   else RETURN_IF_MATCH(RemoveSequence);
2218   else RETURN_IF_MATCH(RenameSequence);
2219   else RETURN_IF_MATCH(SetSequenceCyclic);
2220   else RETURN_IF_MATCH(SetSequenceBlend);
2221   else RETURN_IF_MATCH(SetSequencePriority);
2222   else RETURN_IF_MATCH(SetSequenceGroundSpeed);
2223
2224   else RETURN_IF_MATCH(AddTrigger);
2225   else RETURN_IF_MATCH(RemoveTrigger);
2226
2227   else return CmdInvalid;
2228
2229   #undef RETURN_IF_MATCH
2230}
2231
2232void TSShapeConstructor::ChangeSet::write(TSShape* shape, Stream& stream, const String& savePath)
2233{
2234   // First make a copy of the change-set
2235   ChangeSet output;
2236   for ( S32 i = 0; i < mCommands.size(); i++ )
2237      output.add(mCommands[i]);
2238
2239   // Remove all __backup__ sequences (used during Shape Editing)
2240   if (shape)
2241   {
2242      for (S32 i = 0; i < shape->sequences.size(); i++)
2243      {
2244         const char* seqName = shape->getName( shape->sequences[i].nameIndex );
2245         if ( dStrStartsWith( seqName, "__backup__" ) )
2246         {
2247            Command cmd( "removeSequence" );
2248            cmd.addArgs( seqName );
2249            output.add( cmd );
2250         }
2251      }
2252   }
2253
2254   // Write the final change set to the stream
2255   for (U32 i = 0; i < output.mCommands.size(); i++)
2256   {
2257      const Command& cmd = output.mCommands[i];
2258
2259      // Write the command
2260      stream.writeTabs( 1 );
2261      stream.writeText( "%this." );
2262
2263      stream.writeText( cmd.name );
2264      stream.writeText( "(" );
2265
2266      if ( cmd.argc > 0 )
2267      {
2268         // Use relative paths when possible
2269         String str( cmd.argv[0] );
2270         if ( str.startsWith( savePath ) )
2271         {
2272            // Need to add "./" to a local file for the script file system.  Otherwise
2273            // it will be assumed to be a full and complete path when it comes to loading.
2274            str = "./" + str.substr( savePath.length() + 1 );
2275         }
2276
2277         stream.writeText( "\"" );
2278         stream.write( str.length(), str.c_str() );
2279         stream.writeText( "\"" );
2280
2281         // Write remaining arguments and newline
2282         for (U32 j = 1; j < cmd.argc; j++)
2283         {
2284            // Use relative paths when possible
2285            String relStr( cmd.argv[j] );
2286            if (relStr.startsWith( savePath ) )
2287            relStr = relStr.substr( savePath.length() + 1 );
2288
2289            stream.writeText( ", \"" );
2290            stream.write(relStr.length(), relStr.c_str() );
2291            stream.writeText( "\"" );
2292         }
2293      }
2294      stream.writeText( ");\r\n" );
2295   }
2296}
2297
2298
2299TiXmlElement *createNodeWithText( const char* name, const char* text )
2300{
2301   TiXmlElement* node = new TiXmlElement( name );
2302   node->LinkEndChild( new TiXmlText( text ) );
2303   return node;
2304}
2305
2306void TSShapeConstructor::ChangeSet::add( TSShapeConstructor::ChangeSet::Command& cmd )
2307{
2308   // Lookup the command type
2309   cmd.type = getCmdType( cmd.name );if ( cmd.type == CmdInvalid )
2310      return;
2311
2312   // Ignore operations on __proxy__ sequences (they are only used by the shape editor)
2313   if ( cmd.argv[0].startsWith( "__proxy__" ) || ((cmd.type == CmdAddSequence) && cmd.argv[1].startsWith( "__proxy__") ) )
2314      return;
2315
2316   // Add the command to the change set (apply command specific collapsing)
2317   bool addCommand = true;
2318   switch ( cmd.type )
2319   {
2320
2321   // Node commands
2322   case CmdSetNodeParent:           addCommand = addCmd_setNodeParent( cmd );             break;
2323   case CmdSetNodeTransform:        addCommand = addCmd_setNodeTransform( cmd );          break;
2324   case CmdRenameNode:              addCommand = addCmd_renameNode( cmd );                break;
2325   case CmdRemoveNode:              addCommand = addCmd_removeNode( cmd );                break;
2326
2327   // Mesh commands
2328   case CmdSetMeshSize:             addCommand = addCmd_setMeshSize( cmd );               break;
2329   case CmdSetMeshType:             addCommand = addCmd_setMeshType( cmd );               break;
2330   case CmdSetMeshMaterial:         addCommand = addCmd_setMeshMaterial( cmd );           break;
2331   case CmdRemoveMesh:              addCommand = addCmd_removeMesh( cmd );                break;
2332
2333   // Object commands
2334   case CmdSetObjectNode:           addCommand = addCmd_setObjectNode( cmd );             break;
2335   case CmdRenameObject:            addCommand = addCmd_renameObject( cmd );              break;
2336   case CmdRemoveObject:            addCommand = addCmd_removeObject( cmd );              break;
2337   case CmdSetBounds:               addCommand = addCmd_setBounds( cmd );                 break;
2338
2339   // Detail level commands
2340   case CmdRenameDetailLevel:       addCommand = addCmd_renameDetailLevel( cmd );         break;
2341   case CmdRemoveDetailLevel:       addCommand = addCmd_removeDetailLevel( cmd );         break;
2342   case CmdSetDetailLevelSize:      addCommand = addCmd_setDetailSize( cmd );             break;
2343   case CmdAddImposter:             addCommand = addCmd_addImposter( cmd );               break;
2344   case CmdRemoveImposter:          addCommand = addCmd_removeImposter( cmd );            break;
2345
2346   // Sequence commands
2347   case CmdAddSequence:             addCommand = addCmd_addSequence( cmd );               break;
2348   case CmdSetSequencePriority:     addCommand = addCmd_setSequencePriority( cmd );       break;
2349   case CmdSetSequenceGroundSpeed:  addCommand = addCmd_setSequenceGroundSpeed( cmd );    break;
2350   case CmdSetSequenceCyclic:       addCommand = addCmd_setSequenceCyclic( cmd );         break;
2351   case CmdSetSequenceBlend:        addCommand = addCmd_setSequenceBlend( cmd );          break;
2352   case CmdRenameSequence:          addCommand = addCmd_renameSequence( cmd );            break;
2353   case CmdRemoveSequence:          addCommand = addCmd_removeSequence( cmd );            break;
2354
2355   case CmdAddTrigger:              addCommand = addCmd_addTrigger( cmd );                break;
2356   case CmdRemoveTrigger:           addCommand = addCmd_removeTrigger( cmd );             break;
2357
2358   // Other commands that do not have optimizations
2359   default:
2360      break;
2361   }
2362
2363   if ( addCommand )
2364      mCommands.push_back( cmd );
2365}
2366
2367//-----------------------------------------------------------------------------
2368// NODE COMMANDS
2369
2370bool TSShapeConstructor::ChangeSet::addCmd_setNodeParent( const TSShapeConstructor::ChangeSet::Command& newCmd )
2371{
2372   // No dependencies, replace the parent argument for any previous addNode or
2373   // setNodeParent.
2374
2375   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2376   {
2377      Command& cmd = mCommands[index];
2378      switch ( cmd.type )
2379      {
2380      case CmdAddNode:
2381      case CmdSetNodeParent:
2382         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2383         {
2384            cmd.argv[1] = newCmd.argv[1];              // Replace parent argument
2385            return false;
2386         }
2387         break;
2388
2389      default:
2390         break;
2391      }
2392   }
2393
2394   return true;
2395
2396}
2397
2398bool TSShapeConstructor::ChangeSet::addCmd_setNodeTransform( const TSShapeConstructor::ChangeSet::Command& newCmd )
2399{
2400   // No dependencies, replace the parent argument for any previous addNode or
2401   // setNodeParent.
2402
2403   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2404   {
2405      Command& cmd = mCommands[index];
2406      switch ( cmd.type )
2407      {
2408      case CmdAddNode:
2409         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2410         {
2411            cmd.argc = newCmd.argc + 1;         // Replace transform argument
2412            cmd.argv[2] = newCmd.argv[1];
2413            cmd.argv[3] = newCmd.argv[2];
2414            return false;
2415         }
2416         break;
2417
2418      case CmdSetNodeTransform:
2419         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2420         {
2421            cmd = newCmd;                       // Collapse successive set transform commands
2422            return false;
2423         }
2424         break;
2425
2426      default:
2427         break;
2428      }
2429   }
2430
2431   return true;
2432}
2433
2434bool TSShapeConstructor::ChangeSet::addCmd_renameNode( const TSShapeConstructor::ChangeSet::Command& newCmd )
2435{
2436   // Replace name argument for previous addNode or renameNode, but stop
2437   // if the new name is already in use (can occur if 2 nodes switch names). eg.
2438   // A->C
2439   // B->A
2440   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
2441
2442   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2443   {
2444      Command& cmd = mCommands[index];
2445      switch ( cmd.type )
2446      {
2447      case CmdAddNode:
2448         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2449         {
2450            cmd.argv[0] = newCmd.argv[1];       // Replace initial name argument
2451            return false;
2452         }
2453         break;
2454
2455      case CmdRenameNode:
2456         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2457         {
2458            cmd.argv[1] = newCmd.argv[1];       // Collapse successive renames
2459            if ( namesEqual( cmd.argv[0], cmd.argv[1] ) )
2460               mCommands.erase(index);          // Ignore empty renames
2461            return false;
2462         }
2463         else if ( namesEqual( cmd.argv[0], newCmd.argv[1] ) )
2464            return true;                        // Name is in use, cannot go back further
2465         break;
2466
2467      default:
2468         break;
2469      }
2470   }
2471
2472   return true;
2473}
2474
2475bool TSShapeConstructor::ChangeSet::addCmd_removeNode( const TSShapeConstructor::ChangeSet::Command& newCmd )
2476{
2477   // No dependencies. Remove any previous command that references the node
2478
2479   String nodeName( newCmd.argv[0] );
2480   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2481   {
2482      Command& cmd = mCommands[index];
2483      switch ( cmd.type )
2484      {
2485      case CmdAddNode:
2486         if ( namesEqual( cmd.argv[0], nodeName ) )
2487         {
2488            mCommands.erase(index);             // Remove the added node
2489            return false;
2490         }
2491         break;
2492
2493      case CmdSetNodeTransform:
2494      case CmdSetNodeParent:
2495         if ( namesEqual( cmd.argv[0], nodeName ) )
2496            mCommands.erase(index);             // Remove any commands that reference the removed node
2497         break;
2498
2499      case CmdRenameNode:
2500         if ( namesEqual( cmd.argv[1], nodeName ) )
2501         {
2502            nodeName = cmd.argv[0];             // Node is renamed
2503            mCommands.erase(index);
2504         }
2505         break;
2506
2507      default:
2508         break;
2509      }
2510   }
2511
2512   return true;
2513}
2514
2515//-----------------------------------------------------------------------------
2516// SEQUENCE COMMANDS
2517
2518bool TSShapeConstructor::ChangeSet::addCmd_addSequence( TSShapeConstructor::ChangeSet::Command& newCmd )
2519{
2520   // For sequences added from ShapeEditor __backup sequences, search backwards for
2521   // any changes made to the source of the __backup sequence. If none are found,
2522   // use the __backup source instead of the __backup.
2523   const char* backupPrefix = "__backup__";
2524   if ( !newCmd.argv[0].startsWith( backupPrefix ) )
2525      return true;
2526
2527   S32 start = dStrlen( backupPrefix );
2528   S32 end = newCmd.argv[0].find( '_', 0, String::Right );
2529   String sourceName = newCmd.argv[0].substr( start, end - start );
2530
2531   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2532   {
2533      Command& cmd = mCommands[index];
2534      switch ( cmd.type )
2535      {
2536      case CmdSetSequencePriority:
2537      case CmdSetSequenceCyclic:
2538      case CmdSetSequenceBlend:
2539      case CmdSetSequenceGroundSpeed:
2540         // __backup sequence source has been modified => cannot go back further
2541         if ( namesEqual( cmd.argv[0], sourceName ) )
2542            return true;
2543
2544      case CmdAddSequence:
2545         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2546         {
2547            // No changes to the __backup sequence were found
2548            newCmd.argv[0] = sourceName;
2549            return true;
2550         }
2551         break;
2552
2553      default:
2554         break;
2555      }
2556   }
2557
2558   return true;
2559}
2560
2561bool TSShapeConstructor::ChangeSet::addCmd_setSequencePriority( const TSShapeConstructor::ChangeSet::Command& newCmd )
2562{
2563   // Replace any previous setSequencePriority command, but stop if the
2564   // sequence is used as a source for addSequence (since the priority is
2565   // copied).
2566
2567   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2568   {
2569      Command& cmd = mCommands[index];
2570      switch ( cmd.type )
2571      {
2572      case CmdSetSequencePriority:
2573         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2574         {
2575            cmd.argv[1] = newCmd.argv[1];       // Collapse successive set priority commands
2576            return false;
2577         }
2578         break;
2579
2580      case CmdAddSequence:
2581         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2582            return true;                        // Sequence is used as source => cannot go back further
2583         break;
2584
2585      default:
2586         break;
2587      }
2588   }
2589
2590   return true;
2591}
2592
2593bool TSShapeConstructor::ChangeSet::addCmd_setSequenceGroundSpeed( const TSShapeConstructor::ChangeSet::Command& newCmd )
2594{
2595   // Replace any previous setSequenceGroundSpeed command, but stop if the
2596   // sequence is used as a source for addSequence (since the priority is
2597   // copied).
2598
2599   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2600   {
2601      Command& cmd = mCommands[index];
2602      switch ( cmd.type )
2603      {
2604      case CmdSetSequenceGroundSpeed:
2605         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2606         {
2607            cmd.argv[1] = newCmd.argv[1];       // Collapse successive set ground speed commands
2608            return false;
2609         }
2610         break;
2611
2612      case CmdAddSequence:
2613         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2614            return true;                        // Sequence is used as source => cannot go back further
2615         break;
2616
2617      default:
2618         break;
2619      }
2620   }
2621
2622   return true;
2623}
2624
2625bool TSShapeConstructor::ChangeSet::addCmd_setSequenceCyclic( const TSShapeConstructor::ChangeSet::Command& newCmd )
2626{
2627   // Replace any previous setSequenceCyclic command, but stop if the
2628   // sequence is used as a source for addSequence (since the priority is
2629   // copied).
2630
2631   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2632   {
2633      Command& cmd = mCommands[index];
2634      switch ( cmd.type )
2635      {
2636      case CmdSetSequenceCyclic:
2637         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) &&
2638              dAtob( cmd.argv[1] ) != dAtob( newCmd.argv[1] ) )
2639         {
2640            mCommands.erase(index);             // ignore both setCyclic commands (1 undoes the other)
2641            return false;
2642         }
2643         break;
2644
2645      case CmdAddSequence:
2646         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2647            return true;                        // Sequence is used as source => cannot go back further
2648         break;
2649
2650      default:
2651         break;
2652      }
2653   }
2654
2655   return true;
2656}
2657
2658bool TSShapeConstructor::ChangeSet::addCmd_setSequenceBlend( const TSShapeConstructor::ChangeSet::Command& newCmd )
2659{
2660   // Replace any previous setSequenceBlend command, but stop if the
2661   // sequence is used as a source for addSequence (since the priority is
2662   // copied).
2663
2664   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2665   {
2666      Command& cmd = mCommands[index];
2667      switch ( cmd.type )
2668      {
2669      case CmdSetSequenceBlend:
2670         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) &&
2671              dAtob( cmd.argv[1] ) != dAtob( newCmd.argv[1] )     &&
2672              namesEqual( cmd.argv[2], newCmd.argv[2] ) &&
2673              dAtoi( cmd.argv[3] ) == dAtoi( newCmd.argv[3] ) )
2674         {
2675            mCommands.erase(index);             // Ignore both setBlend commands (1 undoes the other)
2676            return false;
2677         }
2678         break;
2679
2680      case CmdAddSequence:
2681         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2682            return true;                        // Sequence is used as source => cannot go back further
2683         break;
2684
2685      default:
2686         break;
2687      }
2688   }
2689
2690   return true;
2691}
2692
2693bool TSShapeConstructor::ChangeSet::addCmd_renameSequence( const TSShapeConstructor::ChangeSet::Command& newCmd )
2694{
2695   // Replace name argument for previous addSequence or renameSequence, but stop
2696   // if the new name is already in use (can occur if 2 nodes switch names). eg.
2697   // A->C
2698   // B->A
2699   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
2700   //
2701   // Once a previous command is found, go forward through the command list and
2702   // update any references to the old name
2703
2704   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2705   {
2706      Command& cmd = mCommands[index];
2707      switch ( cmd.type )
2708      {
2709      case CmdRenameSequence:
2710         if ( namesEqual( cmd.argv[0], newCmd.argv[1] ) && !namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2711            return true;                              // Name is in use => cannot go back further
2712         // fall through to common processing
2713      case CmdAddSequence:
2714         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2715         {
2716            if ( cmd.type == CmdRenameSequence )
2717            {
2718               cmd.argv[1] = newCmd.argv[1];          // Collapse successive renames
2719               if ( namesEqual( cmd.argv[0], cmd.argv[1] ) )
2720                  mCommands.erase(index);             // Ignore empty renames
2721            }
2722            else if ( cmd.type == CmdAddSequence )
2723            {
2724               cmd.argv[1] = newCmd.argv[1];          // Replace initial name argument
2725            }
2726
2727            // Update any references to the old name
2728            for ( S32 j = index + 1; j < mCommands.size(); j++ )
2729            {
2730               Command& cmd2 = mCommands[j];
2731               switch ( cmd2.type )
2732               {
2733               case CmdSetSequencePriority:
2734               case CmdSetSequenceCyclic:
2735               case CmdSetSequenceBlend:
2736               case CmdSetSequenceGroundSpeed:
2737                  if ( namesEqual( cmd2.argv[0], newCmd.argv[0] ) )
2738                     cmd2.argv[0] = newCmd.argv[1];
2739                  break;
2740               }
2741            }
2742            return false;
2743         }
2744         break;
2745
2746      default:
2747         break;
2748      }
2749   }
2750
2751   return true;
2752}
2753
2754bool TSShapeConstructor::ChangeSet::addCmd_removeSequence( const TSShapeConstructor::ChangeSet::Command& newCmd )
2755{
2756   // Remove any previous command that references the sequence, but stop if the
2757   // sequence is used as a source for addSequence
2758
2759   String seqName( newCmd.argv[0] );
2760   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2761   {
2762      Command& cmd = mCommands[index];
2763      switch ( cmd.type )
2764      {
2765      case CmdAddSequence:
2766         if ( namesEqual( cmd.argv[1], seqName ) )
2767         {
2768            mCommands.erase( index );           // Remove the added sequence
2769            return false;
2770         }
2771         else if ( namesEqual( cmd.argv[0], seqName ) )
2772         {
2773            // Removed sequence is used as source for another sequence => can't
2774            // go back any further
2775            return true;
2776         }
2777         break;
2778
2779      case CmdRenameSequence:
2780         if ( namesEqual( cmd.argv[1], seqName ) )
2781         {
2782            seqName = cmd.argv[0];              // Sequence is renamed
2783            mCommands.erase( index );
2784         }
2785         break;
2786
2787      case CmdSetSequencePriority:
2788      case CmdSetSequenceGroundSpeed:
2789      case CmdSetSequenceCyclic:
2790      case CmdSetSequenceBlend:
2791      case CmdAddTrigger:
2792      case CmdRemoveTrigger:
2793         if ( namesEqual( cmd.argv[0], seqName ) )
2794            mCommands.erase( index );           // Remove any commands that reference the removed sequence
2795         break;
2796
2797      default:
2798         break;
2799      }
2800   }
2801
2802   return true;
2803}
2804
2805bool TSShapeConstructor::ChangeSet::addCmd_addTrigger( const TSShapeConstructor::ChangeSet::Command& newCmd )
2806{
2807   // Remove a matching removeTrigger command, but stop if the sequence is used as
2808   // a source for addSequence (since triggers are copied).
2809
2810   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2811   {
2812      Command& cmd = mCommands[index];
2813      switch ( cmd.type )
2814      {
2815      case CmdRemoveTrigger:
2816         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) &&
2817              cmd.argv[1] == newCmd.argv[1] &&
2818              cmd.argv[2] == newCmd.argv[2] )
2819         {
2820            mCommands.erase(index);             // Remove previous removeTrigger command
2821            return false;
2822         }
2823         break;
2824
2825      case CmdAddSequence:
2826         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2827            return true;                        // Sequence is used as a source => cannot go back further
2828         break;
2829
2830      default:
2831         break;
2832      }
2833   }
2834
2835   return true;
2836}
2837
2838bool TSShapeConstructor::ChangeSet::addCmd_removeTrigger( const TSShapeConstructor::ChangeSet::Command& newCmd )
2839{
2840   // Remove a matching addTrigger command, but stop if the sequence is used as
2841   // a source for addSequence (since triggers are copied).
2842
2843   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2844   {
2845      Command& cmd = mCommands[index];
2846      switch ( cmd.type )
2847      {
2848      case CmdAddTrigger:
2849         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) &&
2850              cmd.argv[1] == newCmd.argv[1] &&
2851              cmd.argv[2] == newCmd.argv[2] )
2852         {
2853            mCommands.erase(index);             // Remove previous addTrigger command
2854            return false;
2855         }
2856         break;
2857
2858      case CmdAddSequence:
2859         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
2860            return true;                        // Sequence is used as a source => cannot go back further
2861         break;
2862
2863      default:
2864         break;
2865      }
2866   }
2867
2868   return true;
2869}
2870
2871//-----------------------------------------------------------------------------
2872// MESH COMMANDS
2873
2874bool TSShapeConstructor::ChangeSet::addCmd_setMeshSize( const TSShapeConstructor::ChangeSet::Command& newCmd )
2875{
2876   // Replace size argument for previous addMesh or setMeshSize, but stop if the
2877   // new name is already in use (can occur if 2 nodes switch names). eg.
2878   // A->C
2879   // B->A
2880   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
2881
2882   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2883   {
2884      Command& cmd = mCommands[index];
2885      switch ( cmd.type )
2886      {
2887      case CmdAddMesh:
2888         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2889         {
2890            cmd.argv[0] = newCmd.argv[1];       // Replace initial size argument
2891            return false;
2892         }
2893         break;
2894
2895      case CmdSetMeshSize:
2896         if ( cmd.argv[1] == newCmd.argv[0] )
2897         {
2898            cmd.argv[1] = newCmd.argv[1];       // Collapse successive size sets
2899            if ( cmd.argv[0] == cmd.argv[1] )
2900               mCommands.erase(index);          // Ignore empty resizes
2901            return false;
2902         }
2903         else if ( cmd.argv[0] == newCmd.argv[1] )
2904            return true;                        // Size is in use, cannot go back further
2905         break;
2906
2907      default:
2908         break;
2909      }
2910   }
2911
2912   return true;
2913}
2914
2915bool TSShapeConstructor::ChangeSet::addCmd_setMeshType( const TSShapeConstructor::ChangeSet::Command& newCmd )
2916{
2917   // Replace any previous setMeshType command, but stop if the mesh is used as
2918   // a source for addMesh (since the type is copied).
2919
2920   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2921   {
2922      Command& cmd = mCommands[index];
2923      switch ( cmd.type )
2924      {
2925      case CmdSetMeshType:
2926         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2927         {
2928            cmd.argv[1] = newCmd.argv[1];       // Collapse successive set type commands
2929            return false;
2930         }
2931         break;
2932
2933      case CmdAddMesh:
2934         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2935            return true;                        // Mesh is used as source => cannot go back further
2936         break;
2937
2938      default:
2939         break;
2940      }
2941   }
2942
2943   return true;
2944}
2945
2946bool TSShapeConstructor::ChangeSet::addCmd_setMeshMaterial( const TSShapeConstructor::ChangeSet::Command& newCmd )
2947{
2948   // Replace any previous setMeshMaterial command, but stop if the mesh is used as
2949   // a source for addMesh (since the materials are copied).
2950
2951   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2952   {
2953      Command& cmd = mCommands[index];
2954      switch ( cmd.type )
2955      {
2956      case CmdSetMeshMaterial:
2957         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2958         {
2959            cmd.argv[1] = newCmd.argv[1];       // Collapse successive set material commands
2960            return false;
2961         }
2962         break;
2963
2964      case CmdAddMesh:
2965         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
2966            return true;                        // Mesh is used as source => cannot go back further
2967         break;
2968
2969      default:
2970         break;
2971      }
2972   }
2973
2974   return true;
2975}
2976
2977bool TSShapeConstructor::ChangeSet::addCmd_removeMesh( const TSShapeConstructor::ChangeSet::Command& newCmd )
2978{
2979   // Remove any previous command that references the mesh, but stop if the mesh
2980   // is used as a source for addMesh
2981
2982   String meshName( newCmd.argv[0] );
2983   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
2984   {
2985      Command& cmd = mCommands[index];
2986      switch ( cmd.type )
2987      {
2988      case CmdAddMesh:
2989         if ( namesEqual( cmd.argv[0], meshName ) )
2990         {
2991            mCommands.erase( index );           // Remove the added mesh
2992            return false;
2993         }
2994         else if ( namesEqual( cmd.argv[2], meshName ) )
2995         {
2996            // Removed mesh is used as source for another mesh => can't go back
2997            // any further
2998            return true;
2999         }
3000         break;
3001
3002      case CmdAddPrimitive:
3003         if ( namesEqual( cmd.argv[0], meshName ) )
3004         {
3005            mCommands.erase( index );           // Remove the added primitive
3006            return false;
3007         }
3008         break;
3009
3010      case CmdSetMeshSize:
3011      case CmdSetMeshType:
3012      case CmdSetMeshMaterial:
3013         if ( namesEqual( cmd.argv[0], meshName ) )
3014            mCommands.erase( index );           // Remove any commands that reference the removed mesh
3015         break;
3016
3017      default:
3018         break;
3019      }
3020   }
3021
3022   return true;
3023}
3024
3025//-----------------------------------------------------------------------------
3026// OBJECT COMMANDS
3027
3028bool TSShapeConstructor::ChangeSet::addCmd_setObjectNode( const TSShapeConstructor::ChangeSet::Command& newCmd )
3029{
3030   // No dependencies, replace the node argument for any previous parent argument for any previous addNode or
3031   // setNodeParent.
3032
3033   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3034   {
3035      Command& cmd = mCommands[index];
3036      switch ( cmd.type )
3037      {
3038      case CmdAddMesh:
3039      {
3040         S32 dummy;
3041         if ( namesEqual( String::GetTrailingNumber(cmd.argv[0], dummy), newCmd.argv[0] ) )
3042         {
3043            cmd.argv[3] = newCmd.argv[1];    // Replace node argument
3044            return false;
3045         }
3046         break;
3047      }
3048
3049      case CmdSetObjectNode:
3050         if ( namesEqual( cmd.argv[0], newCmd.argv[0] ) )
3051         {
3052            cmd.argv[1] = newCmd.argv[1];
3053            return false;
3054         }
3055         break;
3056
3057      default:
3058         break;
3059      }
3060   }
3061
3062   return true;
3063}
3064
3065bool TSShapeConstructor::ChangeSet::addCmd_renameObject( const TSShapeConstructor::ChangeSet::Command& newCmd )
3066{
3067   // Replace name argument for previous renameObject, but stop if the new name
3068   // is already in use (can occur if 2 objects switch names). eg.
3069   // A->C
3070   // B->A
3071   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
3072
3073   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3074   {
3075      Command& cmd = mCommands[index];
3076      switch ( cmd.type )
3077      {
3078      case CmdRenameObject:
3079         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
3080         {
3081            cmd.argv[1] = newCmd.argv[1];       // Collapse successive renames
3082            if ( namesEqual( cmd.argv[0], cmd.argv[1] ) )
3083               mCommands.erase(index);          // Ignore empty renames
3084            return false;
3085         }
3086         else if ( namesEqual( cmd.argv[0], newCmd.argv[1] ) )
3087            return true;                        // Name is in use, cannot go back further
3088         break;
3089
3090      default:
3091         break;
3092      }
3093   }
3094
3095   return true;
3096}
3097
3098bool TSShapeConstructor::ChangeSet::addCmd_removeObject( const TSShapeConstructor::ChangeSet::Command& newCmd )
3099{
3100   // Remove any previous command that references the object, but stop if any
3101   // object mesh is used as a source for addMesh
3102
3103   S32 dummy;
3104   String objName( newCmd.argv[0] );
3105   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3106   {
3107      Command& cmd = mCommands[index];
3108      switch ( cmd.type )
3109      {
3110      case CmdAddMesh:
3111         if ( namesEqual( String::GetTrailingNumber(cmd.argv[0], dummy), objName ) )
3112         {
3113            mCommands.erase( index );           // Remove the added mesh
3114            // Must still add the removeObject command as there could be multiple
3115            // meshes in the object
3116         }
3117         else if ( namesEqual( String::GetTrailingNumber(cmd.argv[2], dummy), objName ) )
3118         {
3119            // Removed mesh is used as source for another mesh => can't go back
3120            // any further
3121            return true;
3122         }
3123         break;
3124
3125      case CmdRenameObject:
3126         if ( namesEqual( cmd.argv[1], objName ) )
3127         {
3128            objName = cmd.argv[0];              // Object is renamed
3129            mCommands.erase( index );
3130         }
3131         break;
3132
3133      case CmdSetObjectNode:
3134         if ( namesEqual( cmd.argv[0], objName ) )
3135            mCommands.erase( index );           // Remove any commands that reference the removed object
3136         break;
3137
3138      case CmdSetMeshSize:
3139      case CmdSetMeshType:
3140      case CmdSetMeshMaterial:
3141      case CmdRemoveMesh:
3142         if ( namesEqual( String::GetTrailingNumber(cmd.argv[0], dummy), objName ) )
3143            mCommands.erase( index );           // Remove comands that reference the removed object
3144         break;
3145
3146      default:
3147         break;
3148      }
3149   }
3150
3151   return true;
3152}
3153
3154bool TSShapeConstructor::ChangeSet::addCmd_setBounds( const TSShapeConstructor::ChangeSet::Command& newCmd )
3155{
3156   // Only the last bounds update applies, so replace any previous command.
3157
3158   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3159   {
3160      Command& cmd = mCommands[index];
3161      switch ( cmd.type )
3162      {
3163      case CmdSetBounds:
3164         mCommands.erase( index );
3165         break;
3166
3167      default:
3168         break;
3169      }
3170   }
3171
3172   return true;
3173}
3174
3175//-----------------------------------------------------------------------------
3176// DETAIL COMMANDS
3177
3178bool TSShapeConstructor::ChangeSet::addCmd_renameDetailLevel( const TSShapeConstructor::ChangeSet::Command& newCmd )
3179{
3180   // Replace name argument for previous renameDetailLevel, but stop if the new
3181   // name is already in use (can occur if 2 objects switch names). eg.
3182   // A->C
3183   // B->A
3184   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
3185
3186   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3187   {
3188      Command& cmd = mCommands[index];
3189      switch ( cmd.type )
3190      {
3191      case CmdRenameDetailLevel:
3192         if ( namesEqual( cmd.argv[1], newCmd.argv[0] ) )
3193         {
3194            cmd.argv[1] = newCmd.argv[1];       // Collapse successive renames
3195            if ( namesEqual( cmd.argv[0], cmd.argv[1] ) )
3196               mCommands.erase(index);          // Ignore empty renames
3197            return false;
3198         }
3199         else if ( namesEqual( cmd.argv[0], newCmd.argv[1] ) )
3200            return true;                        // Name is in use, cannot go back further
3201         break;
3202
3203      default:
3204         break;
3205      }
3206   }
3207
3208   return true;
3209}
3210
3211bool TSShapeConstructor::ChangeSet::addCmd_removeDetailLevel( const TSShapeConstructor::ChangeSet::Command& newCmd )
3212{
3213   // Remove any previous command that references the detail, but stop if a mesh
3214   // is used as a source for addMesh
3215
3216   S32 detSize = dAtoi( newCmd.argv[0] );
3217   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3218   {
3219      Command& cmd = mCommands[index];
3220      S32 size;
3221
3222      switch ( cmd.type )
3223      {
3224      case CmdAddMesh:
3225         String::GetTrailingNumber( cmd.argv[2], size );
3226         if ( size == detSize )
3227         {
3228            // Removed detail is used as source for another mesh => can't go back
3229            // any further
3230            return true;
3231         }
3232         // fall through
3233
3234      case CmdAddPrimitive:
3235      case CmdSetMeshSize:
3236      case CmdSetMeshType:
3237      case CmdSetMeshMaterial:
3238      case CmdRemoveMesh:
3239         String::GetTrailingNumber( cmd.argv[0], size );
3240         if ( size == detSize )
3241            mCommands.erase( index );
3242         break;
3243
3244      case CmdAddImposter:
3245      case CmdAddCollisionDetail:
3246         if ( dAtoi(cmd.argv[0]) == detSize )
3247         {
3248            mCommands.erase( index );
3249            return false;
3250         }
3251         break;
3252
3253      default:
3254         break;
3255      }
3256   }
3257
3258   return true;
3259}
3260
3261bool TSShapeConstructor::ChangeSet::addCmd_setDetailSize( const TSShapeConstructor::ChangeSet::Command& newCmd )
3262{
3263   // Similar to renameXXX. Replace size argument for previous addImposter or
3264   // setDetailLevelSize, but stop if the new size is already in use (can occur
3265   // if 2 details switch sizes). eg.
3266   // A->C
3267   // B->A
3268   // C->B  (cannot replace the previous A->C with A->B as 'B' is in use)
3269
3270   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3271   {
3272      Command& cmd = mCommands[index];
3273      switch ( cmd.type )
3274      {
3275      case CmdAddImposter:
3276         if ( cmd.argv[0] == newCmd.argv[0] )
3277         {
3278            cmd.argv[0] = newCmd.argv[1];       // Change detail size argument
3279            return false;
3280         }
3281         break;
3282
3283      case CmdSetDetailLevelSize:
3284         if ( cmd.argv[1] == newCmd.argv[0] )
3285         {
3286            cmd.argv[1] = newCmd.argv[1];       // Collapse successive detail size changes
3287            if ( cmd.argv[0] == cmd.argv[1] )
3288               mCommands.erase(index);          // Ignore empty changes
3289            return false;
3290         }
3291         else if ( cmd.argv[0] == newCmd.argv[1] )
3292            return true;                        // Detail size already in use => cannot go back further
3293         break;
3294
3295      default:
3296         break;
3297      }
3298   }
3299
3300   return true;
3301}
3302
3303bool TSShapeConstructor::ChangeSet::addCmd_addImposter( const TSShapeConstructor::ChangeSet::Command& newCmd )
3304{
3305   // Remove previous removeImposter, and replace any previous addImposter. If
3306   // replacing, also remove any setDetailLevelSize for the old imposter
3307
3308   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3309   {
3310      Command& cmd = mCommands[index];
3311      switch ( cmd.type )
3312      {
3313      case CmdAddImposter:
3314         // Replace the AddImposter command, but first remove any reference to
3315         // the added detail level.
3316         for ( S32 j = index + 1; j < mCommands.size(); j++ )
3317         {
3318            Command& cmd2 = mCommands[j];
3319            if ( ( cmd2.type == CmdSetDetailLevelSize ) &&
3320                 cmd2.argv[0] == cmd.argv[0] )
3321            {
3322               mCommands.erase(j);
3323               break;
3324            }
3325         }
3326         // Replace previous addImposter command
3327         cmd = newCmd;
3328         return false;
3329
3330      case CmdRemoveImposter:
3331         mCommands.erase(index);                // Remove previous removeImposter command
3332         break;
3333
3334      default:
3335         break;
3336      }
3337   }
3338
3339   return true;
3340}
3341
3342bool TSShapeConstructor::ChangeSet::addCmd_removeImposter( const TSShapeConstructor::ChangeSet::Command& newCmd )
3343{
3344   // Remove any previous addImposter, and also remove any setDetailLevelSize
3345   // for that imposter.
3346   // Always need to return true, since we could be removing imposters already
3347   // present in the shape (not added with addImposter).
3348
3349   for ( S32 index = mCommands.size()-1; index >= 0; index-- )
3350   {
3351      Command& cmd = mCommands[index];
3352      switch ( cmd.type )
3353      {
3354      case CmdAddImposter:
3355         // Remove the AddImposter command, but first remove any reference to
3356         // the added detail level.
3357         for ( S32 j = index + 1; j < mCommands.size(); j++ )
3358         {
3359            Command& cmd2 = mCommands[j];
3360            if ( ( cmd2.type == CmdSetDetailLevelSize ) &&
3361                 cmd2.argv[0] == cmd.argv[0] )
3362            {
3363               mCommands.erase(j);
3364               break;
3365            }
3366         }
3367         mCommands.erase(index);
3368         break;
3369
3370      default:
3371         break;
3372      }
3373   }
3374
3375   return true;
3376}
3377
3378void TSShapeConstructor::onActionPerformed()
3379{
3380   // Reinit shape if we modify stuff in the shape editor, otherwise delay
3381   if (!mLoadingShape)
3382   {
3383      if (mShape && mShape->needsReinit())
3384      {
3385         mShape->init();
3386      }
3387   }
3388}
3389