hello everyone this is evan abrams and in this tutorial we're going to take this grid of
layers and make them react to a single layer this is handy in something like fui where you
want to show something is getting selected or highlighted it can be nice in explainer videos
to convey some visual metaphors perhaps imagine how terrible it would be if we had to animate all
these things manually certainly we want to avoid doing more work than we have to that's why people
come to this channel right we're going to look at how we might do this with expressions inside
of after effects then we're going to look at how we might use some third-party plugins to achieve
this kind of thing and then finally we're going to see how this might be handled with cinema 4d lite
so watch out for that i'm glad you've selected to watch this tutorial and i hope that you
react favorably to it since those are two truly bad word jokes it's time to get started this
video is brought to you by skillshare make 2020 a year where you explore new skills deepen existing
passions and get lost in creativity with skillshare's online classes skillshare is an
online learning community that offers membership with meaning so much to explore real projects to
create and the support of fellow creative skillshare empowers you to accomplish real
growth skillshare offers classes designed for real life so you can move your creative journey
forward without putting your life on hold you can learn and grow short classes that fit your busy
routine if you're watching this channel you'll likely enjoy their classes on animation like this
excellent course from russ etheridge in 3d for 2d animators colon getting started in cinema 4d
russ really breaks down the basics in a very excellent way if you're currently looking for how
to bring 3d elements into your workflow check out this course i think it'll help you make that jump
that'll really elevate your works skillshare is also incredibly affordable especially
when compared to pricey in-person classes and workshops an annual subscription is less than 10
a month and members get unlimited access to thousands of inspiring classes with hands-on
projects and feedback from a community of millions and as a little bonus the first thousand people
who use the link in the description will get a free trial of skillshare's premium membership
first up we're going to keep it all vanilla out of the box after effects and if we're talking
about making one thing respond to another thing we should probably start thinking about expressions
expressions at the most basic level simply describe the relationship between two properties
i've already made this grid of layers and you can see that these could be
anything at all any layer you want is fine and the property i'm going to modify about them is
scale so that when this cursor looking buddy comes along they're going to get larger when
they're hovered over or when the cursor is near them so on all of their scales i've put this
many-lined expression many of these lines are just variables linking these properties
to slider controls so i can change all of them at once for all of the layers anytime you're looking
at applying the same expression to many layers consider slider controls for your variables
that's going to give you flexibility later on but let's break down what we're seeing here
and how the logic works so you can incorporate this kind of thinking into your projects this
whole thing hinges on the use of linear linear is remapping the values from an input range to an
output range so in this case it's evaluating this first variable d which in this case is the length
between two points and these points are where that null is at and where this layer itself is at
so as d changes from what we've called the hit out to the hit in variable after these two
sliders here those are going to define what we might otherwise call a hit box how close and how
far do we start caring about these two things coming into contact with each other so linear
is going to remap those to our scale from scale 2 variables when we are 100 pixels or above
away when these things are are far apart from each other the output number is going to be 25 and when
we're at 0 pixels close right on top of it we're going to be at a hundred and in between that means
we're going to be somewhere in between this last line here is using that variable r in both parts
of the scale so that it scales uniformly scale needs to be in two parts like this or it gets
confused and we don't want to confuse a computer they don't like that but when we push this out
to all the layers and waggle the null around you can see the response if we extend that hit
box we make that that upper bound larger we can affect more layers depending on how we dial it in
and we could have them scale up we could have them scaled down really depends on what you do
with these variables now there are a few trouble spots in here every layer is evaluating the stuff
on every frame so this can grind your machine if you get many many many many many layers going and
the hitboxes are circles that one might not be a bummer for you but if you had a grid of light say
and you wanted them to turn on or off as something moved over them and you had these
little gaps in between caused by circular hitboxes on square layers that wouldn't do it all would it
so the expression changes just a little if we want rectangular hitboxes in particular i want
to get the size of the layer in play here and we need to measure two lengths by breaking down the
horizontal and vertical lengths we take the first part and the second part respectively that's the
little zero and one in the square brackets here mean here is where things get a little
wacky depending on what you want to do with this new information and how you want these things to
behave in this case i'm interested in two states when the null enters that hitbox and then any
other time that's what this if else is all about if the horizontal length from the null to the
layer is less than half of the horizontal size of the layer and the vertical length from the null to
the layer is less than half of the vertical length of that box or in more simple terms when the null
is over top of the box we're going to do this and that chunk says just scale down to zero just
get out of here otherwise else let's leave the r value at 100 so it'll be 100 of 100 scale or just
normal obviously we could code all kinds of things with these components but i think looking at these
you've got to be saying there has to be a simpler way well this is a problem that many have pondered
for a while it's a classic issue so as you can imagine there are several third-party plugins that
try to solve this very problem with varying levels of success creating arrays and manipulating them
is very well trod territory for example here's cloners and effectors by crunchy let me take a
shot at it and then we got moglyph fx by fremix that's another but using glyphs specifically so
another kind of methodology to get you there and then we have easy clones 2 by mw motion
this is the third one we can get some clones and propagate changes through those clones so if you
want a third party solution there are options but i want to show you something maybe a methodology
that is more common and maybe you've already got something installed that can do this having many
many things and manipulating them as a group is something very easily done with a particle system
there are of course many many many third-party particle systems you might enjoy so if we want a
grid of things we can scale up and down we just need to fire up our persistent particle system
of choice here we have an example using form by trap code from red giant i'm using form to create
this array that is 500 pixels large and i've just asked to put 10 horizontal by 10 vertical
by one deep in that space i can change these to be a sprite in this case this is a square and then i
want to change or impact these particles which we commonly do with something called a map this
is going to take visual information and map it onto this system so here is a layer that itself
is 500 by 500 pixels and i'm putting a circle on there using the circle effect we're going to set
this to normal so that we are drawing the circle on the black solid i'm going to feather it out a
little bit change the size maybe and we'll use the position here to select which particles we want to
be different this layer has black pixels and then white pixels and this is going to be the map that
we use to make form do something so if in form we go into layer maps we're going to go down to size
here and we're going to choose what plane we want to map this over for us that's going to be the x
y the horizontal and vertical and then we choose which layer we want after effects to use and we're
going to say use it after masks and effects have been applied so now that black and white info is
going to be making things larger or smaller so now we just need to change the map in order to change
these particles if stuff is getting too large too small then we need to dial in the values
of the map so maybe we use a curves on here to adjust this layer a little bit but applying a map
to particle systems is hopefully a fairly common method you can use to solve this problem
we can apply the same idea in plexus for example as you can see they have a layer map feature
and it is a form of particle system so the options will be found in different places maybe they'll
have different names but in your persistent particle system of choice if you have access
to a method where you can manually control the particles in this way you're going to be all good
but wait there's more included with after effects is something called cinema 4d lite cinema 4d is
uniquely suited to solve this very problem so to fire that up we're going to make a new comp and
we're going to right click in here and say new cinema 4d light file so here in cinema 4d lite
we have access to some of the tools but not all of the tools i'm going to start by making a cube
and then thinning it out on the z-axis now i need more cubes we could just make a heap of cubes
duplicating moving them around i'm going to make instances sadly we don't have access to a grid
array of some kind in here so i'm just making instances of the cube and moving them around
an instance is a copy that just references the original so if i change that original shape then
everything else is going to change along with it but these could be anything lots and lots of
anythings that we put out here and then i'm going to take all of those things and i'm going to put
them in a fracture object which doesn't break things apart like a window as you might imagine
but it's going to let us mess with all of the parts and interact with it as a system so now
we want to mess with the system we want to affect it with an effector so here's
an effector called the plane effector this is a pretty common term you're going to hear
plane effector we're basically going to change something about all the little bits let's say
we want to change all the bits to scale them down so we just go into our plane effector we affect
the scale and now all the bits are being affected now we want to choose which of the bits are being
affected by this effector so to do that we're going to go into falloff and add a field in here
and we're going to make mine spherical a spherical field please and now only where we see the sphere
intersect with the bits are we going to see that plane effector take hold to do something to them
so we have a group of things we have a change we want to do to them and then we choose which of
the things and how they're going to be impacted we could invert this relationship we could move
around the field we could grow it or shrink it we could do so many so many lovely things
even in this light version of cinema 4d we've now accomplished the exact thing that we set out to do
if we want to push this back in after effects you can see that the cineware effect is rendering this
thing very nicely looks just like it did in the viewport probably want to refine this a little
bit so in cinema 4d light we will add a camera i'm going to make mine parallel so that it has
no perspective to it so it's totally flat and then we'll just set that up right here where i want it
i'm going to add the vibrate tag to that spherical field which is like adding the wiggle expression
to something in after effects so now we have some motion going around now if you had access to the
full version of cinema 4d you can make arrays of clones much much easier using the mograph cloner
it takes far fewer steps to create arrays and more advanced arrays and different fields different
effectors so many more options it is endless but you know what isn't endless this tutorial because
we're here at the end we've done the same thing so many different ways with varying
degrees of complexity fidelity different programs different programming so hopefully it's been fun
if this is the kind of thing you like to learn and i really can't imagine why you wouldn't want
a video showing you the same thing four different ways but if this is for you then make sure you
subscribe and turn on notifications so you don't miss the tutorials when they come out there's new
stuff happening here all the time and would love to know what methods you use to achieve this kind
of thing if you're doing something different if you have any questions about anything you see
on this channel let me know in the comments and i'll try to help you out as best i can
if you make something cool with this and i'm sure you will i would love to see it
tweet it at me or tag me on instagram i'm at eca brooms on all those places i'm actually at eca
from spring place you look if you like this kind of thing but you'd like it to be uh longer and
less structured and live then come hang out with me on twitch and behance i'm maddie sieben over
there as well as i said and we're streaming every weekend anyway that'll do it for me thank you so
much for watching be kind to each other stay creative and i'll see you around the internet