-
Expression to mimic parenting between sets of point and angle controls.
Hi everyone,
Been a fan of the forum for many years now. This is the first time I haven’t found what I was looking for and thought maybe someone can help point me in the right direction.
I’d like to daisy chain points controls together and have them be able to rotate around one another with angle controls tied to them through expressions. I know, I know, I know this can be done very easily with null objects parented together, but would it be possible to mimic a parent/child relationship between sets of point & angle controllers?
Thanks in advance for any help out there!
Cheers,
Dustin—
This probably isn’t useful, but I’m including an expression I thought was getting me close. Then, I realized the parent position moved if I offset the child’s position. That’s because the distance from center is predefined. I was hoping using the length() function would help, but it didn’t produce the results I expected and I’m over my head with trigonometry.
—-P= effect("PointRig")("Point 1"); //parent point control position
C= effect("PointRig")("Point 2"); //child point control position;R = effect("PointRig")("Point 1 Rotation"); // parent rotation control, degrees
D = 150; // Distance from parent
rad = degreesToRadians((R * -1)-180);
x = D * Math.sin(rad);
y = D * Math.cos(rad);
[x, y] + P + C;
