Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions constant change on “y” value of Offset effect

  • constant change on “y” value of Offset effect

    Posted by Kevin Reiner on March 15, 2011 at 5:10 pm

    Searched the COW, but having problem finding answer to what I’m sure is an easy question. I’m a newbie to expressions, but I though this was one I could tackle. I thought wrong. 😉

    I have comp that I want to slowly loop in a vertical direction using the offset effect. I want to be able to quickly change the speed if asked by client.

    I keep getting the error “array piece can’t expand to more than one value.”

    Any help is appreciated.

    Thanks,
    Kevin

    temp = effect("Offset")("Shift Center To")[1]*valueAtTime(2);
    [position[0], temp]

    Mac Pro 2 x 3 GHz 6-Core Intel Xeon
    32GB Memory
    Dual-channel 4Gb Fibre Channel PCI Express card
    Dell Display (23″ flat panel)
    ATI Radeon HD 5770
    AJA Kona LSi SD/HD capture card
    Rourke 16 TB
    Flanders 2460

    SOFTWARE
    Mac OS X 10.6.5
    FCP 7
    After Effects CS5
    Boris Continuum
    Sapphire Plug Ins
    All Trapcode Plugs
    Zaxwerks Invig

    Graham Bull replied 10 years, 9 months ago 4 Members · 12 Replies
  • 12 Replies
  • Dan Ebberts

    March 15, 2011 at 5:33 pm

    It’s not clear (to me at least) what you’re trying to do. How are you planning on controlling the speed?

    Dan

  • Kevin Reiner

    March 15, 2011 at 6:00 pm

    Hello Dan,

    Sorry for confusion and thanks for your expertise.

    I have a master comp with multiple subcomps. Within each subcomp, I need to have the footage move in a constant rolling loop. So I am using the “offset” effect on an adjustment layer within each subcomp. I’d like the “y” coordinate to increase constantly over time based on a rate determined by an inserted value. I want the flexibility to change all of the subcomps’ looping speed from a slider control in the master comp.

    I’m not sure if that makes it less confusing.
    Thanks for any help,
    -Kevin

    Mac Pro 2 x 3 GHz 6-Core Intel Xeon
    32GB Memory
    Dual-channel 4Gb Fibre Channel PCI Express card
    Dell Display (23″ flat panel)
    ATI Radeon HD 5770
    AJA Kona LSi SD/HD capture card
    Rourke 16 TB
    Flanders 2460

    SOFTWARE
    Mac OS X 10.6.5
    FCP 7
    After Effects CS5
    Boris Continuum
    Sapphire Plug Ins
    All Trapcode Plugs
    Zaxwerks Invig

  • Dan Ebberts

    March 15, 2011 at 6:23 pm

    I think it would just be like this:

    rate = 100;
    value + [0,rate*time]

    You could link “rate” to a slider in the main comp.

    Dan

  • Kevin Reiner

    March 15, 2011 at 6:32 pm

    Works like a charm Dan. I was going down the wrong path. Can’t thank you enough for everything you do here on the Cow and on your site.
    -Kevin

    Mac Pro 2 x 3 GHz 6-Core Intel Xeon
    32GB Memory
    Dual-channel 4Gb Fibre Channel PCI Express card
    Dell Display (23″ flat panel)
    ATI Radeon HD 5770
    AJA Kona LSi SD/HD capture card
    Rourke 16 TB
    Flanders 2460

    SOFTWARE
    Mac OS X 10.6.5
    FCP 7
    After Effects CS5
    Boris Continuum
    Sapphire Plug Ins
    All Trapcode Plugs
    Zaxwerks Invig

  • Rachel Kodner

    March 22, 2015 at 1:41 am

    I’m trying to accomplish something and i’ve been scouring the internet now for over 2 hours and I’ve been trying stuff from this forum and another forum for over 2 hours and I’m completely new to expressions. so I wanted to find out if A) what I’m trying to accomplish is even possible and I believe it is, and B) how to do it (or find out what I’m doing wrong…)

    I have a sequence. I have a precomp in this sequence. the precomp has a flat outlined logo. the precomp is 3d (not that that matters). I’ve duplicated the precomp 40 times within this sequence. and I’ve offset each precomp by 1 frame (i.e. PreComp on Layer 1 comes in at 0:00:00:00, Precomp on Layer 2 comes in at 0:00:00:01, Precomp on Layer 3 comes in at 0:00:00:02, and so on for 40 layers). NOW HERE IS WHAT I’M TRYING TO DO with all 40 of these layers:

    layer 1’s position: 960, 540, 0
    layer 2’s position 960, 540, -1
    layer 3’s position: 960, 540, -2

    etc… for all 40 layers…. change the z position by -1.

    I’m basically trying to offset each layer’s z position by -1. (Which is super easy to do the manual way, yet somewhat time consuming if you have a ton of layers). So I thought I could write an expression to expedite this? (That’s what I’m trying to do: write an expression that would be applied to one layer in order to offset the Z position of all 40 layers by 1 increment without having to manually type it into every single layer, to make it look like this logo is growing/extruding when you view it from the side). This is possible right?

    The 6 second point of this video is what I’m basically doing. having the walls ‘grow’. and I have the project file and the person who authored this is manually decreasing the Z position by 1. They arent using an expression. but I wanted to get clever and write an expression to speed up that process of manually typing it in per layer if/when I create this from scratch.

    https://videohive.net/item/architect-logo-reveal-3-versions/9919777

    Again, I’m completely new to expressions. Do I add the expression to layer 1 and parent all subsequent layers to layer 1? Or do I add this expression to a null on top and parent all layers to the top null?

    I tried reading this forum and tried to understand the code and tried to apply to mine but I’m not sure that it’s working:

    https://forums.creativecow.net/thread/227/25272

    I went to layer 1, and typed in the following expression VERBATIM for position. Is this correct? I’m looking at my comp and it kind of looks like it worked but I wanted to know if someone could break down this expression for me and tell me if I’ve wrote this out correctly, if I’m supposed to substitute numbers in place of the word “value”?:

    offset = -1;
    p = thisComp.layer(“Layer1”);
    t = time + offset * index;
    z = p.position.valueAtTime(t)[2];
    [value[0],value[1],z]

    Any help would be appreciated! Thanks!

    offset = -1;
    p = thisComp.layer("Layer1");
    t = time + offset * index;
    z = p.position.valueAtTime(t)[2];
    [value[0],value[1],z]

  • Dan Ebberts

    March 22, 2015 at 2:47 am

    An expression can only affect the property (and the layer) hosting the expression, so you’ll have to apply the expression to each layer (but that’s not difficult to do). I think this position expression does what you want:

    [960,540,1-index]

    After you apply the expression to layer 1’s position property:

    1. Select layer 1’s position property
    2. Edit > Copy Expression Only
    3. Select all the other layers
    4. Edit > Paste

    Dan

  • Rachel Kodner

    March 24, 2015 at 2:38 am

    Wow thank you so much Dan. Just tried it with my coworker. Works like a charm. I enter that expression into the ‘position’ of a solid for instance. Then I duplicated that solid a bunch, and if you look at the position for each one (without changing the expression on each one), like a charm… 0, -1, -2, -3

  • Graham Bull

    July 10, 2015 at 4:45 am

    Hi Dan,

    thanks very much for the expression you posted:

    rate = 100;
    value + [0,rate*time]

    I’m trying to do a similar thing, but in the x-axis. When I pasted the above expression it only affects the y-axis, why is this?

    What would be the way of having it affect only the x-axis?

    Yours curiously,

    Matt

  • Graham Bull

    July 10, 2015 at 4:52 am

    Hi Dan,

    Ahhhhhh, I see.
    Just realised that it’s the 0 !!

    so to affect the x-axis the expression would be

    rate = 100;
    value + [rate*time, 1]

    instead of

    rate = 100;
    value + [0,rate*time]

  • Graham Bull

    July 10, 2015 at 5:25 am

    Hi Dan,

    Another question re the offset effect expression

    rate = 100;
    value + [0,rate*time]

    The thing is, if you link rate off offset to a slider, then keyframe the slider from say 20 down to 0, the layer changes direction, as the property goes back towards its original value, ie

    value + 0.

    What would be the way to decelerate to a standstill without “going into reverse” ?

    Thanks in advance,

    All the best

    Matt

Page 1 of 2

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