ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

AE scripting - identify a two-node camera

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bryan Woods
AE scripting - identify a two-node camera
on Oct 8, 2017 at 7:06:43 pm

Having some issues here with my loop to identify a two-node camera in my comp. I think the main issue is I don't know how to find a two-node camera. Just A camera. Currently this will correctly identify a camera, but will continue to announce that its a two-node camera, even if its actually a one-node. Any suggestions would be appreciated.


var proj = app.project;
var theComp = proj.activeItem;
var layers = theComp.layers;
var matchingLayers = new Array();
var layer;

for (var i = 1; i <= layers.length; i++){
layer = layers[i];

// Check for the particular layer type here:
if (layer.property("Zoom") !== null){
alert('Camera Found');
matchingLayers[matchingLayers.length] = layer;
if(layer.property("Point of Interest") !== null){
alert('Two-node camera');
}
}
}


Return to posts index

Dan Ebberts
Re: AE scripting - identify a two-node camera
on Oct 9, 2017 at 12:16:22 am

Player around with this:


var myComp = app.project.activeItem;
for (var i = 1; i <= myComp.numLayers; i++){
if (myComp.layer(i) instanceof CameraLayer){
if (myComp.layer(i).property("Point of Interest").canSetExpression){
alert(myComp.layer(i).name + " is a two-node camera");
}else{
alert(myComp.layer(i).name + " is a one-node camera");
}
}
}


Dan



Return to posts index

Bryan Woods
Re: AE scripting - identify a two-node camera
on Oct 9, 2017 at 1:56:12 am

Thanks Dan. What is the benefit of checking .canSetExpression if we can already identify Point of Interest? Is it necessary?


Return to posts index


Dan Ebberts
Re: AE scripting - identify a two-node camera
on Oct 9, 2017 at 4:00:56 am

I believe that Point of Interest property is there for both camera types, but can't set an expression for a one-node camera because the property is hidden.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]