-
1. Re: Multiplaning without affecting scale due to the Z axis?
lasvideo Aug 28, 2012 8:09 PM (in response to victoriavanpatten)Zaxwerks Layers Tools Z distribution plugin. I have used this one.
http://zaxwerks.com/layertools/index.shtml
AE Scripts. Multiplane
-
2. Re: Multiplaning without affecting scale due to the Z axis?
victoriavanpatten Aug 28, 2012 8:36 PM (in response to lasvideo)Thank you so much! This is exactly what I needed!
-
3. Re: Multiplaning without affecting scale due to the Z axis?
lasvideo Aug 28, 2012 9:03 PM (in response to victoriavanpatten)You are very welcome!
-
4. Re: Multiplaning without affecting scale due to the Z axis?
Rick Gerard Aug 29, 2012 4:23 AM (in response to victoriavanpatten)There's also very simple expression that multiplies the scale by the ratio between the distance from the camera and the zoom value. I use this one all the time. It's nothing more than a simple division problem.
Try applying this to the scale position of your 3D layer:
C = thisComp.layer("Camera 1"); L = thisLayer CP = fromWorld(C.toWorld([0,0,0])); LP = fromWorld(L.toWorld(anchorPoint)); d = length(CP, LP); z = C.zoom; r = d/z r * valueOkay, the expression looks a little complicated, but it's really simple.
Let me try and explain what's going on here. First thing I'm going to do is define the variable C as the camera, and the variable L as the current layer. Using variables makes things easier to read, and saves typing.
I tend to use a lot of parenting in my compositions. When you assign a parent the position value of the child is relative to the parent. This is going to cause problems in the calculations so the next two lines use the layer space transformation method to set the position value relative to AE's 3D world. CP is the position of the camera relative to AE's 3D world. LP is the position of the layer relative to AE's 3D world. Adding a parent to the camera or the layer will now not complicate the calculations.
The next method is AE's length function. It simply measures the distance between two points. In this case, d equals the distance between the layer and the camera.
The variable z is set to the camera's zoom value.
Now we can calculate the ratio (variable r) by dividing the distance by the zoom value.
All that is left is to multiply the ratio by the current value of the scale property. As a result, the layer, no matter what the distance from the camera, will always appear to be the same size. This will solve your scale problem. Multiplying the ratio by the value also allows you to set keyframes or adjust the scale of the layer manually and still keep the same apparent size as the camera moves around the comp.
Once you have set this up, select the scale property for the layer and save this setup as an animation preset. Now you'll have it to use any time you need it. I've saved out a couple hundred of these expressions and I use them all the time.
-
5. Re: Multiplaning without affecting scale due to the Z axis?
lasvideo Aug 29, 2012 6:57 AM (in response to Rick Gerard)Rick, it would have been helpful if you had first presented the full expression in one line, then broken it down. I find it difficult to follow without the the expression as a whole.
And honestly, after seeing the detail of your fine explanation, for simplicities sake, I would run out and get one of the to items I mentioned instead of having to remember the expression every time I need to do multiplane stuff ;-)
-
6. Re: Multiplaning without affecting scale due to the Z axis?
Rick Gerard Aug 29, 2012 7:23 AM (in response to lasvideo)Rick, it would have been helpful if you had first presented the full expression in one line, then broken it down. I find it difficult to follow without the the expression as a whole.
You don't usually write expressions on one line. Complex expressions become impossible to troubleshoot or check for typeos if you put everything on one line. Just as in HTML, Java, or any other kind of code, nicely laid out code is easier to work on.
While
C = thisComp.layer("Camera 1"); L = thisLayer; CP = fromWorld(C.toWorld([0,0,0])); LP = fromWorld(L.toWorld(anchorPoint)); d = length(CP, LP); z = C.zoom; r = d/z r * valuewould work, it's very difficult to read or troubleshoot. BTW, I did notice that I missed a ; at the end of the L= thisLayer line.Saving the expression as an animation preset is just as easy as running a script or applying a plug-in. I've got about 200 effects presets that I keep in my library. Most contain expressions. Some use several plug-ins. Eight out of ten of my projects use at least one preset that I've written. This one is an old standby that is used in about half of my 3D comps.
And honestly, after seeing the detail of your fine explanation, for simplicities sake, I would run out and get one of the to items I mentioned instead of having to remember the expression every time I need to do multiplane stuff ;-)
Note the last line in my post... Even though I'm pretty good at expressions, there's no sense in rewriting something I've already done.
Just in case you'd like to start a collection of custom presets here's this one. Enjoy.
-
7. Re: Multiplaning without affecting scale due to the Z axis?
lasvideo Aug 29, 2012 11:29 AM (in response to Rick Gerard)Ric, I am in awe of your facility with expressions. And sites like AE Scripts are a treasure house of useful things for AE. But I must admit, I get slightly naseous when I gaze on the raw expressions. Must be my Math Allergy kicking in ;-)
-
8. Re: Multiplaning without affecting scale due to the Z axis?
Rick Gerard Aug 29, 2012 12:11 PM (in response to lasvideo)I've taught a bunch of folks how to do expressions. It's a lot more straightforward than PHP or MySQL programming.
I highly recommend that you play around with expressions for just a bit. Most of it is just declaring variables and doing simple fourth grade math. Almost all of the methods are available right from within AE. There's really very little to memorize.
-
9. Re: Multiplaning without affecting scale due to the Z axis?
lasvideo Aug 29, 2012 12:17 PM (in response to Rick Gerard)I have dipped my toe in the water with wiggles and using Pick Whips. But I will religate anything more to those that relish it.
-
10. Re: Multiplaning without affecting scale due to the Z axis?
DanR123 Sep 2, 2012 10:18 AM (in response to Rick Gerard)that's a great script Rick, thanks a ton!
I'm amazed at what people come up with using expressions
-
11. Re: Multiplaning without affecting scale due to the Z axis?
DanR123 Sep 2, 2012 11:36 AM (in response to Rick Gerard)Rick, any quick fix if I have extremly wide (3000px wide or more) images? I want to have a pan with near and far elements
I can crank up the focal length or cut up the layers, but was wondering if there was something other than the layers anchor point for postioning I could use in the expression?
-
12. Re: Multiplaning without affecting scale due to the Z axis?
philament Nov 15, 2012 8:18 AM (in response to Rick Gerard)Rick, this is a great expression and i appreciate the detail you added in explaining it. hoping you might be able to explain something about using the camera to zoom in to the objects.
i put two squares in a comp, set up a 50mm camera and zoomed past them. when i added your expression to the squares, however, instead of zooming past them, they went almost directly sideways out of the comp window. i switched off the expression and they came toward the camera again.
any idea what might cause that behaviour?
-
13. Re: Multiplaning without affecting scale due to the Z axis?
Dave LaRonde Nov 15, 2012 9:32 AM (in response to victoriavanpatten)It only takes experienced AE practitioners three times as long to work in 3D than 2D. Chris Meyer, an extremely well-known AE artist, jokes that this truth is the reason why there's a "3" in "3D"
Think about the way the Disney animators created Mickey Mouse cartoons. They stacked cel on top of cel. You can do the same thing by stacking 2D layers, and fake any depth of field issues by adding the proper kind of blur to the appropriate layer.
Who says you have to do this in 3D?
-
14. Re: Multiplaning without affecting scale due to the Z axis?
Rick Gerard Nov 15, 2012 9:51 AM (in response to philament)The expression keeps the items the same apparent size in the frame but it doesn't control position or orientation. The layers went to the side because the camera was not moving directly to their anchor points or the layers were set to orient towards camera. Take a look at the move in the top view or left view and you'll see the camera still moving past the cameras.
The purpose of this kind of an expression is to fake a background not to move in on a layer. With the layer set to orient towards camera and the camera pointed directly at the anchor point of the layer a 3D layer will act like a 2D layer. If you were to use this to create a distant horizon and then put your other 3D elements in the scene you could move around without loosing the background.
I hope that explanation makes sense.
-
15. Re: Multiplaning without affecting scale due to the Z axis?
Cris is Bliss May 28, 2013 10:17 PM (in response to Rick Gerard)I haven't used the expression yet, but shouldn't there be a semi-colon after the r = d/z
-
16. Re: Multiplaning without affecting scale due to the Z axis?
Rick Gerard May 28, 2013 10:53 PM (in response to Cris is Bliss)Cris said "
I haven't used the expression yet, but shouldn't there be a semi-colon after the r = d/z"
and the answer is yes. I typed that expression from scratch so I missed a little punctuation. I also provided a link to an effects preset that contains the expression.
Here it is again. I would highly recommend that you save your expressions as effects presets. Build yourself a library of things that you'll use again and again. It will save you a lot of time. I have more than 200...




