Game Development Community

need help about weapon's rotation on mount0 node

by Ahsan Muzaheed · in Artist Corner · 11/30/2011 (2:51 am) · 3 replies

my all model have same skeliton which is different from t3d's stock model's skeliton.
problem is about mounting stock weapons to my models's mount0 node.
see thses two picture below:

img834.imageshack.us/img834/7113/screenshot00100004x.png
img849.imageshack.us/img849/5185/screenshot00100000.png
it seems all weapon are mounting with a 180 degree rotation.
i have some other weapon packs that works fine with my models.
i need a solution only for t3d's stock weapon.
so that they will work with my models and also with t3d's stock actor models.
may be it is an easy problem to solve.
buy i am very much noob to modeling works and also with scripting about model.

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
11/30/2011 (4:52 am)
You can do this type of editing with the Shape Editor and the TSShapeConstructor object's ::onLoad function.

There are a lot of functions to fine tune art assets; rotating nodes in the root pose is one of them. After you do the editing in Shape Editor to visually get your results, Save the shape. This writes the edits to script in the onLoad function and saves the file beside the original asset binary. This scripting will NOT alter your original asset! It edits the asset as it loads it into memory; how smart! Thanks Chris R.

Looks like a 180 rotation in the Z axis, should do the trick[or whatever local direction is up]!

Select the node in the listing, use the 'Rotate Object' gizmo and get it where you like it!

I would do this to the mount0 node in the player shape, to get it oriented like Torque's examples. If weapons work with these shapes, those objects will need their mountPoints rotated to match the Torque weapons...basically get your nodes like the examples; hopefully they haven't been animated....

If all you want are the T3D weapons mounting correctly; save a copy of those edited to work with your new player shapes and weapons, leaving the stock ones for 'Soldier' if you are also utilizing that asset.

You can get an actual edited DTS binary, by using this:
function TP_LurkerDAE::onLoad(%this)
{
   %this.renameSequence("ambient", "timeline");
   %this.setSequenceCyclic("timeline", "0");
   %this.addSequence("timeline", "root", "0", "0", "1", "0");
   %this.addSequence("timeline", "fire", "0", "1", "1", "0");
   %this.addSequence("timeline", "fire_vis", "9", "18", "1", "0");
   %this.setNodeTransform("mountPoint", "-0.0584158 -8.64009e-005 -0.00557611 0 0 1 3.1416", "0");
   %this.saveShape("./myKoolTP_Lurker.dts");
}
at the end of the TP_Lurker.cs script, ;). So you would have the stock DTS files along with a new DTS file! Then edit out the last two lines to return the stock weapon to it's proper orientation; or add another line of script to undo what you did do...lol. Such as this:
%this.setNodeTransform("mountPoint", "-0.0584158 -8.64009e-005 -0.00557611 0 0 1 3.1416", "0");
   %this.saveShape("./myKoolTP_Lurker.dts");
   %this.setNodeTransform("mountPoint", "-0.0584158 -8.64009e-005 -0.00557611 0 0 1 0", "0");

enjoy


#2
11/30/2011 (12:28 pm)
thank you,very much.
that is the problem for which i abandon my weapon works last week.
now have some very useful information.

in present,i trying to solve a networking problem for my multiplayer project.
when it will be finished,i will work on your instructions.
#3
11/30/2011 (6:46 pm)
Quote:There are a lot of functions to fine tune art assets; rotating nodes in the root pose is one of them

it did the job very well.
my bad luck.in past,i have tried that technique several times.but not in root pose.i have tried for other animations except rootPose.
trying that always produced this:
http://www.youtube.com/watch?v=n35uV72w6dc&feature=player_embedded

i posted about that here:
http://www.garagegames.com/community/forums/viewthread/128283

but nobody told me to do that only in rootpose.
my bad.
what a waste of time only for one missing information.

well,it is working fine now. i have edited mount0 node of actor model.
i will try to do that by editing weapon model as you said in your 2nd technique.