Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Argh! Very simple but can’t get to work!! Adding values with time remapping and expressions

  • Argh! Very simple but can’t get to work!! Adding values with time remapping and expressions

    Posted by Jim Lefevre on February 2, 2012 at 4:53 pm

    In my comp – COMP1 – I have 19 layers, each of exactly the same sequence of animation which is 57 frames long.

    I am time remapping each layer to have a single hold keyframe on each consecutive frame so

    Layer 01 – frame 01
    Layer 02 – frame 02

    meaning you have all the first 19 images of the animation in 19 consecutive layers in the comp.

    etc…

    I need to duplicate that comp to COMP02 and have a layer with a slider control that means I can change the time remapping values to add 19 to each of the layers so in effect it’s the next 19 frames (the reason being is I’m going to be duplicating this comp loads of times with different offsets)

    This layer is called “FRAME_OFFSET” and the slider is called “AMOUNT_OF_FRAMES”. The slider value is ’19’

    I thought that it was as simple as having my time-remap keyframe value and then adding the slider number but when I use the pickwhip I get

    timeRemap+thisComp.layer(“FRAME_OFFSET”).effect(“AMOUNT_OF_FRAMES”)(“Slider”)

    and it’s giving me ridiculous return numbers that I can’t seem to work out. Basically not working at all!

    Is this because my method of ‘adding’ is wrong – i.e. using the + sign or is it something to do with what time re-mapping considers ‘a frame’

    hmmmmmm

    Any thoughts would be very much appreciated!

    yours

    jim

    http://www.jimlefevre.com

    Jim Lefevre replied 14 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 2, 2012 at 5:23 pm

    Time remap expects seconds, not frames. So you’ll need to do something like this (not tested):

    f = thisComp.layer(“FRAME_OFFSET”).effect(“AMOUNT_OF_FRAMES”)(“Slider”);
    value + framesToTime(f)

    Dan

  • Jim Lefevre

    February 2, 2012 at 6:56 pm

    Ahhh… of course, I seem to remember this thing from a while back about the value of seconds and frames in the decimal returns.

    Oh my goodness… it works a treat!

    I know you hear it a lot but you are an absolute star Dan, thank you so much!!

    I’m going to study the expression and try and properly understand it!

    http://www.jimlefevre.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy