FORUMS: list search recent posts

Time Remap pre-comp through Control Layer?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rob Wienk
Time Remap pre-comp through Control Layer?
on Mar 12, 2015 at 11:00:25 am

Hi everyone,

I've been trying to set up a comp that contains 1. a pre-comp with an animation inside, and 2. a control-layer that has a mask animate from black to white.

The idea is that each pre-comp looks at the pixel value of the control-layer, and when this turns from black to white, the pre-comp will start.
So to clarify, the InPoint of the pre-comp effectively should get moved to the point in time where the control-layer turns from black to white underneath the pre-comp.

The idea behind all this is that I could make duplicates of the pre-comp to create a grid of animation that are all the same but that would be offset in time by the animation of the mask in the control-layer.

I've tried a few different things but I can't get the code to work. The problem seems to be that I'd need a way to store a value (the frame number where the control-layer turns from black to white under that pre-comp), which as far as I know is impossible with AE expressions. So I was wondering if anyone else might have a solution or a different approach.

The code I have so far (I should mention that the animation in the pre-comp runs from frame 0-15):

// This code is put the Time Remap property of the animation pre-comp
var controlLayer = thisComp.layer("Control Layer");
var colorValue = controlLayer.sampleImage([1,1], transform.position)
var controlValue = Math.floor(colorValue[0]);

if( controlValue ) {
timeRemap + 1.0*controlValue/30;
} else {

// LINEAR APPROACH, also doesn't work:
// offset = timeToFrames(time) * controlValue;
// var targetFrame = linear(time*controlValue, time, time+15, 0, 15);

Return to posts index

Dave LaRonde
Re: Time Remap pre-comp through Control Layer?
on Mar 12, 2015 at 4:13:18 pm

That sound kind of Rube-Goldbergish to me.
Wouldn't you be able to accomplish the same thing just by timing out a few keyframes?

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA

Return to posts index

Rob Wienk
Re: Time Remap pre-comp through Control Layer?
on Mar 12, 2015 at 4:51:56 pm
Last Edited By Rob Wienk on Mar 12, 2015 at 4:55:26 pm

Sure you could. However, the idea is that the setup that I'm after, will be a lot more flexible.

I could animate 10 different masks, and have ten animations, with just a few keyframes (on the masks).
If I would want to achieve the same effect without the expression, I'd have to time-offset maybe 45+ pre-comps (my current grid-setup has 45 pre-comps. I could imagine a setup that has up to twice as many). Then it will be much more time consuming to do so.

On a side note:
I seem to have placed this thread in the general AE forum. I suppose it would be better to move it to the part that's specifically for AE Expressions.
I'd appreciate it If someone could do this for me.

Return to posts index

Walter Soyka
Re: Time Remap pre-comp through Control Layer?
on Mar 12, 2015 at 5:50:01 pm

Check out the time displacement effect, which will do this for you without the slow expression evaluation.

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

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved