calculateTransformFromPoints()

app.project.item(index).layer(index).calculateTransformFromPoints(pointTopLeft,pointTopRight,point-
BottomRight)

Description

Calculates a transformation from a set of points in this layer.

Parameters

pointTopLeft The top left point coordinates in the form of an array, [x, y, z].
pointTopRight The top right point coordinates in the form of an array, [x, y, z].
pointBottomRight The bottom right point coordinates in the form of an array, [x, y, z].

Returns

AnObject with the transformation properties set.

Example

var newLayer = comp.layers.add(newFootage);
newLayer.threeDLayer = true;

newLayer.blendingMode = BlendingMode.ALPHA_ADD;
var transform = newLayer.calculateTransformFromPoints(tl, tr, bl);
for(var sel in transform) {

newLayer.transform[sel].setValue(transform[sel]);

}

Other Tags

Posted in AVLayer object and tagged , , , , , , , , , , , , .