-
1. Re: Bulge effect center to follow a rotated layer
Mylenium Nov 23, 2010 2:41 AM (in response to Andy Bay)Depends on how you create the wire, I guess.... Simple pickwhip expressions would do the trick when using the Beam effect, for everything else we need more info on the specific setup...
Mylenium
-
2. Re: Bulge effect center to follow a rotated layer
Andy Bay Nov 23, 2010 3:03 AM (in response to Mylenium) -
3. Re: Bulge effect center to follow a rotated layer
Mylenium Nov 23, 2010 5:07 AM (in response to Andy Bay)This is what you need: http://www.motionscript.com/mastering-expressions/lst-lens-flare.html Apply a Point expression control on your light bulb layer where you want the center of the bulge, then apply the expression to the comp. The only difference to Dan's tute is that you would reference the point control, not the anchor point or a default value. Should look something like that:
bulb=thisComp.layer("Lightbulb"); bulbCenter=bulb.effect("Center")("Point"); bulb.toComp(bulbCenter)Mylenium
-
4. Re: Bulge effect center to follow a rotated layer
Rick Gerard Nov 23, 2010 7:51 AM (in response to Mylenium)If you want the Bulge applied to the light bulb layer you can just apply it. No expression necessary.
If you want to apply Bulge to an adjustment layer then you need to do a few things. First, as you have done, parent the Bulb to the Cord. Then move the anchor point of the Bulb layer to where you want the center of the bulge to be. Now add the following expression to the Bulge Center property on the adjustment layer:
bulb = thisComp.layer("Bulb"); cntr = bulb.anchorPoint; bulb.toComp(cntr)Here's a CS5 sample comp.
-
5. Re: Bulge effect center to follow a rotated layer
Andy Bay Nov 23, 2010 9:30 AM (in response to Rick Gerard)Thank you both very much!
I tested so far only Rick's way, but it worked very nicely!
bulb = thisComp.layer("Bulb");
cntr = bulb.anchorPoint;
bulb.toComp(cntr)
Can you open up this expression a little? I understand that first you claim the variable "bulb" to refer to a layer called "Bulb" inside the current composition. Then a variable "cntr" is created, but what exactly does that variable do? I also don't undertand the final statement bulb.toComp(cntr) what is that actually telling the bulge center property to do?
-
6. Re: Bulge effect center to follow a rotated layer
Rick Gerard Nov 23, 2010 10:14 AM (in response to Andy Bay)bulb = thisComp.layer("Bulb");
cntr = bulb.anchorPoint;
bulb.toComp(cntr)bulb is referring to the footage layer named Bulb
cntr could be anything. This is just a cleaner way to write thisComp.layer("Bulb".anchorPoint") and it makes writing the layer space transformation easier.
You could write:
thisComp.layer("Bulb").toComp(thisComp.layer("Bulb").anchorPoint)
I think that is a lot more difficult to understand and it's more difficult to write. The expression simply returns the composition coordinates of the "Bulb" layer's anchor point. IOW For the layer "Bulb" (bulb.) give me the Composition Coordinates of the Anchor Point (toComp (cntr).
When you attach a parent to a layer the position property values are calculated as an offset from the parent layer's position property. Layer Space transformations recalculate the position in relative to the composition or to the world when working with 3D layers.
Here's how the expressions works in plain english.
Calculate the position coordinates by calculating the offset of the target layer from the composition center by calculating the difference between the child layer's (Bulb) position coordinates from the parent layers (Cord Layer) position offset from the composition center to determine the actual composition coordinates of the child layer's anchor point.
There's more info about layer space transformations in the expressions section of the help files. It's worth reading.
-
7. Re: Bulge effect center to follow a rotated layer
Andy Bay Nov 23, 2010 11:07 AM (in response to Rick Gerard)Thank you very much, that is one helpfull expression!




