Thanks Xavier for such a quick response. I’ve seen your posts all over the forum and am geeking out a bit that you responded.
I had some time to try out the expression and it’s kinda close, but it’s not the exact parent/child relationship I was looking for. Here’s the hiccups I’m noticing.
- Rotation is off from angle control. Fixed by adding degreesToRadians();
- Child doesn’t follow the parents position.
- Child does rotates around the parent point. Even if I move the parent. However, if I offset the rotation of the parent and then try to drag the child point around, the child point floats away from the cursor.
Ideally I’d be able to daisy chain a few of these together to help with a rig I’m building. I feel like I’m reinventing the wheel, but I know the rig will be so cool if this is possible. I’m going to continue to tinker, but I’d love to hear your thoughts. Thanks again!
P=effect("Character Rig")("Point 1");
C=effect("Character Rig")("Point 2");
R=effect("Character Rig")("Point 1 Rotation")
a=degreesToRadians(R);
u=sub(C, P);
c=Math.cos(a);
s=Math.sin(a);
x = c*u[0]-s*u[1];
y = s*u[0]+c*u[1];
[P[0]+x, P[1]+y]; // result (rotated C)