Scripting: Google Earth Studio camera scripts key the camera (fixes #1077)
CameraLayer gets the transform and camera-options shortcuts (position, xRotation, zoom...) that AVLayer already had, and Convert Expression to Keyframes run without a property converts the selected ones, as app.executeCommand does it.
This commit is contained in:
@@ -1304,6 +1304,14 @@ Object.defineProperty(ShapeLayer.prototype, "source", { get: function () { retur
|
||||
function CameraLayer(comp, id) { return this.__init(comp, id, "CameraLayer"); }
|
||||
CameraLayer.prototype = Object.create(Layer.prototype);
|
||||
CameraLayer.prototype.constructor = CameraLayer;
|
||||
// Camera scripts (Google Earth Studio exports among them) key `cameraLayer.position`,
|
||||
// `.xRotation` and `.zoom` directly, as on AVLayer: return the live Property objects.
|
||||
["pointOfInterest", "position", "orientation", "xRotation", "yRotation", "zRotation"].forEach(function (name) {
|
||||
Object.defineProperty(CameraLayer.prototype, name, { get: function () { return this.transform[name]; } });
|
||||
});
|
||||
["zoom", "depthOfField", "focusDistance", "aperture", "blurLevel"].forEach(function (name) {
|
||||
Object.defineProperty(CameraLayer.prototype, name, { get: function () { return this.cameraOptions[name]; } });
|
||||
});
|
||||
|
||||
function LightLayer(comp, id) { return this.__init(comp, id, "LightLayer"); }
|
||||
LightLayer.prototype = Object.create(Layer.prototype);
|
||||
|
||||
Reference in New Issue
Block a user