ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

[AE Script] Duplicationscript with different positions

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eric Müller[AE Script] Duplicationscript with different positions
by on Sep 13, 2015 at 6:10:15 pm

hello everyone
I have some problems with scripting in After Effects.
I decide to begin with scripting for a better workflow.
I tried to make a script which duplicates selected 3Dlayers.The number of duplications should be set by an alert-field. The new duplications should orientate their position on the original object.In the end result there should be a kind of field of objects.

var theComp = app.project.activeItem;
var theLayer = theComp.selectedLayers[0];
var Lposition = theLayer.position[x,y,z]
var Dposition = dLayer.position[x,y,z]
var dLayer = theLayer.duplicate();
var positionx = theLayer.position[x,0,0]
var positionz = theLayer.position[0,0,z]
var dpositionx = dLayer.position[x,0,0]
var dpositionz = dLayer.position[0,0,z]
var transPosition = dLayer.calculateTransformFromPoints(pointTopLeft(x,0,z));
var numLayer = prompt ("Choose Layer:", "value");
for (i=1; i <= numPosition.numItems; i++){

theComp.layer(numLayer+i).startTime = theLayer.duplicate(i);
dLayer.layer(i).duplicate(i) = Lposition.layer(i).marker.calculateTransformFromPoints(pointTopLeft(positionx-100,y,positionz-100));
dLayer.layer(i).duplicate(i) = Dposition.layer(i).marker.calculateTransformFromPoints(pointTopLeft(dpositionx-100,y,dpositionz-100));

I use AE CS6

Return to posts index

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