Copy link to clipboard
Copied
‌I understand I can use thisProperty to get the index of a property, but is there a way to get the index of the shape group my opacity is inside? Sort of like an thisProperty.parent.index or something
It's going to be something like:
thisProperty.propertyGroup(4)
.propertyGroup lets you travel up the property hierarchy, with the number specified being the number of levels you're moving up. One thing that can help is to pickwhip to your property from a text layer's source text expression to create an expression like this:
p = thisComp.layer("Shape Layer 1").content("Group 1").content("Rectangle 1").transform.opacity;
p.propertyGroup(4).name
That way you can see what the different levels are (someti
...Copy link to clipboard
Copied
It's going to be something like:
thisProperty.propertyGroup(4)
.propertyGroup lets you travel up the property hierarchy, with the number specified being the number of levels you're moving up. One thing that can help is to pickwhip to your property from a text layer's source text expression to create an expression like this:
p = thisComp.layer("Shape Layer 1").content("Group 1").content("Rectangle 1").transform.opacity;
p.propertyGroup(4).name
That way you can see what the different levels are (sometimes they're not all visible) to make sure you've got the right one.
Dan
Copy link to clipboard
Copied
Thank you so very much Dan!
Copy link to clipboard
Copied
thanks a lot this reply gave me some good practice now
Copy link to clipboard
Copied
Thank you so much! I thought I'd have to wait more than 20 minutes for that answer!
‌
Copy link to clipboard
Copied
Dan, Is there a way to drill one layer down to target a property inside another group?
The propertyGroup() function goes up one level but I cannot find any way to go down one level in the hierarchy.
Copy link to clipboard
Copied
Maybe you could supply an example of what you mean. In general, you could go up using propertyGroup() until you get to a common ancestor, then go down the other branch from there by name.
Dan
Copy link to clipboard
Copied
Thanks for your quick response Dan. I actually found an answer on another one of your pages.
This is what I meant. You can just put a number in parentheses after content. I couldn't find the answer to this anywhere. I guess it was just obvious to everyone in the world except me.
theNextIndex = thisProperty.propertyGroup(2).propertyIndex + 1;
xPos = thisComp.layer(index).content(theNextIndex).transform.position[0] + 11;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now