Skip to main content
Participant
October 30, 2012
Question

How can I return a list of just layer transform properties?

  • October 30, 2012
  • 1 reply
  • 734 views

Is there a process or built in function to get all of the gui settable properties for a layer object.

Here is an example

I have 2d solid layer and I want to get a list of just the transform properties that can be accessed in the AE gui.

anchorpoint

position

rotation

scale

etc...

If I just try to iterate over the object like the below I get a ton of properties that I don't need and not the ones I want.

for (p in layer){

     $.writeln(p);

     // or

     $.writeln(p.transform);

}

This topic has been closed for replies.

1 reply

Inspiring
October 30, 2012

Unfortunately there is no direct way of getting the visible properties, but you can do something like this:

var activeItem = app.project.activeItem;

var layer = activeItem.layer(1);

var visible;

trans = layer.property("ADBE Transform Group");

for (var x = 1; x <=trans.numProperties; x++) {

    visible = true;

    try {

        // try selecting the property

        trans.property(x).selected = true;

    } catch (e) {

        // it will cause an error if not visible

        visible = false;

    }

    if (visible) {

        trans.property(x).selected = false;

        $.writeln(trans.property(x).name);

    }

}