• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set the In-Point from one Layer to the Out-Point from another Layer

New Here ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

Dear community,

 

I came up with an idea to push a layer on the timeline in after effects to the location where another layers out-point is.

 

outpoint.jpg

This would allow me to dynamically push layers on different timecodes just with the information of the layers that need to be updated every single time the template is used. This week the clip is 10 seconds long, the next time it is just 5 seconds long.

But the graphic, which shows after that clip, is every time at the end of this clip.

 

Is there an expression to get this done?

 

I know a plugin called templater, which can deliver such a solution, but it's quite pricy for what I have in mind.

https://www.youtube.com/watch?v=BXTbUoH7mJs

Perhaps it would be possible with time remap? You have the keyframes where the graphic is and just push those keyframes to the outpoint from the layer that gets changed. 

 

Thanks for some feedback.

 

Best

Matze

 

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

If you have in and out points set for a bunch of layers you can use the Keyframe Assistant to Sequence those layers. They will be arranged in the order they were selected and you can also set a uniform overlap and transition if you like. I use sequence layers all the time. 

 

To see if this will work for you, type "sequence layers" in the Search Help field in the top right corner of AE to check out the user guide or just select a bunch of layers and use the Animmation>Keyframe Assistant>Sequence layers menu and give it a try. The sequence will start at the in-point of the first layer that was selected and the layers will be arranged in the order they were selected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

Hi Rick,

 

thanks for the reply.

My main focus for that topic is to not manually open After Effects to render that scene every week.

We want to control everything from the command line 😉 so we need a solution for that, which works without human interaction.

 

The *.aep just need to open up, read the new footage and snap the other layers to the outpoints.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Oct 25, 2019 Oct 25, 2019

Copy link to clipboard

Copied

For an actual "push" you'll need a script, since expressions cannot manipulate a layers time position.

The expression way is to do this via time-remap (apply time-remap and delete all keyframes, and make the layer as long as the composition, or at least long enough to cover all thinkable starting positions)

l_inComp = thisComp.numLayers;

if (l_inComp > 1){
	prev_outPoint = layer(index-1).outPoint;
	if (time >= prev_outPoint){
		prev_outPoint - time;
	} else {
		-1;
	};
} else {
	0;
};

 

First you check if there are more then one layer in the comp. Not quiet necessary, but makes the expression bullet proof.

Next, for the actual code, you get the out-point of the layer above. And finally, you subtract the current time from it.

 

If outpoint is at 2:15f, time remap will be set at TC -0:01f until current time is at 2:15f. At this frame, time remap is zero and will count up frame by frame from here (time = 2:16f, time remap 00:01f, time = 2:17f, time remap 00:02f and so on).

 

Negative values for time-remap are not an issue as far as I know, especially when dealing with footage. There is no visible footage at negative time codes. However, if you are dealing with pre-comps, if can be that a layer is moved further left into negative time space. This content will be visible.

 

Therefore, with the same technique, but on opacity, you set a switch to "hide" the layer when it shouldn't be visible:

 

l_inComp = thisComp.numLayers;

if (l_inComp > 1){
	prev_outPoint = layer(index-1).outPoint;
	if (time >= prev_outPoint){
		100;
	} else {
		0;
	};
} else {
	100;
};

 

If there is an following layer, you might to cover this situation. I did not, because you didn't mentioned any.

The code is not tested, because I'm already in my weekend, but it should be close to a working solution, if not already.

 

*Martin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2019 Nov 02, 2019

Copy link to clipboard

Copied

LATEST

Thanks for your solutions, but unfortunately that wasn't the right one for me.

 

I tried to go with scripting and for my issue, that worked out pretty well.

I'm not a scripter or whatever...but it works..so don't blame me 😉

 

var myComp;
var myFootage;
var myLogoBug;
var myL3rd;
var myOpener;
var myCloser;

// set undo steps to 1 

app.beginUndoGroup("undo")

// find comp with a specific name and rearrange dynamic footage

for (var i = 1; i <= app.project.numItems; i ++) {
    if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name === "Main")) {
            
    myComp = app.project.item(i);
    myFootage = myComp.layer(5);
    myLogoBug = myComp.layer(4);
    myL3rd = myComp.layer(2);
    myOpener = myComp.layer(3);
    myCloser = myComp.layer(1);
    myFootage.outPoint = 9999;                   //set out point to max length
    myFootage.startTime = 0;                     // set in point to frame 1 of comp
    myOpener.startTime = myFootage.startTime;    //opener starts with footage
    myL3rd.startTime = myOpener.outPoint+7;      // set in point to out point +7 seconds
    myLogoBug.startTime = myOpener.outPoint;     // set in point to out point from opener
    myLogoBug.outPoint = myFootage.outPoint;     // set in point to out point from footage
    myCloser.startTime = myFootage.outPoint-1;   // set in point to in point +x seconds
    myComp.duration = myCloser.outPoint;         // set work area out to out point from closer
    myComp.workAreaStart = myFootage.startTime;  // set work area in to in point from footage
        break;
    }
}

            

app.endUndoGroup

 

Perhaps someone could transfer it into better code language, or someone just needs a similar solution.

Go with it.

 

Matze

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines