Property Group and Index

Moderators: Disciple, zlovatt

Post Reply
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

March 9th, 2009, 7:31 am

I have a bunch of slider expression controls on a layer. What's the code to get index of each instance in the effects chain? Currently I am only able to get the propertyIndex of the slider itself which is always 1 since it's a child of the Slider Control Expression:

Code: Select all

this.propertyIndex
Is there a way to get it's parent so that I can get a unique index for each effect instance?

Code: Select all

this.parent.propertyIndex 


doesn't work.

-Lloyd
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

March 9th, 2009, 7:52 am

Try this:

Code: Select all

this.propertyGroup(1).propertyIndex
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

March 9th, 2009, 8:10 am

Thanks Paul, that worked. So is propertyGroup(1) like saying go up one level in the hierarchy?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

March 9th, 2009, 8:52 am

Yes.
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

April 3rd, 2009, 4:07 pm

By the way, this works in CS3 but doesn't work in CS4:

Code: Select all

this.propertyGroup(1).propertyIndex

In CS4 you need to write this:

Code: Select all

thisProperty.propertyGroup(1).propertyIndex
which works in CS3 so you might want to use the later

-Lloyd
Zedzero
Posts: 4
Joined: August 19th, 2004, 11:01 am
Location: London
Contact:

June 1st, 2009, 11:25 am

Hi Folks,

I'm trying to get my head around this 'propertyGroup/propertyIndex' shenanigans and struggling.

I'm trying to get a group of letters in a block of text to break up in a random fashion.

I've applied an expression to the block of text that selects the first letter and applies a random positional and rotational drift over time using interpolation. I'm using the index range selector rather than the percentage, so my start is 0 and my end is 1.

What I want to be able to do is duplicate the property group and reference the previous property groups range 'offset' and add a 1 to get the next letter along in the string.

It seems that all the 'propertyGroup(x).propertyIndex' does is tell you the index number rather than the value itself, and even then I'm struggling to actually understand how you work out how to get to the previous property groups offset value.

Any pointers would be greatly appreciated.

Otherwise I'm going to have to roll up my sleeves and get medieval on it by hand.
zedzero uk
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

June 1st, 2009, 12:43 pm

The way property Group works is you tell it how far up the hierarchy you want to move so to use this on a text animator your would need to back up 3 times. Once to the offset itself, 2 to the Range Selector and 3 to the Animator Group. Then you would substitute all this (and substract 1) where you would use the index:

Code: Select all

text.animator(thisProperty.propertyGroup(3).propertyIndex-1).selector("Range Selector 1").offset
This will get you the value of the offset from the previous Animator's Range Selector 1 Offset.


-Lloyd
Zedzero
Posts: 4
Joined: August 19th, 2004, 11:01 am
Location: London
Contact:

June 1st, 2009, 12:54 pm

Cheers Lloyd.

That works exactly how I wanted.

I'm still not entirely sure how!

I need to eat more fish.

Thanks again

P
zedzero uk
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

June 1st, 2009, 1:05 pm

No problem, one thing to note is I generally try to stay away from index-1 type expressions since they are recursive and can slow way down if you have a lot of instances. A better way to do it is to multiply the value times the index. This method makes for much faster expression execution times.

-Lloyd
mikeoakley123
Posts: 1
Joined: September 14th, 2019, 1:30 am

September 14th, 2019, 1:35 am

Mikey Borup gives a chunk of insights into the use of the After Effects Property Group Index in expressions. With that expression, you can get the index of a belongings inside your layer, which includes a shape layer.

The Property Group Expression essentially lets you target a set of homes relative to the belongings on which the expression takes place to be. Using the Property Group Index, technique you can set up a call-independent relationship in the property hierarchy. This technique is specifically beneficial whilst duplicating residences that include expressions.
Post Reply