FORUMS: list search recent posts

DeltaTime

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marc Keeling
DeltaTime
on Nov 12, 2019 at 5:31:45 pm

Hey all, I have a small problem I need help with.

In Trapcode Particular there is an offset on X I am animating over time in the turbulence section.
I wish to animate a slider from 1 to -1, to flip the direction the offset is incremented in. Ie I flip the slider to -1, and the X value start counting backwards at the same speed.
I thought it was as simple as multiplying time by the slider, but that doesn't work as it gives me the negative time value, rather than counting backwards. Is there anyway to do this?

Thanks in advanced

Marc


Return to posts index

Walter Soyka
Re: DeltaTime
on Nov 13, 2019 at 2:38:09 pm

I'm not entirely sure I understand. You want the slider to be the amount of increase per frame, relative to the last frame?

So if I start the slider at 1, my values go 0, 1, 2, 3, 4, 5

And then I change slider to -1, the values continue 4, 3, 2, 1, 0, -1?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Marc Keeling
Re: DeltaTime
on Nov 13, 2019 at 3:08:54 pm

Yeah. Currently when I change slider to -1, it quickly animates from 5 to -6, as it's tied to the time of the comp.


Return to posts index


Walter Soyka
Re: DeltaTime
on Nov 13, 2019 at 6:07:07 pm

After Effects expressions are evaluated instantaneously for each frame, and they don't have any concept of what happened on the frame before. In order to access previous values, you have to manually recompute and accumulate them.

Code like this will do it:
delta = effect("Delta")("Slider");

var accumulator = value;
for (var i = 0; i < timeToFrames(time); i++) {
accumulator += delta.valueAtTime(framesToTime(i));
}

accumulator


Use this expression on the value you want to accumulate over time and link "delta" to the slider you are manipulating.

Note that the evaluation of this expression slows over time, because each frame must compute and accumulate the values of all preceding frames.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Marc Keeling
Re: DeltaTime
on Nov 14, 2019 at 12:06:48 am

Thanks so much! I will give it a try.


Return to posts index

Marc Keeling
Re: DeltaTime
on Nov 14, 2019 at 5:09:12 pm

Just wondering... is there another way to continuously animate forward without using time? Time can be a pain when linking comps together


Return to posts index


Walter Soyka
Re: DeltaTime
on Nov 14, 2019 at 5:18:54 pm

If you want to use an accumulation technique, you need to consider time.

The expression I shared could be a lot smarter about time, though -- starting at the layer's inPoint instead of assuming that time begins at 0, building in a time offset control if you need to link it to a different clock in another comp, etc.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Marc Keeling
Re: DeltaTime
on Nov 14, 2019 at 5:28:43 pm

Is there a sneaky way of using the loopOut(type = "continue") to drive the progression of values, then somehow link the 1 -1 slider to reverse change direction? If not I'll just put up with it xD


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]