Activity › Forums › Adobe After Effects Expressions › 3d stroke and layer transform
-
3d stroke and layer transform
Posted by Anonymous on October 24, 2005 at 10:39 pmI have a layer with 3d stroke applied to it. I am also using a comp camera to control it. However what about the 3d transform attributes for that layer, like the attributes you get on a 3d enabled layer?
Russell Wyner replied 10 years, 7 months ago 6 Members · 9 Replies -
9 Replies
-
John Dickinson
October 24, 2005 at 10:56 pmThose attributes won’t control the 3D stroke, only the solid to which the stroke is applied. 3D Stroke has it’s own parameters.
JD
John Dickinson
Motionworks
https://www.motionworks.com.au -
Anonymous
October 24, 2005 at 11:02 pmhaha yea i just realized 3d stroke had its own transform within it dduuh.
-
Greensock
November 4, 2005 at 7:22 pmI’m trying to get 3D stroke to work in 3D while parented to an object that’s spinning and scaling. I understand how to use expressions to link the 3D stroke effect to a null (no problems getting that to work). However, when I parent that null object to the stuff that’s spinning around and scaling in 3D, things shift and fall apart (they don’t stay synced up especially if I move the null object). Is this a known issue with 3D Stroke? I really wish the effect would orient itself with the layer that it’s applied to so that when I spin/rotate that layer in 3D, the effect is synced with it, but it appears as though the effect is independent of the layer in 3D space. Any way to get around this irritation?
And of course I
-
Steve Roberts
November 4, 2005 at 7:40 pmMy thought is that 3D stroke, like all effects in AE, produce a “movie” of a 3D effect on a flat layer, which acts as the “movie screen”.
To extend the metaphor, when you start parenting, you’re actually parenting the flat “movie screen”, not the “object within the movie”. Parenting doesn’t respect the settings of the 3D effect, in other words.
Can you try using an expression to tie the rotation of the stroke (within its effect parameters) to the rotation of the other object?
Steve
-
Greensock
November 4, 2005 at 8:15 pmYep, I did use expressions to tie it to a null object that’s parented to the other spinning/scaling object. But I need to move the entire thing up during the animation (away from the parent’s anchor point) and that gets things all funky. Here’s a response I just got from Trapcode [sigh]:
——————–
Making the null object parented breaks the syncing because the coordinates are relative to the parented object after parenting. You can see this – the numbers change when you parent the layer. I tried writing a new type of expression that would take into account both nulls but so far I have not been able to nail it, the position is trivial, but the when it comes to rotation it becomes very complex.
I’m sure there is a way, but it will take some kind of expression guru to figure it out. I’ll think some more and let you know if I find a solution.For now the only “workaround” I can think of is to not use parenting… not much help I know.
-
Greensock
November 4, 2005 at 9:57 pmI think I figured it out! I had to add some math to the position expression, but check it out in the After Effects file at https://www.greensock.com/Parented_3D_Stroke.zip. No super complex trigonometry required! You can move the parent around OR the controller null object and they work together beautifully (as far as I can tell thus far at least). Here’s the expression I had to put on the position:
controller = thisComp.layer(“Streak_Controller”);
controllerPos = controller.toWorld(controller.position);
parPos = controller.parent.position;
x = controllerPos[0] – ((controllerPos[0] – parPos[0]) / 2);
y = controllerPos[1] – ((controllerPos[1] – parPos[1]) / 2);
z = controllerPos[2] – ((controllerPos[2] – parPos[2]) / 2);
[x,y,z];Hope this helps someone. I just about threw my computer out the window trying to get this to work.
Jack
-
Brian Scott
March 20, 2015 at 6:47 pmhey I’m having the same problem i think. I’m glad to hear you got it figured out. I tried to download your AE file and I think the link is broken can you throw it back up?
-
Russell Wyner
September 24, 2015 at 9:32 pmIs that download link available somewhere? I can’t seem to implement the code.
-
Russell Wyner
September 24, 2015 at 9:39 pmActually, a simpler code worked for me. I just added the null position to the parent position…
For the X,Y transorm position of the 3D stroke…
controller = thisComp.layer("Null Layer");
controllerPos = controller.position;
parPos = controller.parent.position;
x = controllerPos[0] + parPos[0];
y = controllerPos[1] + parPos[1];
[x,y];And for the Z transform position of the 3D stroke…
controller = thisComp.layer("Null Layer");
controllerPos = controller.position;
parPos = controller.parent.position;
controllerPos[2] + parPos[2];
Reply to this Discussion! Login or Sign Up