I’m decent with scripting, but the math in this one is just too tough for me. I’d love a hand if anyone has done something like this in the past.
Some contents or functionalities here are not available due to your cookie preferences!
Hi. I’m just flying by but figured I’d give my two cents. Perhaps using a sourceRectAtTime along with “height” and “width” for each layer and then using the dimensions of the comp would be a place to start. For example, if your comp is 1920×1080 you’d want the sum of the widths of cells A1+B1+C1 to equal 1920 and the sum of the heights of cells A1+A2+A3 to equal 1080. I’m SURE there are way smarter people than me that might have a better way of doing this though. Good luck!
You can put multiple rectangles within one shape layer and then control the scaling of the x and y dimensions and how they effect one another. So far it’s doing the trick for what I was trying to accomplish!
I believe it is going to turn into a circular problem the moment you try to do this with more than one rectangle shape. Meaning one where you have an expression in layer A trying to read the result of expression on layer B trying to read the result of expression on layer A. In my estimate it would work better by using nulls that controlled the vertical and horizontal separation points of the boxes, which would give you stable reference points to look up.
I’ve set this up so that the contents of each box are masked when the boxes shift/resize, but you could probably parent the precomps’ scale values to the controllers as well so they squish/stretch like your example.