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:
Marco Arnulfo
2026-10-12 22:02:59 +02:00
parent 470ea7a3af
commit a179714108
3 changed files with 91 additions and 1 deletions
+8
View File
@@ -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);