I'm trying to get the pixel width and height of a piece of footage. I need to know this so that I can create a comp that fits it properly. The footage may change in size so I'm trying to be pre-emptive and anticipate this with my script.
So far I've checked through the scripting guide in the FootageItem and FootageSource classes. I've noticed that when a piece of footage is in a layer, its possible to "Change Value" it using pixels, inches, percentage, and other unit types. Is it possible to query the layer and determine its dimensions in pixels?
Querying footage/layer dimensions
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Here's a simple example of how to query the width of any footage in the project window:
Code: Select all
{
for (i = 1; i <= app.project.numItems; ++i)
if (app.project.item(i).typeName == "Footage")
{
alert(app.project.item(i).width)
}
}