Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions No index for transform parameters in a shape layer’s group?

  • No index for transform parameters in a shape layer’s group?

    Posted by Mio Tanaka on December 26, 2012 at 2:04 am

    I learnt about shape layer index from this page and there’s a thing I cannot fathom out.
    https://www.macprovideo.com/hub/after-effects/after-effects-shape-layer-index-hierarchy

    First, for example, there’s three shape sub-layers in a shape layer’s inner group

    Shape layer
    ▼Contents
    ▼Group
    ▾Path 1
    ▾Fill 1
    ▾Transform

    If you count from ‘Path 1’, there’s three, sort of, parameters in ‘Group’, and I thought the Transform’s index value is three, but actually it says two, the same as ‘Fill 1’.

    So I wondered if there’s no index number for transform parameters in a shape layer’s group?

    In my case, I wanted to control rotation inside the transform option in a group by expression. I used ‘propertyGroup(2)’ rather than ‘propertyGroup(1)’ overall and really didn’t need to use the index of the transform, but it’s good to know.

    Thanks in advance,

    Mio Tanaka replied 13 years, 4 months ago 2 Members · 10 Replies
  • 10 Replies
  • Dan Ebberts

    December 26, 2012 at 2:39 am

    I can’t quite tell what you’re after exactly, but one thing you can do is use a text layer to snoop around the shape layer’s properties. Use the pickwhip to create an expression like this in the text layer’s Source Text property:

    prop = thisComp.layer(“Shape Layer 1”).content(“Shape 1”).transform.rotation;

    Then you can snoop around by adding lines like:

    prop.propertyIndex

    or

    prop.propertyGroup(1).name

    or

    prop.propertyGroup(2).numProperties

    It’s also useful to get Jeff Almasol’s rd_GimmePropPath.jsx script from his redefinery site. It’s a great tool for examing the expression or script syntax to access any property.

    Dan

  • Mio Tanaka

    December 26, 2012 at 4:35 am

    Thank you for the reply. I learnt a few more new things and I’ll check the script!

    Hmmm, I guess my explanation wasn’t good enough. Let me explain it again.
    What I meant was, by using ‘.propertyIndex’, each property’s index is like this:

    ▼Group
    ▾Path 1 —index 1
    ▾Fill 1 —index 2
    ▾Transform —index 2

    Or if there are properties like this…

    ▼Group
    ▾Path 1 —index 1
    ▾Path 1 —index 2
    ▾Fill 1 —index 3
    ▾Transform —index 3

    You can see the Transform’s index is the same as the property above’s, and I wonder if there’s not index number for Transform property at all.

    Thank you,

  • Dan Ebberts

    December 26, 2012 at 6:40 am

    I’m not seeing anything like that. It’s hard to say without seeing the shape layer you have, but sometimes not all the property groups in a shape layer are visible in the UI. Try using the script I mentioned to see if the paths to the properties with the same propertyIndex values are actually different in some way.

    Dan

  • Mio Tanaka

    December 26, 2012 at 7:27 am

    Dan, thank you for the reply again.

    I tried using prop.propertyGroup(2).numProperties, and actually it says the correct value, which includes Transform property I was talking about.

    But then again, when I used this to get an index value, it’s a short value by one…

    value = thisProperty.propertyGroup(1).propertyIndex

    Since it’s quite likely I’m misunderstanding something, here is the screen shot. Maybe you can see why…

  • Dan Ebberts

    December 26, 2012 at 7:52 am

    Fill and Transform are not in the same property group. This is something that is not obvious from looking at the UI. You need the other tools I mentioned.

    Dan

  • Mio Tanaka

    December 26, 2012 at 8:53 am

    I’ve tried the script and got these:

    transform.rotation:
    comp(“tree 2”).layer(4)(“ADBE Root Vectors Group”)(1)(“ADBE Vector Transform Group”)(“ADBE Vector Rotation”)

    fill.color:
    comp(“tree 2”).layer(4)(“ADBE Root Vectors Group”)(1)(“ADBE Vectors Group”)(3)(“ADBE Vector Fill Opacity”)

    It seems there’s no index number for Transform and there’s no way you can access a transform property. But then again, why did the rotation gave me the value 3 in the image I posted…? Are there invisible two values before Transform?

  • Dan Ebberts

    December 26, 2012 at 5:57 pm

    > there’s no way you can access a transform property.

    I don’t understand how you’re coming to that conclusion.

    Nosing around a similar shape layer, I get a hierarchy like this:


    Shape Layer
    Contents
    Shape 1
    Blend Mode
    Contents
    Path 2
    Path 1
    Fill 1
    Transform
    Material Options

    Dan

  • Mio Tanaka

    December 27, 2012 at 1:04 am

    My mistake. What I meant was, I thought there’s no way to access Transform by using an index number, since the script gave me these. For Fill there’s (3), an index, whereas there’s no number for Transform. I hope I can get it across.

    transform.rotation:
    (“ADBE Vector Transform Group”)(“ADBE Vector Rotation”)

    fill.color:
    (“ADBE Vectors Group”)(3)(“ADBE Vector Fill Opacity”)

  • Dan Ebberts

    December 27, 2012 at 1:30 am

    This works for me (although I don’t know why you would want to do it this way):

    (“ADBE Root Vectors Group”)(1)(3)(“ADBE Vector Rotation”)

    Dan

  • Mio Tanaka

    December 27, 2012 at 6:10 am

    Hmm, interesting. As seeing your comment, probably it’s not as useful as layer index numbers… I’ll study more about expressions. Thank you, Dan!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy