FORUMS: list search recent posts

ExtendScript Toolkit - After Effects

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Krishna Moorthy
ExtendScript Toolkit - After Effects
on Nov 3, 2016 at 5:22:18 pm

Newbie seeking for help!!!

Am developing a script for my own usage in which I have to enable track matte for a layer through ExtendScript. I had searched the after effects scripting guide and I couldn't find how to enable track matte for a layer. The options in the guide are trackMatteType, isTrackMatte, hasTrackMatte. These attributes can change the tack matte type, check whether track matte is on or not, did the layer has track matte or not respectively. Kindly, help me how can I enable track matte of a layer via extendscript.


Thanks in advance!


Return to posts index

Walter Soyka
Re: ExtendScript Toolkit - After Effects
on Nov 3, 2016 at 11:04:54 pm

Use trackMatteType like this to set layer 2 in the active comp to use layer 1 as a luma track matte:

app.project.activeItem.layers[2].trackMatteType = TrackMatteType.LUMA;

These are the possible track matte types:
TrackMatteType.ALPHA
TrackMatteType.ALPHA_INVERTED
TrackMatteType.LUMA
TrackMatteType.LUMA_INVERTED
TrackMatteType.NO_TRACK_MATTE


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

Krishna Moorthy
Re: ExtendScript Toolkit - After Effects
on Nov 4, 2016 at 5:19:08 am

Thank you for your quick response Walter.
That's what I am looking for.
Found that you are replying in most of the posts here. Great work! keep it up!!
Once again, Thank you!


Return to posts index


Krishna Moorthy
Re: ExtendScript Toolkit - After Effects
on Nov 4, 2016 at 12:03:10 pm

Having a another doubt in the same project that I am working on!

Now, its for a shape layer which will be the track matte for the layer below it.

I have created a shape layer and added a rectangle using the code below.

var shapeLayer = pipComp.layers.addShape();
var contents = shapeLayer.property("ADBE Root Vectors Group");
shapeRect = contents.addProperty("ADBE Vector Shape - Rect");


Now, to make this as a track matte for the layer below it, the shape layer should have a fill property. So, when I added a Fill property to the shape layer by using this shapeFill = contents.addProperty("ADBE Vector Graphic - Fill"); line of code below the above lines of code, the ESTK throws an error at this particular line stating, "Object is invalid".

But if I place the shapeFill line above the shapeRect line, it works fine as it creates a shape layer with Fill and Rectangle property one after another. But we need the Rectangle property in the top so that the Fill property will be visible.

I hope I explained my situation clearly. kindly, help me to crack this out.

Thanks in advance.


Return to posts index

Walter Soyka
Re: ExtendScript Toolkit - After Effects
on Nov 4, 2016 at 12:59:54 pm

Your code:

var shapeLayer = pipComp.layers.addShape();
var contents = shapeLayer.property("ADBE Root Vectors Group");
shapeRect = contents.addProperty("ADBE Vector Shape - Rect");
shapeFill = contents.addProperty("ADBE Vector Graphic - Fill");


Works fine here.

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

Krishna Moorthy
Re: ExtendScript Toolkit - After Effects
on Nov 4, 2016 at 1:55:36 pm

Oops! Sorry for the inconvenience, I think, I had addressed the problem wrongly. Here is actual problem (really).

1 var shapeLayer = pipComp.layers.addShape();
2 var contents = shapeLayer.property("ADBE Root Vectors Group");
3 var shapeRect = contents.addProperty("ADBE Vector Shape - Rect");
4 var shapeFill = contents.addProperty("ADBE Vector Graphic - Fill");
5 var rectSize = shapeRect.property("ADBE Vector Rect Size");
6 var rectPosition = shapeRect.property("ADBE Vector Rect Position");
7 var rectRoundness = shapeRect.property("ADBE Vector Rect Roundness");
8 rectSize.setValue ([600, 400]);
9 rectPosition.setValue([0.0, -90]);
10 rectRoundness.setValue(10);
11 pipComp.layers[2].trackMatteType = TrackMatteType.ALPHA


ESTK throws error at the 5th line of above code snippet. And the error is "Objects is invalid".
The purpose of line 5 to 10 is to change the values of the shape layer.

Thanks in advance!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]