ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Set values for images layer (Script)

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sergey MakarinSet values for images layer (Script)
by on Feb 26, 2015 at 6:25:38 pm

I need to set the following paraments for an image layer:

anchorPoint
Position
Scale


new_image = app.project.importFile(new ImportOptions(File("C:/image.jpg")));
for (i=1; i<=app.project.numItems; i++){
item = app.project.item(i);
if (item.name == 'some-item-name'){
for (j=1; j<=item.numLayers; j++){
layer = item.layer(j);
if (layer.name == 'background-image'){
layer.replaceSource(new_image, true);
layer.transform.position = '0,0';
layer.transform.AnchorPoint = '0,0';
}
}
}
}


2 lines don't work in the code:

layer.transform.position = '0,0';
layer.transform.AnchorPoint = '0,0';


I know that the code is not correct, please write me correct code for the two lines.


Return to posts index

Walter SoykaRe: Set values for images layer (Script)
by on Feb 26, 2015 at 6:57:48 pm

Have you read or referred to the Ae CS6 scripting guide [link]?

See the setValue() method on page 144, and pass an array (like [0,0] instead of a string like '0,0').

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 >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]