Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE scripting – identify a two-node camera

  • AE scripting – identify a two-node camera

    Posted by Bryan Woods on October 8, 2017 at 7:06 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');
    }
    }
    }

    Dan Ebberts replied 8 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 9, 2017 at 12:16 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

  • Bryan Woods

    October 9, 2017 at 1:56 am

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

  • Dan Ebberts

    October 9, 2017 at 4:00 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy