Skip to main content
Inspiring
April 16, 2015
Question

After Effects Camera Properties

  • April 16, 2015
  • 1 reply
  • 2007 views

I have been banging my head against a wall trying to set focal length and fov programmatically on an AE camera.

I have picked up a clue from an existing script that an AE camera has a "Zoom" property. I can't find any properties except "time" on my AE cameras. I checked using a "for propname in obj" technique and I looked in the Data Browser.

Is there a special command/ technique to allow me to see all the properties like "Zoom" on an AE camera? If not, how can I learn more about scripting an AE camera?

Thanks All,

Miles

This topic has been closed for replies.

1 reply

Participant
July 24, 2015

Hi Miles,

You can use something like this:

app.project.activeItem.activeCamera.zoom.setValue(450);

Zoom value is connected with Angle Of View and Focal Length.

You could also replace zoom with depthOfField, focusDistance, aperture or blurLevel to get some other functionality.

I don't know a technique to see all the properties like "Zoom" but sometimes it is helpful to use the script below to see some other available properties. Open ExtendScript Toolkit - Choose target app After Effects - Replace "app.project.activeItem" with something else to explore - Run

//get all properties of an object using reflection

function getProperties(obj) {

    var properties = [];

    for(var key in obj) {

        if(obj.hasOwnProperty(key) && typeof obj[key] !== 'function') {

            properties.push(key);

        }

    }

return properties;

}

propertyItems = getProperties(app.project.activeItem); //Here you can replace "app.project.activeItem" with something else that you want to explore.

propertyList = propertyItems.toString().split(",").join("\n")

alert(propertyList);

Regards,

Andres