Activity › Forums › Adobe After Effects Expressions › Trigger an Ease in expression.
-
Trigger an Ease in expression.
Posted by Todd Stopa on August 27, 2013 at 3:45 amSo I am In need of an expression that allows me to trigger an “ease” event when a value reaches >=1
Problem I am having is that the value frequently goes below and back up above 1 before the ease gets to finish
I would like the effect to be triggered when it notices that the value is at or above 1 but if it is not then to finish its ease event before returning to the default value of -180.
here is my code
any help would be greatly appreciated 🙂
-auto
y= (thisComp.layer("SK").effect("Sound Keys")("Output 1"))if( y>=1 )
{ease(time, 0, 1,- 180, 180)}else
{-180}
Todd Stopa replied 12 years, 7 months ago 2 Members · 6 Replies -
6 Replies
-
Dan Ebberts
August 27, 2013 at 7:17 amTriggers are tricky and you probably need to better define the behavior you’re looking for. The basic idea is explained here:
https://motionscript.com/design-guide/audio-trigger.html
However, there are a number of variations on this depending on whether you only want it to trigger the first time the value goes above the threshold, every time, or even more complex–once triggered it runs the entire animation and then is available to be triggered again.
Dan
-
Todd Stopa
August 27, 2013 at 9:04 amThe third one would be the option I am looking for
In your words the “most complicated”
I would need this to happen on the fly as well, when I replace the audio footage.
Is this possible.
Would you know of a way to go about doing it?
Ive been to that site many times but it doesn’t work with soundkeys, and I am a novice scripter, That project is setup for reading direct from an audio file. but never theless any help would be appreciated.
This is like the holy grail for me in after effects.
I am also seeking a similar solution in 3dsmax, but it has its own complications.
I knew it wouldn’t be that easy, but yes I do need to trigger an animation have it run its course and then be available once again for a future trigger.
Do you have any advice on how I would achieve this? sounds like it needs to store variables, and from what I know of ae there is not such possibility, besides using a null to hold a value from a previous frame etc.
Thank you for your time
-Auto
-
Dan Ebberts
August 27, 2013 at 2:53 pmIt is certainly possible. I don’t think I’ve ever done exactly that permutation, but basically you would start at the layer’s in point and go forward frame by frame until you get to the current time. Whenever you encounter a frame where the value goes from below the threshold to above it, you jump ahead by the duration of your ease. The current frame will either be within an eased segment or between them. If it’s inside an ease, you have to calculate how far into the ease you are (current time minus start of ease). A bit of work, but do-able.
Dan
-
Todd Stopa
August 27, 2013 at 6:54 pmDang your advice seems to be found across the land. Ive been high and low searching for this and your name comes up much more often than not.
Thanks 4 your contribution to us learners over the time you’ve spent helping 🙂
I found this post after a very long search.
https://www.videocopilot.net/forum/viewtopic.php?f=5&t=12269
its about ducking audio expressions. but im not sure if following this as a guide to my own expression would be good or not as im not sure if it “waits” for the “audio duck/animation” to complete but it does mention soundkeys directly as a possible input to one of the variables in the script.
I wonder if you have any knowledge of this method and whether applying it to my work would help.
I find this scripting language extremely complex for my newcomer status to the xpressions and maxscript “league” of work.
I do wonder though why after effects doesn’t seriously consider just adding a value store for variables (outside of frame time/permanent residency) in the next release.
It would make TONS more possible without a person having to learn lots of syntax before being able to tell the comp what you want to do.Anyhow I really appreciate your help with this, In your last post you mentioned counting back to check how much time has passed since the last “threshold”
do you know the expression and syntax needed to “count back”
I think in the link Ive included counting back is likewhile Time=-< or something am it right?
this whole cant access data from any other frame thing is really throwing me off as im used to visual basic where variables are declared and accessed over time as a main function of the language. but after effects seems to have trouble with this or something.
-
Dan Ebberts
August 27, 2013 at 7:14 pmI don’t think that helps you because it appears to just be looking for the most recent and the next threshold crossings. The way you’ve described it, you’re going to need to find them from time=0 forward. Unless…if you can be sure the threshold crossings are far enough apart so that one won’t occur during the ease triggered by the previous one, you can use the simpler method that I posted the link for. It wouldn’t take much to modify it to use Sound Keys and trigger your ease animation.
Dan.
-
Todd Stopa
September 11, 2013 at 12:55 amWell thank you 😀
I am still too inexperienced and after many tries am unable to get your tutorial on beat detection to work.
Ill keep learning and maybe ill someday get it workin.
Thank you for your time and contributions you’re a rockstar!
Reply to this Discussion! Login or Sign Up