- [Evan] Hello everyone, this is Evan Abrams.
And in this After Effects tutorial,
we're gonna be making a fake 3D cylinder using shape layers.
Now why would we fake 3D instead of actually
making something three-dimensional?
Well, there's many reasons.
It could be a stylistic thing.
You want this thin monospaced line going around.
It could be that your piece is just more abstract.
That's what the branding calls for.
But whatever the reason,
the reason I'm making this tutorial
is that someone reached out over at Twitter,
and I was trying to explain this technique
and I was thinking I must have a tutorial about this,
and now we do so problem solved.
Let's start faking 3D with shape layers.
(upbeat music)
In this tutorial we're gonna talk about
how do we make a collection of shapes
look like something it isn't?
That's the big takeaway.
And hopefully by kinda diving into
why we make certain decisions,
this will help you kind of expand beyond
just making this 3D cylinder
into doing all sorts of things with shape layers.
So the basic concept
is we need to go from looking at a circle,
one view of a cylinder,
to looking at a rectangle,
which would be the 90-degree shift of that.
The points in between need to look cylindrical.
This plus this needs to somehow equal cylinder.
So how do we make that happen?
Well, as you can imagine,
we start by making some shapes.
I like to make my shapes by just
double-clicking on the icon up here.
This will make a wonderful shape
for us to play around with.
I'm just gonna fill it with white
and I'm just using these colors
so you can kinda see what we're doing.
I like to make shapes by double-clicking up here
and then dialing in kinda the sizes I'm interested in.
You can make shapes by just grabbing and clicking,
dragging and moving the anchor point.
But doing it, this double-clicking method,
make sure everything is lined up
and where we expect it to be.
A lot of times I get questions about
why is mine not behaving like yours?
A lot of the times this is the reason,
because anchor points and groupings
are all out of whack.
And specifically in this tutorial,
we're gonna dive in to some of the hierarchies
that are inside of shape layers and what those mean.
So hold on to your butts.
So we've created this square,
this 400 by 400 square.
This is gonna serve as the middle of our cylinder.
This would be the sides,
and when we're looking at the face,
this will be collapsed down to nothing.
So we're also gonna need some circles.
So we're gonna make the ellipse tool here,
double click, same thing as we did last time.
Twirl down to the Contents into the Ellipse.
You can notice right away we've got Contents,
a group, and then a bunch of things inside that group.
Each layer has a Transform of the layer
and a Transform of that group.
This will be important later.
So this Ellipse Path we're just gonna make that 400 by 400.
One thing that we need to change about this circle here
is that it should always hang out
on the edge of this rectangle.
This should always hang out here.
So even if we resize,
then this end piece should always hang out over there.
So I'm gonna twirl open the Rectangle Path,
we're gonna have a look at the size here.
And we need to effect a position of this layer.
So we could change the layer's position,
we could change the position in here,
we could change the position here.
We have three positions to choose from.
You could apply this to any of them,
get a similar result.
I'm going to stick it here
on this Transform: Ellipse 1,
which is the transformation of the group Ellipse 1.
So let's set up a relationship here.
Let's call around and find people with common interest
and trick them into having
an awkward dinner with each other.
No, we're just gonna take a look at this position
and we're gonna hold down Alt and click on its stopwatch.
Now we're gonna type something in.
I'm gonna type d equals,
and you could write variable d equals
if you wanna get real particular about it.
Then I'm gonna pick whip to this part of the size,
only this one part, only the horizontal part.
Then I hit a semicolon to end the line.
And now we're gonna type out
what we want the end result of this to be,
a couple of closed braces,
and inside we are gonna go d
divided by two, zero.
This is thing comma thing
so our output needs to be thing comma thing.
And wouldn't you know it, that does it.
So half of 400 is 200,
and this is gonna get bumped 200 pixels over
and that's where it's gonna live.
So if I go ahead and start messing with this,
whoa, so let's rename this top,
let's duplicate it and rename this Bottom,
and the Bottom of course should live under the Middle.
And we need to go in here into the Contents.
I'm just gonna hit E twice to call up
its little expression here,
and I'm gonna change this two to a negative two
which will send it over there.
Let me just double check what's going on.
Oh yeah when I change the size of this,
those two circles are moving along.
We've rigged up this cylinder, good for us.
We need to make these things squish themselves.
So the Top and the Bottom, I'm just gonna hit U U
and call up their things and collapse the Middle
so we don't have to look at that.
I think their sizes should be linked to each other.
So I'm gonna just linked the path size of this
to the path size of that.
But the big thing we're interested in doing
is effecting their Transform.
So we've got Transform Position doing something.
Let's talk about your Transform: Ellipse 1 Scale.
So I'm gonna call up that for either of them.
There we go.
And I'm gonna link the Bottom Scale to the Top
because they should always be the same.
These two should always be linked together
at least in this example.
So now we can do like this.
And we've encountered our first little whoopsie, right?
So we don't want this to be happening
where the stroke is getting all pinched in here.
That's not what we want at all.
What we need is for the Stroke to maintain
its full 10-point thickness all the way around.
So what I'm gonna do is just grab both of these
and pull them outside of the group
and then stack it so the group is on top
so that everything up here happens first.
So we've got the Ellipse,
we got its Path, little path information,
then we're transforming that path
and then we apply a Stroke and a Fill to it.
So that's the big difference,
and you can see them next to each other, right?
This is after, this is before.
So again you would take these
and just plump them outside,
make sure it's stacked up correctly,
and you end up with this result.
So that's cool but now we have another problem.
This and this should be the same thing.
If this is really the bottom,
these should be merged together.
How do we make that happen?
Find out a way to merge some paths together.
What am I thinking of merging these paths?
Well, we're gonna do exactly what the word suggests,
we're gonna take this path information and move it in here.
I'm just gonna do that by adding a rectangle
and I'm gonna push that rectangle above here
and twirl into the rectangle
and I'm gonna twirl into this rectangle,
close down these.
And I'm just gonna link the size of this
to the size of that Middle piece, cool.
So what does that mean?
Well, if I solo this Bottom,
which is now really Bottom plus Middle
'cause we've combined the two onto one shape layer,
that this and this can now be added together
by adding a Merge Paths.
Ooh, look at this, we merged those paths.
So this rectangle plus this group and this group
has an ellipse path that is being transformed
are then merged together.
So we don't really need to look at the Middle here,
I'll just make this orange.
But I like to keep them separate
just in case I need to link things to them
or use them for something else.
I'm fine to leave these as controllers.
They don't take up a lot of resources.
So let's animate this thing.
Let's make this move.
So what is actually gonna be animated about this?
Well, the size is gonna be animated.
This tube needs to get longer and shorter
as we rotate around.
And this Scale,
this Transform: Ellipse 1 Scale
needs to be changed.
So let's just set this to be like 50%,
and let's call this, I don't know, 350 maybe.
I'm not sure, we're not sure about the values yet.
Let's say this is gonna be a middle point,
and so we go ahead 10 frames
holding Shift hitting Page Down,
and we'll say this is gonna be at zero,
this Middle here maybe 300,
it's gonna get narrower
because its silhouette,
its profile here has to get narrower
as it kinda closes down like this.
So we can try to figure out
what that actually is,
what that value should be
so that this actually makes a little bit of sense.
Say we're going like that.
I think that looks okay.
Maybe bigger, smaller.
Tough to say, you might need to massage that.
But then we can go back in the other direction and say,
well, I'm gonna put this to 100
and I'm gonna put this to zero.
And so it's the relationship between these keyframes
that makes the cylinder feel believable.
So this and this, you can't really go direct between them.
If you were to do that, then you would go from here to here,
and that looks kind of weird, right?
It's like a weird little shape morph happening.
There has to be an intermediate keyframe
where this gets wider,
or you need to accelerate
past this awkward moment
so that you don't notice it.
So now that we've kind of established these keyframes,
we can take these at the start, ease them,
take these at the end and ease them.
If we ease the ones in the middle,
it creates kind of a pause, right?
It's like I'm gonna stop here
and then I'm gonna stop here.
So instead I hold down Command
or Control for you Windows folk,
and then I click on this keyframe, turn them into linear,
click on it again and turn them into Auto Bezier
which makes, I think there's a little smooth action going.
Ah smooth.
And there you have it.
We are now spinning around on this axis.
How fun is that.
Now if you wanna take it a step further
and spin it on another axis,
you could make a new Null Object
and then parent everything to that null,
and then you're fine to rotate this around, whee!
Now it can spin on that axis.
So that's two axes taken care of.
But what about rolling?
What if we want this to rotate on the third axis?
How would we kinda make that happen?
Having axes to sticking things on the top here
like the face of a coin would really sell that.
And we can just cram things into this group
and make that happen.
So I could just go ahead and add another group inside,
ooh, adding groups, groups within groups,
layers within layers.
Inside this group, I don't know,
let's add a rectangle, let's say.
This is just an example.
You can do whatever you want.
So we're gonna add this rectangle in here
and we're gonna go ahead and make it a little bit bigger.
And then if we want this to rotate,
we're gonna transform that group.
So let's call this, maybe this group is like the Insert.
Insert, that's not how you spell.
We can go in here and we can start to rotate this.
And look what happens.
The rotation is applied to what's inside this group,
and then the squishing,
that scaling happens to everything in this group,
and then we've got the Stroke and the Fill.
If you wanted, have this be a different color
or be a totally different thing,
you would have to break that outside
of what's going on in here.
If you wanted to, say,
stick a totally different layer
on the outside here,
maybe a text layer, let's say,
let's stick some text in there.
So I'm just gonna make an E.
Ooh interesting.
I'm gonna go to Character here
and make it a little bit smaller.
All right I'm gonna hit Y.
Stick this anchor point
right in the middle center of that E.
And I want the E to behave
like it's meant to be stuck there.
Well, that means I have to mess
with this thing's scale I suppose.
So what will we do?
I'll open the Scale of that
and we will link this to that.
Ooh look at that, it's like it belongs.
Now we need to also mess with this position,
but first let's parent it to the null,
and then we'll go into here
to Transform position of this ellipse.
And so we'll parent this to that.
And now when we play this back,
would you look at that,
it's like the E belongs right there
just by parenting things
to the various attributes
that are actually changing.
Oh pretty nice.
So if we want that E to rotate,
I would recommend precomposing it.
So I'm gonna go ahead and precompose,
and let's call this, I don't know, Face.
And it's gonna break a bunch of things,
it's gonna break all of the wonderful work
that we did in here
'cause these are no longer valid things.
But let's go ahead and just stick this in the middle
and go to the position here,
and we'll just rotate it a little but.
I'm just gonna rotate it 45 degrees or something.
Now when we go back out here,
we need this to be positioned here,
and we would want this to be scaling along with this here.
So we would link those together
and positioning itself along like so,
but that'll only work
if this is parented to the null, babam!
And so as you can see,
if we rotate things,
maybe we just set a couple keyframes
for this thing's rotation.
Yep, now we can enjoy that rotating
so long as we remove those keyframes.
And you can see it has been squished to fit.
Not too shabby I would say.
And that is pretty much how you would make this happen.
Thank you so much for watching.
If you've enjoyed learning about motion design,
learning about After Effects,
then please subscribe to this channel,
and make sure you turn on Notifications
so you're actually notified when a tutorial goes up.
Pretty crazy how that works.
If you have any questions about this technique,
please let me know in the comments.
I'll try to get you through.
If you'd like to get your hands
on the project file we made for this tutorial,
then head on over to evanabrams.com, pick that up
link in the description, link in the cards.
If there are other topics you'd like to hear me cover,
the please tweet at me, leave me a comment,
send me an email.
I'm Evan Abrams.
Thank you so much for watching
and I'll see you around the internet.