Game Development Community

T3D 1.1 Final Issue - Needs method to sync animation to sound (LOGGED - THREED-3166)

by Donald Teal · in Torque 3D Professional · 08/16/2011 (9:51 am) · 13 replies

As per EricP's suggestion of putting this on the forum. T3D needs a method of syncing animations to sounds.

For example right now you can set triggers in the shape editor for left and right foot step sounds. but not for other triggers. There needs to be a method of supporting more animation triggers,

For example, a dragon flapping its wings, there needs to be a method to set a trigger on the wing flap frame so that a sound can be played.

#1
08/16/2011 (11:54 am)
Your shape instance can handle 32 trigger sets.
Just use setTriggerState() and getTriggerState() to control the sound.
#2
08/16/2011 (12:43 pm)
Ivan, try that with T3D 1.1 Final and DAE shapes and then let me know how it works out. So far it does not seem to work with DAE.
#3
08/17/2011 (8:44 am)
@Ivan: If you can demonstrate how to script that function[getTriggerState],{how do you check a DTS shape's DSQ sequence at runtime??}, to play a sound with an animation trigger...WHOO HOO!
#4
08/17/2011 (9:07 am)
At the moment, animation triggers can only be accessed from the engine which is pretty limiting. What's needed is to expose the animation trigger states to script, then you can do whatever you want with them.

I don't think that would be too difficult, you'd have to create get and set trigger state methods for shapebase, and also would be useful to have an onAnimationTrigger callback also.
#5
08/18/2011 (1:05 am)
Rex,updateActionThread() is a good example of how to do that.
And of course these are not console methods,this functionality is not exposed to console.
#6
08/18/2011 (6:09 am)
Quote:would be useful to have an onAnimationTrigger callback also.
I think this is the key - shouldn't be too difficult to pull off in updateActionThread, although that's just for Players of course.

Although, it'd be nice to be able to add data to triggers in actual modelling software - for example, creating a trigger on a frame with a particular function call embedded in it, instead of having to check the animation name and trigger number in an onAnimationTrigger sort of callback and then call the appropriate function.

Would be a relatively significant change to the art pipeline though, I assume.
#7
08/18/2011 (6:27 am)
Thanks, Ivan...why I say WHOO HOO if you can 'script' this functionality, ;). As an artist, I like to see things that I can do, 'out of box' or SDK stock functionality exampled; since I have no compiling experience!

The new Shape Editor brings a bit of 'script-ability' to we artists, to get this stuf exposed to scripting[and more artists] is what's needed...let that be the takeaway for Eric P., eh?

Go, Team Torque!
#8
01/11/2012 (1:11 pm)
Improvement logged as THREED-3166.
#9
01/13/2012 (4:01 am)
@All:

If I find the time this weekend I will post a resource which throws onAnimtionTrigger to script. But due to a busy schedule, don't hang me if it will be a little bit later.
#10
01/14/2012 (12:35 pm)
As promised here is the resource:

http://www.garagegames.com/community/resources/view/21460
#11
01/14/2012 (1:28 pm)
@Richard is now on my awesome list!

@Rex, I would recommend learning enough to add features to the compiled code. Otherwise you are severely limiting yourself. On the flip side I had to learn to build 3D models and import them to properly test my code out. So it runs both ways.

There is another benefit for an artist to know how to do some basic things with C++ and Torque Script. You can tell if a coder you hire is performing or not.
#12
01/17/2012 (9:19 am)
Thank you Richard, I will put this to good use
#13
01/20/2012 (3:53 am)
No thanks guys, glad I could help.