Get layer from selected property?
Moderator: Paul Tuersley
How can I determine what layer a property is applied to? I have tried the .parentProperty attribute but I can't seem to get it to work. Anyone have any pointers on this? Thanks.
OK, I found the answer. I wasn't going up high enough in the hierarchy. You can stack the parentProperty attribute.
Code: Select all
var comp = app.project.activeItem;
var mask = comp.selectedProperties[0];
maskLayer = mask.parentProperty.parentProperty;
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
You can also navigate back down the property heirarchy using property.propertyGroup(). This will give you the layer object from any property:
Code: Select all
theProperty.propertyGroup(theProperty.propertyDepth)
Thanks Paul, that is good to know.