Jump to content

"Back" , "Run" animation sequences


fLUnKnhaXYU

Recommended Posts

Ive made this new character , I export all actions from blender , set them up using the shape editor in version 3.9 . Its been working great except for a problem I'm having with the run and back sequences . It worked fine before I added the back animation and was using "run" in reverse for backward movement . After adding back animation it wants to use "back" , in reverse , for forward movement . Both are priority 1 . So far the model has , root , run , back sitting and a t-pose , all are set to priority 1 .. These sequences aren't on a single ambient track with markers , Torque just imports the actions from the DAE . Its a BVH rig and mocap animations but I don't think that really matters .

Link to comment
Share on other sites

UPDATE

the side left and right movement is using the run sequence . while pressing the forward and right keys the model is using the run sequence , While pressing forward and Left keys together the model uses the back sequence ..

I'm in the process of adding animations . I noticed the "forward + side" thing after adding a crouch forward that didn't work correctly , I removed the crouch root , added crouch which worked fine then afterward re-added the crouch forward . After that crouch and crouch_forward worked fine . My workflow with this is rather quick now so Ill add more animations and see if its some sort of dependency issue .

for anyone interested , its a BVH Hacker with CMU Hahne MOCAP files , Make Human , Blender ,Torque3d 3.9 workflow .

Link to comment
Share on other sites

UPDATE

So today , after I'd added "side" , the side animations are right , however , still forward is "back " in reverse and forward + right = "run" moving in a forward right diagonal as if a strafe sequence might be expected but , none are mentioned in the documentation Ive looked at , so far . All animations I have so far are these , in this order in the models CS file saved from the shape editor , in fact heres a copy of it so far in TorqueScript syntax , no less

function frozen_character_BigS_tstanceCDAE::onLoad(%this)
{
   %this.setSequenceCyclic("FrozbigS_walk2", "1");
   %this.renameSequence("FrozbigS_walk2", "__backup__FrozbigS_walk2_1");
   %this.addSequence("__backup__FrozbigS_walk2_1", "run", "1", "43", "1", "0");
   %this.setSequencePriority("run", "1");
   %this.setSequenceCyclic("Frozbigsroot01", "1");
   %this.renameSequence("Frozbigsroot01", "__backup__Frozbigsroot01_1");
   %this.addSequence("__backup__Frozbigsroot01_1", "root", "0", "150", "1", "0");
   %this.removeSequence("__backup__FrozbigS_walk2_1");
   %this.removeSequence("__backup__Frozbigsroot01_1");
   %this.setSequencePriority("root", "1");
   %this.setSequenceGroundSpeed("run", "1 1 1", "0 0 0");
   %this.setNodeTransform("mount0", "-0.771502 0.0319379 1.43147 -0.548273 0.534602 -0.643116 1.99253", "1");
   %this.renameSequence("Frozsitting_01", "sitting");
   %this.setSequenceCyclic("sitting", "1");
   %this.setSequenceCyclic("FrozbigSback_01", "1");
   %this.renameSequence("FrozbigSback_01", "back");
   %this.setSequencePriority("back", "2");
   %this.setSequencePriority("sitting", "1");
   %this.setSequenceCyclic("FrozbigS_CrouchR", "1");
   %this.renameSequence("FrozbigS_CrouchR", "crouch_root");
   %this.renameSequence("FrozbigS_CrouchF", "crouch_forward");
   %this.setSequenceCyclic("crouch_forward", "1");
   %this.setSequenceCyclic("Frozproneroot", "1");
   %this.renameSequence("Frozproneroot", "prone_root");
   %this.setSequenceCyclic("Frozbigs_side", "1");
   %this.renameSequence("Frozbigs_side", "side");
   %this.setSequencePriority("prone_Root", "1");
}

 

So , if I need mention , I'm not following any any special pattern for adding things here and I screw up , forgetting to rename or set the priority ,etc then have to redo things . The first couple of animations that you see ,the shape editor made backup copies of the sequences , perhaps due to changing the in and/or out frame and adds the frame numbers and padRot and PadTrans values while the animations after are simply renamed with the other values omitted .

I hope I haven't bored or annoyed or wasted any ones time , often times my problem is some minute error on my part ..Sooo , Preesh (<-an English colloquial meaning Thanks..

Link to comment
Share on other sites

"back " is doing what its supposed to do for backward movement , but , torque is using the "back" sequence for forward movement instead of the previously added "run" animation .

