View Full Version : 2 Anchor Points on a Single Layer?
andytroz 07-27-2007, 08:17 PM Updated for clarity:
I'd like to "Aim Constrain" 2 nulls to eachother so that when translated on the Y Axis, both nulls will still face eachother.
Here's an image of what I hope to accomplish:
http://img440.imageshack.us/img440/8127/aexnullrigcopyvw0.jpg
Cheers,
Andy.
|
|
Mylenium
07-27-2007, 09:53 PM
Hi Guys, Is there's a way to parent 2 nulls to a layer and have them "aim constrained" to eachother in order to have 2 seperate anchor point controlls on a single layer?
Here's an image of what I hope to accomplish:
http://img59.imageshack.us/img59/5307/aexnullrigko9.jpg
Cheers,
Andy.
You need to pin them with expressions, parenting won't work. Not sure what you are trying to do, though. Your sample looks like a simple targeting expression (rotation only) that does not even require a secondary anchor point, only the layer and the target.
Mylenium
andytroz
07-27-2007, 11:43 PM
Sorry, I don't think I was clear enough in my original post, I've updated it along with the picture.
Mylenium
07-28-2007, 07:01 PM
Sorry, I don't think I was clear enough in my original post, I've updated it along with the picture.
That's simple. Apply a lookAt() expression to the rotation of each Null.
lookAt(position,thisComp.layer("other Null").position)
If the Nulls flip, simply add 90 degree angle increments to the value until it looks right.
Mylenium
andytroz
07-29-2007, 07:56 AM
I've tried the "lookAt(position,thisComp.layer("other Null").position)" script (replacing "other Null" with the correct null name of course) but I must be doing something wrong because it seems to generate an error:
After Effects warning: expression result must be of dimension 1, not 3
Expression disabled.
Any ideas?
Mylenium
07-29-2007, 03:15 PM
I've tried the "lookAt(position,thisComp.layer("other Null").position)" script (replacing "other Null" with the correct null name of course) but I must be doing something wrong because it seems to generate an error:
After Effects warning: expression result must be of dimension 1, not 3
Expression disabled.
Any ideas?
Sorry, my bad. lookAt is supposed to work with 3D layers, so you need to enable the 3D switch. as an alternative, you can manually calculate the rotation using Math.atan2(). Something like this:
target_X=thisComp.layer("other Null").position[0];
target_Y=thisComp.layer("other Null").position[1];
source_X=position[0];
source_Y=position[1];
diff_X=target_X-source_X;
diff_Y=target_Y-source_Y;
angle=radiansToDegrees(Math.atan2(diff_Y,diff_X);
[angle]
Mylenium
yikesmikes
07-29-2007, 06:17 PM
Oh, I think I get it... are these Nulls 3D?
I think Mylenium's expression,
lookAt(position,thisComp.layer("other Null").position)
goes on Orientation, not one of the rotations.
If you want expressions on rotation, try these on the rotation values (and drop the Orientation expressions):
On the X Rotation:
lookAt(position,thisComp.layer("Null 1").position)[0]
On Y Rotation:
lookAt(position,thisComp.layer("Null 1").position)[1]
On Z Rotation:
lookAt(position,thisComp.layer("Null 1").position)[2]
And sub in your null names.
Keep in mind my first sentence was , "Oh, I think I get it..."
CGTalk Moderation
07-29-2007, 06:17 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.