Skip to main content
Adam_Murray96
Participant
October 12, 2021
Question

How to use a pulse mask to scale a diamond grid?

  • October 12, 2021
  • 2 replies
  • 727 views

Hello,

 

I am trying to create a effect on a diamond grid which scales when a pulse mask runs over the individual shapes and then returns back to their orignal size.

 

You can see the thick white pulse below:

I am followed a tutorial of the effect I want to achieve however, in his example he used two points between a null layer and the shape to determined the scale.

 

Here is the expression he used:

 

var p1 = thisLayer.transform.position; var p2 = thisComp.layer("Gradient").transform.position;

var ScaleFrom = thisComp.layer("Slider Controls").effect("Scale From")("Slider");

var ScaleTo = thisComp.layer("Slider Controls").effect("Scale To")("Slider");

var HitIn = thisComp.layer("Slider Controls").effect("Hitbox Inside")("Slider");

var HitOut = thisComp.layer("Slider Controls").effect("Hitbox Outside")("Slider"); var d = length(p1,p2);

var r = linear(d,HitOut,HitIn,ScaleFrom,ScaleTo); [r,r]

 

And here is the tutorial:

https://www.youtube.com/watch?v=BIwppXzHErY&t=215s

Time stamp: 1:59-4:49

 

I am wondering if anyone knows how to change the expression to use my pulse mask instead of the two points?

 

Thanks

This topic has been closed for replies.

2 replies

Community Expert
October 13, 2021

Another workflow you might consider uses Card Dance. It's simple, renders quickly, and gives you complete control over an easily constructed array of shapes. All you have to do is properly arrange the grid of shapes in columns and rows. If you need overlapping shapes as in your diamond pattern all you need to do is use two copies of the array and line them up. 

 

This is what I got in about 10 minutes using one shape layers, two repeaters a simple animated shape, and two copies of the precomp. The project is included in my post.

 

Mylenium
Legend
October 12, 2021
Adam_Murray96
Participant
October 12, 2021

Hi Mylenium,

 

I have looked at this example perviously, however, I can't achieve the effect due the pattern being made in Rhino > exported to Illustrator > then exported to After Effects, so there isn't a size option to make a 'size controller'. I only have scale and the gradient mask to work with to write the expression.

 

This is why I am trying to follow the video I linked since he gets around this. I am just unsure how to get the expression to react to the mask instead of the Null layer he used.

 

Thanks

Community Expert
October 12, 2021

The tutorial Mylenium pointed to explains exactly how to use an animated gradient layer as a scale controller. Just pre-compose your pulse layer the same way that the tutorial explains how to pre-compose the gradient layer and go from there. It's not too hard.