Game Development Community

assign different "run" and "root" animation for same model file used in different datablock?

by Ahsan Muzaheed · in Artist Corner · 03/01/2012 (10:32 am) · 3 replies

here is what i want to do:

suppose, i have a model file named zzz.dts.
it has 2 "run" and 2 "root" animation.
and there is 9 AIPlayer datablock using that shape file(zzz.dts).

now i want to specify "run" animation from this 2 run animation for each AIPlayer's datablock.
same for root animation.

i know there is renameSequence().
but it will change the dts file's datablock.
which will affect on all other datablocks that use same model file(zzz.dts).

so my plan will be failed.

i can copy+paste+rename that file.so i will get more same file but in different name.
that will give me chance to make different datablock.but that will cost space and more datablock to make in script.
and that is what(space+script) i want to reduce.


any known solution or idea?

About the author

Torque 3D enthusiastic since 2010.Have been working in several T3D projects besides of Unreal Engine 4 and Unity 3D. NEED a hand with your project? SHoot me a mail. http://www.garagegames.com/community/forums /viewthread/138437/


#1
03/01/2012 (6:50 pm)
i have made more then 20 model from only 1 model and with different materials.
only for not being able to add variance in animation all will go in vain.

in that case i will have to add more model.but i want to make a lot off variance from only one model.

so any idea possible or not possible?
something like setMeshHidden(),that works on a datablock's shape file.not only on the model?
#2
03/02/2012 (12:50 pm)
Are each of the animations assigned a unique name? If so, in the actor's animation file (found in art/shapes/actors/<your actor folder> use addSequence to add animations - this is from the soldier_rigged.cs file:

%this.addSequence( "./Anims/PlayerAnim_Lurker_Run.dae Run", "Run", 0, -1);

...

   %this.setSequenceCyclic( "Run", true);

...

   %this.setSequenceGroundSpeed( "Run", "0 5.0 0");

Also notice, later you add a run sequence for the player when carrying a pistol:

%this.addSequence( "art/shapes/weapons/Ryder/PlayerAnims/PlayerAnim_Pistol_Run.dae Run", "Pistol_Run", 0, -1);

...

   %this.setSequenceCyclic( "Pistol_Run", true);

...

   %this.setSequenceGroundSpeed( "Pistol_Run", "0 5.0 0");

So, you can see that, as long as your animations have unique names you can assign them just fine.
#3
03/04/2012 (7:51 am)
Let me add that each of the different models will probably need their own setup scripts that add the animation sequences. I'm not sure you can do this on a per-instance basis, though perhaps if you exec'd the animation setup at the beginning of each appropriate player datablock....