Also the combination of forward key plus right side key is the only thing which uses the "run" sequence , a forward animation

Link to comment
Share on other sites

GEE WIZ , I deleted the .CS and and .DTS . Then reloaded The model , re-did the sequence set-ups and everything works perfectly . here's a copy of the new CS file . I added the setSequenceGroundSpeed though . So I guess its more like "SOLVED SORTA" I dont know what the problem was but re-loading worked this time . Come to think of it , Its worked before ! :o majic?

function frozen_character_BigS_tstanceCDAE::onLoad(%this)
{
%this.setNodeTransform("mount0", "-0.771502 0.0319379 1.43147 -0.548273 0.534602 -0.643116 1.99253", "1"); //just pasted this from the old one
   %this.setSequenceCyclic("FrozbigS_CrouchF", "1");
   %this.renameSequence("FrozbigS_CrouchF", "crouch_forward");
   %this.setSequenceGroundSpeed("crouch_forward", "1 1 1", "0 0 0") ;//added this
   %this.setSequenceCyclic("FrozbigS_CrouchR", "1");
   %this.renameSequence("FrozbigS_CrouchR", "crouch_root");
   %this.renameSequence("Frozbigsroot01", "root");
   %this.setSequenceCyclic("root", "1");
   %this.setSequenceCyclic("FrozbigS_walk2", "1");
   %this.renameSequence("FrozbigS_walk2", "__backup__FrozbigS_walk2_1");
   %this.addSequence("__backup__FrozbigS_walk2_1", "run", "1", "43", "1", "0");
   %this.setSequenceCyclic("Frozbigs_side", "1");
   %this.setSequencePriority("Frozbigs_side", "1");
   %this.renameSequence("Frozbigs_side", "side");
   %this.setSequenceCyclic("FrozbigSback_01", "1");
   %this.renameSequence("FrozbigSback_01", "back");
   %this.renameSequence("Frozproneroot", "prone_root");
   %this.setSequenceCyclic("prone_root", "1");
   %this.renameSequence("Frozsitting_01", "sitting");
   %this.setSequenceCyclic("sitting", "1");
   %this.removeSequence("__backup__FrozbigS_walk2_1");
}
Link to comment
Share on other sites

!NEW DEVELOPEMENT!

So, I have a little to add to this today . After I edit the models CS file , with setSequenceGroundSpeed , problems occurred as before , with very mixed up

movement sequences . If I remove the edited line things return to normal . It looks as if Ill need delete the DTS again and do everything at once in the shape editor . I think that seems a bit odd and I am wondering what could be going wrong with editing the CS file . Heres the file , as you see all i had to to was REM out the new line for it to work properly again . If I un-REM it things become mixed up again .

function frozen_character_BigS_tstanceCDAE::onLoad(%this)
{
%this.setNodeTransform("mount0", "-0.771502 0.0319379 1.43147 -0.548273 0.534602 -0.643116 1.99253", "1");
   %this.setSequenceCyclic("FrozbigS_CrouchF", "1");
   %this.renameSequence("FrozbigS_CrouchF", "crouch_forward");
   %this.setSequenceGroundSpeed("crouch_forward", "1 1 1", "0 0 0");
   %this.setSequenceCyclic("FrozbigS_CrouchR", "1");
   %this.renameSequence("FrozbigS_CrouchR", "crouch_root");
   %this.renameSequence("Frozbigsroot01", "root");
   %this.setSequenceCyclic("root", "1");
   %this.setSequenceCyclic("FrozbigS_walk2", "1");
   %this.renameSequence("FrozbigS_walk2", "__backup__FrozbigS_walk2_1");
   %this.addSequence("__backup__FrozbigS_walk2_1", "run", "1", "43", "1", "0");
   %this.setSequenceCyclic("Frozbigs_side", "1");
   %this.setSequencePriority("Frozbigs_side", "1");
   %this.renameSequence("Frozbigs_side", "side");
   %this.setSequenceGroundSpeed("SIDE", "0.2 0 0", "0 0 0");
   %this.setSequenceCyclic("FrozbigSback_01", "1");
   %this.renameSequence("FrozbigSback_01", "back");
   %this.renameSequence("Frozproneroot", "prone_root");
   %this.setSequenceCyclic("prone_root", "1");
   %this.renameSequence("Frozsitting_01", "sitting");
   %this.setSequenceCyclic("sitting", "1");
   %this.removeSequence("__backup__FrozbigS_walk2_1");
  // %this.setSequenceGroundSpeed("run", "0.5 0 0", "0 0 0");
}
Link to comment
Share on other sites

