Trimming Footage in Layer

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
RichardPatterson
Posts: 6
Joined: January 31st, 2010, 4:16 pm

I am having trouble creating layers from a long movie where I want to extract only a portion of the movie. When I set the in point and out point for the layer to the places I want it also seems to set the start time for that layer in the composition and setting the start time either seems to have no effect or only sets it relative to the in point for the footage. What is the scripting equivalent of setting the in and out points in the layer window and then setting the start point for that clip in the comp window?

I am using After Effects CS3 on a Power PC and ExtendScript Toolkit 2.02.

Also as an aside I can make the preference setting for the font in ExtendScript work. Changing the font seems to have not effect on the font used in the script and changing the size only seems to affect the line spacing.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Setting the in and outPoints is like when you drag/trim the layers in the composition, while setting the startTime is like dragging the layer along the timeline. So you need to make the startTime a negative version of the inPoint to place your trimmed inPoint on the first frame of the comp.

And it depends on the order in which you do them. For example, both of these will do the same thing, trimming the inPoint to 1 sec, the outPoint to 2 secs and moving the layer so it starts on the first frame:

Code: Select all

// assumes a comp containing a layer is selected
var activeItem = app.project.activeItem;
activeItem.layer(1).inPoint = 1;
activeItem.layer(1).outPoint = 2;
activeItem.layer(1).startTime = -activeItem.layer(1).inPoint

Code: Select all

var activeItem = app.project.activeItem;
activeItem.layer(1).startTime = -1;
activeItem.layer(1).inPoint = 0;
activeItem.layer(1).outPoint = 1;
RichardPatterson
Posts: 6
Joined: January 31st, 2010, 4:16 pm

Thank you so much for clearing this up. I was chasing my tail and and caught in one of those typical "Is it me or the app?" nightmares.

It would be nice if the documentation made this clear. If it does, I'd appreciate a referral to the section. I do think there is something a little counter-intuitive about this, especially if one is also trying to set a keyframe at the beginning of the layer.
Alan Eddie
Posts: 30
Joined: January 12th, 2012, 1:36 am
Location: Ireland
Contact:

Hi there, I am having trouble understanding this problem.

I have an AVLayer - startTime = -20, inPoint =20, outPoint =100;
The duration of the source item is say 500;

So I run this...

Code: Select all

app.project.activeItem.selectedLayers[0].inPoint=50;
First run - does it as expected.
second run - starts moving the outPoint! but doesn't adjust the startTime.
third run - moves the outPoint again!
I understand the startTime affects the other 2 but why vice vearsa?
What am I not getting in the relationship between inPoint/outPoint/startTime?

Thanks a mil.
Alan Eddie
_______________________
www.alaneddie.com
3d Animation and VFX
RTE
Dublin
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

This looks like a bug to me. I've tested it all the way back to CS3 and it's the same.

When changing the inPoint, it attempts to retain the layer duration by also moving the outPoint if it can. But the new duration is off by the amount of any startTime offset (if startTime isn't zero). Subsequent attempts to set the inPoint to what it already is will again cause the outPoint to be offset by the amount of any non-zero startTime amount.

I'd recommend you report it here:
https://www.adobe.com/cfusion/mmform/in ... e=wishform

As a workaround you'll have to also set the outPoint each time you set the inPoint.
Alan Eddie
Posts: 30
Joined: January 12th, 2012, 1:36 am
Location: Ireland
Contact:

Great - couldn't figure out what the story was. I have it packaged in a function and works fine, just thought there was something that I wasn't aware of.....

Will log it with Adobe in the morning, thanks Paul.
Alan Eddie
_______________________
www.alaneddie.com
3d Animation and VFX
RTE
Dublin
Post Reply