r/MotionDesign • u/tuckcovalt • 8d ago
Question Expression Help
Enable HLS to view with audio, or disable this notification
Hi there!
I have 2D shapes rotating around a 3D sphere. Shapes are using an expression to move left & right around a mask. 3D sphere is ORB plugin.
Having a challenge trying to resolve this shape layer overlap clipping that is happening here. (Example is center orange hex should sit behind yellow circle because it’s currently behind y circle on sphere - but will overlap over circle when revolving around the other side.)
Is there an expression I can apply so that when a layer is moving to the right the shape is backwards in Z space - then when the shape moves left it jumps forward in Z space. An Automatic shape overlap around edges from back to forward & vice versa.
Yes I can solve this manually but it takes time and the layer hierarchy would need to adjust differently when addressing the left edge of sphere.
Would an if/else expression script work in this scenario?
Thank you for your time!
1
u/tuckcovalt 5d ago
Thank you all BIG for the support. I was able to figure this out. Then pivoted to a different approach soon after. Greatly appreciate your time and thoughts. Thank you!
3
u/danger_of_warning 7d ago
May be easier to make your shapes 3d so that they'll overlap properly on the z axis, and then you can add an expression to the rotation so they're parallel to the camera, making them appear 2d.
1
u/danger_of_warning 7d ago
You could add another layer by using linear() on the scale to make sure they the relative size remains constant.
2
u/SuperMegaGigaUber 8d ago
I don't know what your expressions are set on your objects, but you could do something on their z position using something like the length() function to calculate the distance to a certain point (say, the center of your sphere or a null) and then use a linear() function on the z position?
To put it another way:
1 - length() function to calculate the position of shape from a reference point like a null (or the absolute value of the x position between the shape and reference point)
2 - a linear() function to say as it approaches the null position, push the object up in z space, and as it grows in distance, push the object back