Maybe the issues results from you using the cs file generated from the shape editor. I wrote my file by hand and everything worked fine.


Here is my example:

https://github.com/Duion/Uebergame/blob/master/art/shapes/actors/paintball_player/paintball_player.cs


Notice all animations are on the same ambient track and I define which frames is which animation, so I don't know how your setup looks like, but maybe it would be helpful if you would show it. I would be interested in where the engine loads the animations from and how that works etc.


Maybe you are missing the part where it defines which shape to use.


Also notice in the default full template with the soldier model each animation file is individually specified. Like here: https://github.com/Duion/Uebergame/blob/master/art/shapes/actors/Soldier/soldier_rigged.cs


So as you say you don't have the animations on one ambient track and are not specifying the frames to use and also not specifying which files to use I really wonder how you set everything up.

Link to comment
Share on other sites

Duion -

before I retartget a BVH file , I set the model to a T-pose using a T-pose action I saved earlier . then clear the action field . Re-targeting a file will create a new action in the stack . youll have to save the blend file in order to save any new actions .

A00blend-Actio.jpg


export with the options "Export Animations" and "All Actions" checked

a000-Exprt.jpg



I cleared out the characters folder in order to show the process start to finish . This is just after the export . I exported to the characters folder in Torque3D

A01new-Model-Folder.jpg


I already have a spawn sphere for this character and this is the first import .It shows the crouch position which is one of the first sequences listed in the shape editor . The character stays in this static pose throughout all of the movements .Nevermind the mess , Duion , some sorta city scape

A1first-Import.jpg





This is the first look at the model in the shape editor . It shows that all of the actions have been imported from the DAE file.

A2first-Shape-Editor.jpg


I exited without changes and nothing was saved to the CS file . restarted in a different level . Nothing has changed

B1second-Import.jpg

B2second-Shape-Editor.jpg


then I made changes to all of the sequences . The names that Torque3D engine uses , the loop box and priority then save the changes one at a time . Check to be sure that the name has changed , if you type in a name then do other things like check a box the name will revert to its original .

B3first-Seq-Edit.jpg

B4last-Seq-Edit.jpg


after going through and saving them all in the shape editor , I leave the level , start a new level and they are ready for action!. :)

.

root

C1action.jpg

run

C2Action.jpg


and since this was all done froma fresh start it all works nicely , now some ground speed changes are necessary ,,, TO BE CONTINUED


Thank you for your files as examples Duion , I used to make animations for TGE and I remember the timeline method and Im learning what I can about the Torque3D method .

Link to comment
Share on other sites

Thanks for the explanation, I may want to try the actions method some time later, but for now I was too lazy to learn how to do it and just used the old method that was already documented and proven to work.


But I think there is not much advantage to using actions comparing to using a single timeline, if all is saved in the same model file anyway, the real advantage of this method would be, if you had a file with all the animations and multiple 3D models with no animations saved in them, that then use the animations from the animations file. That way the game would be more modular and you would not have to animate each character individually, but can load in animations from another file. The default template is a bit set up like this, but it exported each animation into a different file and it still uses the timeline method, so it just makes things more complicated again.


So maybe you want to try this out, make a default model that has the animations in it and the model you actually use in game comes from a different file, I think this would be the most elegant solution.

Link to comment
Share on other sites

the only advantage i might see would be in a slightly simpler creation process where adding sequences to a timeline , adding and naming markers would be eliminated . Also , today I did the export new again with the proper names . All of the animations ran straight from the first import however all of the sequences looping had to be set . this is the resulting file . And editing the file causes the sequences to get mixed up , backwards in reverse for forward. and even forward for side > IDK .


This works fine

function frozen_character_BigS_tstanceCDAE::onLoad(%this)
{
echo("\c2TSSHAPECONSTRUCTOR ID = " @ %this);,-this is edited in and doesnt cause any problem
   %this.setSequenceCyclic("Crouch_Forward", "1");
   %this.setSequenceCyclic("crouch_Root", "1");
   %this.setSequenceCyclic("prone_Root", "1");
   %this.setSequenceCyclic("root", "1");
   %this.setSequenceCyclic("Run", "1");
   %this.setSequenceCyclic("Side", "1");
   %this.setSequenceCyclic("sitting", "1");
}

 

This is after editing the 2 lines in forward key causes Back in reverse in a forward direction and side keys are using forward in a sideways direction . ???

