• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Shape layer Shape Index in Expressions

Engaged ,
Jul 18, 2017 Jul 18, 2017

Copy link to clipboard

Copied

Is there a way to access the index of a shape in a shape layer? Just like how I can use layer index to talk to specific layers in a comp, I want to talk to specific shapes in a shape layer. Like Rectangle 1. Rectangle Path [3] or something like that?

Views

6.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 19, 2017 Jul 19, 2017

There is no absolute index to address. You address this stuff using the .content() method referencing the groups and property streams. The real crux of course is that you may end up writing endless strings of content(Top Group).content(Sub Group).content(Path) and so on just to gain access to a simple value, depending on how deeply you nested your stuff. The actual groups can of course be referenced using their indices just as well, but this gets quite confusing and messy since in fact most of t

...

Votes

Translate

Translate
LEGEND ,
Jul 19, 2017 Jul 19, 2017

Copy link to clipboard

Copied

There is no absolute index to address. You address this stuff using the .content() method referencing the groups and property streams. The real crux of course is that you may end up writing endless strings of content(Top Group).content(Sub Group).content(Path) and so on just to gain access to a simple value, depending on how deeply you nested your stuff. The actual groups can of course be referenced using their indices just as well, but this gets quite confusing and messy since in fact most of them will simply only have 1 as their number and clearly content(1).content(1).content(1) isn't particulalrly telling. Therefore using the names is much more advisable.

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 19, 2017 Jul 19, 2017

Copy link to clipboard

Copied

I found a few resources that dig into it a bit. using propertyIndex of the propertyGroup(), but they only explain so much. I am still trying to figure out you to use it for linking individual shapes but it seems so complicated.

Tapering A Stroke with Expressions Part 1 on Vimeo
Property Group and Index - AE ENHANCERS
Property Group Index Expression + Free Preset - YouTube

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

Yep, this is the right approach. I used this when trying to change transform properties of a specific group, matching the index of the group to the index of the layer (I would then duplicate the same layer multiple times in the same comp)

 

You can find the name of the group like this:

 

var groupIndex = thisProperty.propertyGroup(2).propertyIndex;
var groupName = thisLayer("Contents")(groupIndex).name;

 

Combining the group index and name, you should be able to set up the rig I hope. Lemme know, thanks!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

LATEST

You can use the propertyIndex and  group name property, something like this:

var groupIndex = thisProperty.propertyGroup(2).propertyIndex;

var groupName = thisLayer("Contents")(groupIndex).name;

 

You can change the 2 above to whatever heirarchy the group is in. 

Hopefully all your shape layers are in groups with the same heirarchical level

 

Combining the group index and name, you should be able to set up the rig I hope. Lemme know, thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines