Activity › Forums › Adobe After Effects › Box troubles
-
Box troubles
Posted by Anonymous on October 23, 2005 at 5:03 pmOk I am trying to make a box in afx but i keep getting cracks and the solids keep going through each other.
Can some one give me calculations for that perfect box??
i am using solid sizes 200×200
Thanks for the help
Roach
Mark Moser replied 19 years, 4 months ago 5 Members · 11 Replies -
11 Replies
-
Chris Smith
October 23, 2005 at 7:48 pmMake sure ‘advanced renderer’ is on in your composite settings. The ‘basic renderer’ doesn’t do object occlusion and what not very accurately.
Chris Smith
https://www.sugarfilmproduction.com -
Anonymous
October 23, 2005 at 9:17 pmI have advanced 3d on in the advanced tab in comp settings. But I just can’t get it that perfect:(
Is there some kind of formula that you guys know of??
Thanks
Scott
-
Colin Braley
October 23, 2005 at 10:49 pmI have a quick expression you can apply to a layer to create a box, just make sure that each layer is the same size and is a square layer(use square pixels). Also, for the expression to work the layers that make up the box have to be the first six layers in their comp. It you want to move the box parent the layers to a null or something. If you want other layers to be above it precomp the box, bring it into another 3d cop and turn on the continuously rasterize/collapse transformations switch. Well with that said here are the expressions:
Here is the expression for position:
i = this.index;
if(i == 1){//frontx = thisComp.width/2;
y = thisComp.height/2;
z = 0;}else if(i == 2){//Back
x = thisComp.width/2;
y = thisComp.height/2;
z = this.width;}else if( i == 3){//Left Side
x = thisComp.width/2 – this.width/2;
y = thisComp.height/2;
z = this.width/2;}else if (i == 4){//Right side
x = thisComp.width/2 + this.width/2;
y = thisComp.height/2;
z = this.width/2;}else if(i == 5){//Top
x = thisComp.width/2;
y = thisComp.height/2 – this.width/2;
z= this.width/2;}else if (i == 6){//Bottom
x = thisComp.width/2;
y = thisComp.height/2 + this.width/2;
z= this.width/2;}
[x, y, z]//–
Here is the expression for orientation:
i = index;
if(i == 1){//frontx = 0;
y = 0;
z = 0;}else if(i == 2){//Back
x = 0;
y = 0;
z = 0;}else if( i == 3){//Left Side
x = 0;
y = 90;
z = 0;}else if (i == 4){//Right side
x = 0
y = 90;
z = 0;}else if(i == 5){//Top
x = 90;
y = 0;
z= 0;}else if (i == 6){//Bottom
x = 90;
y = 0;
z= 0;}
[x, y, z]//–
well there you go just apply that to a square ;ayer and duplicate it 6 times.
~Colin
-
Temple16
October 24, 2005 at 3:09 amHi Scott
To make a box that fits together neatly your composition needs to be set to square pixels. Here’s my solution. (it looks long winded, but I just did it as a check before writing the following and it took me about 30 seconds).
1. Create a new composition, any size you like, making sure that square pixels is selected in the pixel aspect ratio dropdown.
2. Create your solid (x200, y200), make it a 3d layer, and position it x0, y0, z-100.
3. Create a null object and make it a 3d layer.
4. Link the solid to the null using the pickwhip.
5. Select both objects and duplicate the pair.
6. Move the duplicates up in the timeline, so that they become layers 1 and 2. (this makes it easier to associate the pairs).
7. Use the pickwhip to link the duplicated solid to the duplicated null. (after duplication the second solid will still be linked to the first null).
8. Open up the rotation props for the second null and rotate 90 degrees.
9. Repeat steps 4 to 8 to create all the sides of your box.
* To rotate the layers into position for the top and bottom use Z orientation.10. Finally create a new null, make it a 3d layer, and link all the other nulls in the comp to this last null. This gives you a central control point to rotate the box around.
Hope this helps.
-
Anonymous
October 24, 2005 at 10:18 amThanks for that expression.
I have a prob. It keeps bringing up an error about global something there is no x
when I begin to parent the null all layers go to the null except for 1.
Any suggestions??
Thanks
Scott -
Anonymous
October 24, 2005 at 10:31 amIt says class global has no property x error at line 41
That pops up when I have 5 solid layers a null and a light on.
Have any ideas??
Scott
-
Colin Braley
October 24, 2005 at 3:41 pmWell you are getting this error because the layers that make the box have to be the topmost layers in the composition. You could place the null below the box layers, and then turn back on the expressions that had the error but I have a better solution:
1 – Make sure you are working in a square pixel comp
2 – Apply the expressions to the layers and make the box
3 – Select All the box layers and press “ee” to bring up all parameters that have expressions applied
4 – Select these parameters and go to Animation > Keyframe Assistaant > convert expression to keyframes
5 – Now parent all your layers to a null, add light(s), camera(s) and you are good to go.~Colin
-
Temple16
October 24, 2005 at 3:52 pmHi Scott
Sometimes expressions are too tricky for their own good. Have a go at the solution in my first post, I’m positive that you’ll find it easier than trying to sort code.
Regards
-
Anonymous
October 24, 2005 at 5:08 pmYeah thats right over looked that!!
Temple thanks for your solution also.
I appreciate everyones help here!!
Scott
-
Mark Moser
April 3, 2007 at 2:46 pmGreat script. I’m having an anchor point issue.
I’ve precomped my cube, added a 3D null as layer 7, and parented the 6 sides (also precomps) to the null.
The null is not in the center of my cube so as I rotate the null, the cube swings rather then spins.
How do I get the null anchor to site perfectly in the center?
side_precomps are 300×300 square px
cube_precomp is 720×480 square px
Reply to this Discussion! Login or Sign Up