3 Replies Latest reply on Jan 31, 2018 8:56 AM by mattr60797061

    Using propertyGroup and propertyIndex to automate a grid of square paths using expressions

    mattr60797061 Level 1

      Hey Everyone,


      As my long-winded title might suggest, I'm running into an issue trying to solve a very basic problem. I've been struggling with it for 3 days, so now I'm turning to you for help.


      I'm trying to create a self-contained shape layer that can expand itself

      into a grid of squares fitting a composition of 1920x1080 for a flexible transition preset. The first step in this would be to create the squares. I want them to be 120x120 for now, but I'd like to just create one and duplicate the path to fill the screen. Then I want to use an expression using .sampleImage and a gradient wipe control layer to automate their individual scale properties (is there a better way to achieve that? I feel it might be a cpu hog but I don't know what other method might work better for what I want) I'd ultimately add control sliders to adjust the square size, but havent bothered yet as I just want to figure out how to link a squares position to the previous square's size.


      The expression I made doesn't work (surprise, surprise...) and I want to understand why.


      Here's what it currently looks like. I'm new to expressions obviously, but I really want to tackle the ability to reference paths within a shape layer as it would really help my workflow, and seems to be extremely powerful. Attaching a screenshot below to further illustrate my problem. Any help is appreciated! Thank you!

      propAbove = thisProperty.propertyGroup(3).propertyIndex-1;
      x = thisProperty.propertyGroup(3).propAbove.position[0]*propAbove.size[0];
      y = content("Rectangle1").content("Rectangle Path 1").position[1];

      Screenshot 2018-01-30 12.01.52.png