
MotionScript.com - main page AE ENHANCERS • View topic - Distribute layers in shape of sphere This expression spreads layers in a 3D space to form a sphere. How does it do it? Simply by cutting a sphere in circular slices. These slices are, in my expression, the "rows". The "middle" slice is row 0, the slice above is row 1, and so forth. The sphere is symetrical to the place (x/z) containing row 0. Let's take a closer look : The Null object "A" is in the middle of the sphere and is the parent of all the other layers. The value "a" allows to manage the space between two layers. For the sphere to be perfectly homogeneous, this space has to be identical for all layers. The radius of the "middle" slice (row 0) is d, the radius of the sphere. Code: d*a=d*cos(a*i)*x Where x is the spacing angle to row i. So we get : x=a/cos(a*i) The second difficulty is the amount of layers per slice. 2*Math.PI/spacing angle For it to always be an integer, I added the Math.round function : s=Math.round(2*Math.PI/(a/Math.cos(a*i))) From there one has to adjust the spacing angle for each row, which becomes : and
After Effects Expressions Expressions - Reference Tables Layer Parameters These are the layer parameters to which you can apply expressions. (You can also apply expressions to effect parameters and to some mask parameters.) Use this table to know what each parameter expects from your expressions: how many dimensions, what kind of units, and common value ranges. Global Objects This table lists all of the global objects available in After Effects, and the type of objects they return. Comp Attributes and Methods This table lists all of the attributes, methods and sub-objects belonging to comp objects. Layer Attributes and Methods This table lists all of the attributes, methods and sub-objects belonging to layer objects. Footage Attributes and Methods Property Attributes and Methods These are the attributes and methods belonging to Property objects such as 'rotation' and 'opacity'. Vector Math Methods Interpolation Methods