function frozen_character_BigS_tstanceCDAE::onLoad(%this)
{
echo("\c2TSSHAPECONSTRUCTOR ID = " @ %this);
%this.setsequencegroundSpeed("run", "-1 0 0", "0 0 0");<--------these get added and the animations get mixed up
%this.setsequencegroundSpeed("side", " 0 -0.3 0", "0 0 0");<----
   %this.setSequenceCyclic("Crouch_Forward", "1");
   %this.setSequenceCyclic("crouch_Root", "1");
   %this.setSequenceCyclic("prone_Root", "1");
   %this.setSequenceCyclic("root", "1");
   %this.setSequenceCyclic("Run", "1");
   %this.setSequenceCyclic("Side", "1");
   %this.setSequenceCyclic("sitting", "1");
}
Link to comment
Share on other sites

I used the run animation for backwards as well, it just reverses the run animation and I don't have to make a back animation, this is also how I think it is made to be used, you make a run animation and for backwards movement you use the same and it automatically gets reversed.

Link to comment
Share on other sites

A couple of things today that I think you'll like or maybe someone will find interesting . Im not sure of the usefulness as my understanding of the lower knowledge of inner-working may lend it all to naught . So ,

first thing is taking the Torque3D soldier approach for the animations .

I export a character model to a folder . This DAE file contains the armature , mesh , materials and T-Pose . no additional sequences .

example ; export to art/shapes/actors/MyNewCharacter

After that export a DAE with only the armature , animations and all actions , to wherever , such as

art/shapes/actors/myNewCharacter/myNewCharacter_anims . You can then add the sequences to your meshed model from the other file .

these are the files I used .


this one is for the meshed model with only the tstance . You can see where it adds sequences from the other file . And shows my breakthrough with the groundSpeed method which is explained below ,

singleton TSShapeConstructor(frozen_character_BigS_tstanceCDAE)
{
   baseShape = "./frozen_character_BigS_tstanceC.DAE";
   loadLights = "0";
   unit = "1.0";
   upAxis = "DEFAULT";
   lodType = "TrailingNumber";
   ignoreNodeScale = "0";
   adjustCenter = "0";
   adjustFloor = "0";
   forceUpdateMaterials = "0";
};
 
function frozen_character_bigS_tstanceCDAE::onLoad(%this)
 
{
 
%this.addSequence("./BigS_anims/frozen_character_bigS_poseLib.DAE back", "back", "0", "-1", "1", "0");
%this.addSequence("./BigS_anims/frozen_character_bigS_poseLib.DAE root", "root", "0", "-1", "1", "0");
%this.addSequence("./BigS_anims/frozen_character_bigS_poseLib.DAE run", "run", "1", "-1", "1", "0");
%this.addSequence("./BigS_anims/frozen_character_bigS_poseLib.DAE side", "side", "0", "-1", "1", "0");
 
 
%this.setSequenceGroundSpeed("back", "0 -1.5 0");
%this.setSequenceGroundSpeed("root", "0 0 0");
%this.setSequenceGroundSpeed("run", "0 2.7 0");
%this.setSequenceGroundSpeed("side", "3 0 0");

 

this one imports the file with the actions in it . There are a few more actions in the file and I only used these few to test it .

singleton TSShapeConstructor(frozen_character_BigS_poseLibDAE)
{
   baseShape = "./frozen_character_BigS_poseLib.DAE";
   loadLights = "0";
   unit = "1.0";
   upAxis = "DEFAULT";
   lodType = "TrailingNumber";
   ignoreNodeScale = "0";
   adjustCenter = "0";
   adjustFloor = "0";
   forceUpdateMaterials = "0";
};
 
 
function frozen_character_bigS_poseLibDAE::onLoad(%this) 
{
 
%this.setsequenceCyclic("ambient", "false");
 
%this.setsequencecyclic("back", "true");
%this.setsequencecyclic("root", "true");
%this.setsequencecyclic("rUN", "true");
%this.setsequencecyclic("side", "true");
 
}

 

This worked great from the start but , I continued having problems with setGroundSpeed . Finally I tried something that so far has worked . You can see it in the file with the setGroundSpeed commands . for "back" the Y is a negative number , for "run" Y is a positive number , for side the X is used , assuming that they are X,Y,Z , i really dont know :? . Anyway , seems to be working fine .+ for what its worth , Im not a pro so this isnt professional and is subject to improvment . thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...