Activity › Forums › Adobe After Effects Expressions › Z-rotation linked to two points – one is 3D and the other 2D
-
Z-rotation linked to two points – one is 3D and the other 2D
Posted by Roland R. kahlenberg on August 1, 2011 at 5:25 amHi peeps, I’m looking for an Expression to link the Z-rotation property of a layer from two points residing in two separate layers – one is 3D layer and the other is 2D.
TIA
RoRKIntensive AE & Mocha Training in Asia.
Roland R. kahlenberg replied 15 years, 1 month ago 2 Members · 4 Replies -
4 Replies
-
Dan Ebberts
August 1, 2011 at 1:20 pmAre you talking about something like this?
L1 = thisComp.layer("2D Layer");
p1 = L1.toComp(L1.anchorPoint);
L2 = thisComp.layer("3D Layer");
p2 = L2.toComp(L2.anchorPoint);
v = p2 - p1;
radiansToDegrees(Math.atan2(v[1],v[0]))
Dan
-
Roland R. kahlenberg
August 1, 2011 at 2:04 pmThat works well Dan BUT I’ve found another issue. Here’s the scenario –
I have the Beam effect linking the two points mentioned. I would like to place a Text Layer along the Beam; centered will be fine but it’ll be better if I am able to move the text anywhere along the Beam.
Right now, the Z-rotation for the text layer looks good but there are instances where the text strays away from the Beam.
Cheers
RoRKIntensive AE & Mocha Training in Asia.
-
Dan Ebberts
August 1, 2011 at 6:48 pmThis should position the text anchor point at the center of the beam:
L1 = thisComp.layer(“2D Layer”);
p1 = L1.toComp(L1.anchorPoint);
L2 = thisComp.layer(“3D Layer”);
p2 = L2.toComp(L2.anchorPoint);
(p1 + p2)/2You could add a Position animator tied to sliders to adjust the x and y, if necessary.
Dan
-
Roland R. kahlenberg
August 2, 2011 at 4:40 amAwesome! How can I convert my 2D Beam layer (Solid) to a 3D layer (cos I’d like some 3D shadows) and keep everything sexy?
TIA
RoRKIntensive AE & Mocha Training in Asia.
Reply to this Discussion! Login or Sign Up