Skip to main content
jimmyh54016640
Participant
January 25, 2021
Question

Expression to control specific ball count of CC Ball Action?

  • January 25, 2021
  • 2 replies
  • 584 views

Hi, I'm currently creating a polka dot animation using CC Ball Action, similar to a scrolling LED signboard. For reasons, I need there to be a specific number of balls high and balls across, yet the effect only lets me adjust "grid spacing", which I find can be quite random and finnicky in how it scales and arranges all the balls. 

 

Is there any way, such as writing an expression, where I can have a greater control of the dimensions of CC Ball Action, by adjusting the number of rows and columns of the balls specifically? Thanks.

This topic has been closed for replies.

2 replies

Community Expert
January 25, 2021

Mylenium's suggestion is almost correct. The grid is based on layer size, not comp size. There is no expression needed. Just divide the layer height by the number of balls you want. 

 

You do all the math when you create the solid layer you will use for your LED sign. If you want the grid to be 247 X 50 and you want each square (ball) to be 25 pixels then create a new solid and type 25*267 in the width and 50 * 25 in height. Inside Ball Action just set the grid spacing to 25 and the ball size to about 50. 

 

Mylenium
Legend
January 25, 2021

Would be as easy as dividing the comp width/ height by the grid spacing and rounding the values suitably:

 

bNum=70;

Math.round(thisComp.width/bNum)

 

For more intuitive handling, the bNum variable could be tied to an expression slider of course. You still can't control the vertical and horizontal spacing separately, though. That's just not how the effect works.

 

Mylenium