ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to get the value of specific parameter from specific time in timeline

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michal Poniedzielski
How to get the value of specific parameter from specific time in timeline
on May 6, 2018 at 6:46:45 pm
Last Edited By Michal Poniedzielski on May 6, 2018 at 7:46:12 pm

Hello,

Could you please help me sort it out? I will try to explain as plain as posiible without going into much detail:

SETUP:
  • I have 1450 frames long COMP (24fps).
  • In this COMP, I have a CONTROLLER Null Layer with bunch of Slider Controls controlling animation of bunch of objects.
  • One of those sliders is THICKNESS Slider and it animates Stroke Width of one of the objects (so its value is changing various of times trough the whole COMP.
  • And there is also BRICK Shape Layer in the COMP.

PROBLEM:
I need to write an expression in BRICK's stroke width property, which will return a static value of the CONTROLLER's THICKNESS Slider from the specific frame in time: 1419.

In other words: BRICK's stroke value trough the whole COMP, has to remain the same as the CONTROLLER's THICKNESS value in frame 1419, despite CONTROLLER's THICKNESS animation.

HAVE TRIED:
I was trying to use valueAtTime expression but I don't get it right and I think I can't figure it out without help.


Creative Creature :)


Return to posts index

Michal Poniedzielski
Re: How to get the value of specific parameter from specific time in timeline
on May 6, 2018 at 8:31:34 pm

Hmmm... Apparently I kind of solved it ☺ (but I'm still open for suggestions)

It appears that my expression for BRICK's Stroke Width property "didn't quite work" because I was putting a specific frame number in the brackets of valueAtTime expression, hoping to get the value of THICKNESS from that particular frame in timeline. After learnig that valueAtTime uses seconds instead of frames, I made some easy calculations:

my fps = 24
my target frame in time = 1419
1419 / 24 = 59.125

So: a 1419th frame is 59.125th second of the COMP

Below those two expressions (bad and good) for somebody who will need it maybe someday.

// THE OLD EXPRESSION (bad):
thisComp.layer("CONTROLLER").effect("THICKNESS")("Slider").valueAtTime(1419)

//THE NEW EXPRESSION (good):
thisComp.layer("CONTROLLER").effect("THICKNESS")("Slider").valueAtTime(59.125)


Creative Creature :)


Return to posts index

Dan Ebberts
Re: How to get the value of specific parameter from specific time in timeline
on May 6, 2018 at 10:45:28 pm

You could let framesToTime() do the calculation for you:

t = framesToTime(1419);
thisComp.layer("CONTROLLER").effect("THICKNESS")("Slider").valueAtTime(t)


Dan



Return to posts index

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