Complex Environment Movement in After Effects

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
to be able to do environment animation you need to understand the connection between all the elements within your scene usually there's a single force a character running through the scene or an explosion or wind that affects everything similarly but not equally in After Effects there really isn't a way to stimulate this however there is a high-level concept that you can connect everything to one layer one effect one variable and this concept is something I like to call the global variable we're gonna use expressions connect everything to one layer of animation and get ourselves a simulated environment [Music] his artwork is by Ross Tran it depicts NEMA character he's been developing for some time he's a fellow youtuber if you haven't seen his work go check it out it's it's entertaining and beautiful alright let's get into how to think about your environment in terms of a global variable looking at the artwork we could really see that the wind is going from right to left based on the hair flowing upward and the cloth flowing upward as well but that's not enough for us to understand where it's flowing in between each of these elements and to make this easier to see I'm just gonna add a white layer above everything and start drawing oh and yes I am gonna do on the screen the biggest most important flow of the wind I would say is in between Lima and the foreground elements so it looks something like this coming from right to left and then flowing upwards so this movement is probably the most visible the most important of wind and but to add interest to this we want to see what happens to the wind when it goes behind nema and also what happens over here because of the hair picking up there's two things that are happening here one it's flowing and then kind of going across behind and then meeting back up with this other flow that's happening but the other one is that I feel that because it's gusts of wind is so powerful and I'm picking up these elements that there is actually some push up here and kind of doing this clockwise animation pulling all these elements up and this makes this so much more interesting of a flow because it means that we could have elements mimic this movement to simulate what this wind would actually do along with this we have my cherry blossom up here at the top and petals are going to be dropping off and joining these you know gusts or these flows of wind so something like dropping down and then picking up by these these elements something like this when you see the petals drop down and it's carried by this path the I will pick that up and understand that there's just a wind flowing in this and it feels almost natural to see that happen I think that this is feeling really great there's so much movement here but there's nothing happening over here and there really should be since the artwork itself is asymmetrical really heavy on the right and nothing was happening unloved so along with this this pickup and this curling we can introduce the same thing over here since there's so much space to do this so while this stuff flows we could introduce another set of particles that flow from here follow this line and then curl upward and then eventually make its way you know back out of the scene now I realize that this could seem a bit complex but really the takeaway here is that the wind is moving from right to left and when it does that and it interacts with elements in your scene something new happens something changes and creates this turbulence in the air that makes for a visually interesting movement now something to consider while wind is flowing through is what is happening in position to the flow of the wind we have grass down here and the grass that's beneath this wind wants to follow where the wind goes and to do that it would have to rotate towards the direction it's heading so it needs to rotate this way counterclockwise for any elements that are beneath the wind but elements above it like these leaves you know all this stuff you know any of these vines that are up here these have to rotate clockwise just like the hair because it is being picked up from underneath I with with that out of the way let's get into After Effects and start animating okay I've already gone through and broke up all the assets imported them into After Effects and set it up in a way that makes sense for me now I'm gonna cover the concept around environment animation I'm not going to get into the nitty-gritty of the individual steps I think if you understand the concept then you could apply this to whatever artwork you have I've also already gone through and animated nema here her hair her cloth and the little tassels that she has if you're interested in how to do this I already made another tutorial on hair animation that covers this exact same topic so the first step here that we need to do is create our global variable the the one value that is going to be applied to everything our wind value what I tend to do is look for the one item the one thing in the scene that I believe is the most important or the most eye-catching and for me in this scenario it's I believe it's her hair I think her hair is basically the start of the show so that is what I'm going to use to be able to generate or create my global variable animation this already has you know the hair animation and the pickup and drop off from the wind so we're gonna create that from scratch and then I'm gonna show you how to connect up with that what I have here is a null and then a pre rendered image sequence of the hair that I've already animated just looking at the hair you can see that the animation is flowing but it's not being picked up or jumping off so we're gonna create this by using its rotation when animating this what I like to do is do an up down and then up even higher down slightly and then back to the normal spot this is a very typical way of animating if you're an animator you usually have variants in your movement so going right into it I'm gonna use my initial hair movement here and use that as my guide for how I want the rotation to happen click my rotation value here and go forward and just start literally just animating this so I'm gonna move this slightly up you know that's gonna come down and then pick back up again and it's gonna kind of get to this point and drop down slightly rates and keep on going down a little bit more and then now it's gonna pick up over here so so we got so far goes down he's gonna pick back up down and then I want this next up to be like a really far up mmm cool down moves up I think this move up is too much they're kind of down and they go all the way up and I think that this could last longer and then eventually drop back down all and then go back to where it needs to be now if I go to the graph editor for this you'll see he's like this is like my terrible looking curve but this is exactly the values that I need to be able to create this global variable so I'm gonna go ahead and soften everything up just a few things here I could tell that this is not this is a bit too crazy here I'm gonna move all of these values down all right over there another key here and really like what I'm trying to get is you know it goes up slightly it goes back down and it goes down probably the furthest a will ever go down here and then make its way back up again it was key don't need it something like this so let's see what this looks like so it drops down picks up and that pick up is a little early drops down picks back up goes down a little bit and it goes all the way up now this all the way up could be even more and more intense drops down picks up goes down it picks up a lot then drops down again back to normal okay okay this should do it we could keep these animated keys here but personally I like to take these values and put it into a slider this to me is cleaner because I know that I'm gonna be connecting a lot of values to this same slider over and over again rather than the rotation of the hair so I'm gonna go how to make a new null okay and I'll call this you know maybe global variable and then add a expression slider on it and then cut and paste the rotation values to the slider there we go I'm gonna move the null out of the way and let's change the slider to wind so obviously there's no it's not attached so we have to attach this this these values back to the hair or the oil that I haven't connected to so I'm gonna do is just get this pig whip and select that slider and now it has that rotation back on it yeah alright so we have a global variable and a wind slider but how exactly does that affect everything in the same well first we'll open up a few items a few layers and apply those values directly to those layers through expressions once we're happy with that then we'll apply it to the rest of the scene and get our simulated environment back in after effects have gone through and adjusted the curve that was here before I just wanted to smooth that out just a bit more because we're dealing with wind here and I also added in a loop so I loop from before and after through expressions nothing super complex but I'm using basically loop in and we bout with an if statement that way the value of this will just loop indefinitely before and after with these values all set I've also introduced a few new layers these layers are the ones that I want to animate first before moving into the rest of the scene here it's a vine you know some leaves and a shred of grass and I've purposely chosen these three because one starts all the way to the right one starts kind of in the center and the last one is towards the end that way we could see how the wind hits this element first then this second and then third it is kind of hard to see all this so what I'll do is I'll reveal everything and then add a white layer underneath those layers that we're gonna be working with that way we'll just be easier to see and let's drop the opacity let's start with this first one this first element which is the vine I've moved the Anchor Point to the bottom because we're going to use the global variable values to be able to animate this back and forth so let's get right into it I'm gonna go ahead and alt-click the rotation so that we enable the expressions here and then I'm gonna go ahead and pick whip the wind variable that we created if we just let this play so it's pushing it really far to the left and I believe it's going the opposite direction that we need when I write expressions I tend to like to give variables to everything that way it's easier to read what's happening this is our wind or global variable though I'm gonna go ahead and call this force you could name this whatever you want but I prefer to just give it a simple name force and we have dropped this down here in force right now the rotation is added to it so if I if I turn this off you can see that there is a negative 7.3 here that's from our animation it but default the first key is actually 7.3 so we need to remove that first so that when we add this expression it doesn't automatically rotate this vine we have force as our value but then let's add another one what's called offset and offset is gonna be basically the offset that turns the value from the starting point to zero that way anything that we animate we won't affect the initial position or rotation of our layer so we know that it's negative seven point three one we're going to subtract offset to our force so upset well we do this notice that this has gone back to zero and if I turn this off and on the rotation here does not change because we have effectively removed the initial value from our wood all right we need the value of this wind to go the right direction when the hair drops down that means that the wind has loosened up but it's not as powerful anymore it's not picking up our hair and because of that that means that our animation our vine here should be going to the right not to the left so we need to go ahead and add a value that would make it go the opposite direction I personally like to use amp or amplify this is how I would use the power of our wind and multiply it to amplify how how strong our wood should be so here I'm just gonna multiply it by negative one which means it will shoot it the other direction and I'm gonna go ahead and put parentheses around the force and offset so that it doesn't affect it doesn't multiply just one of these values and multiplies both of these after the offset has been calculated so they're times okay so notice that it is shooting it the other direction which is exactly what we want we want the wind when it loosens up for the wind to go to the right and when it's blowing really hard then it's going to the left so over here it's going to the left because the wind is picking this up that looks right to me and I've already tell that the wind the power of the wind is too strong for our vine so let's go ahead and instead of making this negative one just make this negative 0.4 it's gonna take 40% of the value of our overall wind value and apply it to our vine here okay so it is pushing to the right to left and then goes back up I think this is a good amount of power the amount of wind that's affecting this vine last thing I want to do is make it so that the vine gets hit by the wind before the hair to do this we need to introduce a new variable and a new way of grabbing the value horse is our global variable and that's the value that we're taking from but I don't want the value of where it is currently in the time head I want it out of an earlier time so how you write this as you put a period and put value at time and then parentheses and inside of the parentheses you tell after-effects through expressions where you want to grab the value from if I were to just put time then this would be the exact same as just force by itself but because we are able to control where we want this value I'm gonna add in a new value here plus and then puts point to actually it was put point five this means I want the value of wherever the playhead is plus a half a second ahead so what you'll see is that the vine moves first to the right and then the hair moves down because it's being affected you know I'll have a second earlier and then it moves back and then the hair gets picked up so this is doing what we want but I think that this is a bit too early so let's change this value and actually give it a very important I personally like to call this delay and we will make it point two so this will increase the time by point two it's also close to stuff all right that's looking pretty good it's going to play this is great you can see that the vine is being affected first and then the hair just right after it all right moving forward this is like the special sauce this has everything that we need to make the rest of the scene work for us the first four lines are what we're gonna change the most often in this expression the bottom most of the line the force dot a value at time you know that that entire line is like the calculation of all of our variables above so as we take this expression we could copy and paste it put it into any property that we want and we'll just continue to change the variables up top to give us a customization we need per property I'm going to go ahead and copy this and paste it on our last item which is the grass notice that I've already put the anchor point at the bottom I'm gonna go to the rotation alt click it paste but this time I want to change the delay to not be ahead of time but be behind in time so I'm gonna make it negative point seven instead and see how this looks okay this is looking pretty great the only things that the power of this needs to be increased I think point four works well for this first one just because it's a bigger item but this last grass piece it's delayed quite a bit and it just needs to be more amplified and to do this I'll just go in here and change this to let's say point eight so we've doubled the the value of the grass and I want to change the delay to let's say negative 0.6 so it's not as delayed as before this is looking great now let's apply it to the blue leaf that's more centered and this one's gonna be a little bit different than the other two because with rotation you're dealing with essentially one value or single value and in position we're gonna be dealing with two values that's represented by the X and the y and there's a different way that we have to write this for values like this so I will go ahead and hit pace here and if I were just just to let this go it won't work because it doesn't know what the other value is it believes that we're only trying to turn this equation into a singular value rather than two what I mean by that is when you're dealing with position or anything that has multiple values you need to account for both values and both values are represented by these brackets with a comma in between the values so this represents X if that represents one you need to have values for this so for instance if I were to put 0 0 here and let this calculate it would work and turn both my values to 0 0 and because of this we need to introduce two values for every single one of these values that we have introduced up here so for this offset I'll go ahead and add the brackets the comma and I'm gonna copy and paste this that is the exact same value for both of the x and y values for amplified do the exact same thing so copy paste here there we go but that's not all if we were to let this go it still doesn't know how to deal with this because our equation here needs to be able to handle dual or double values because we've introduced these double values like this we need to account for them here so I'm gonna split this up into two values of their own I'll call this temple X and for temp X what we're trying to do is calculate what the x value will be only there's a way to access each of these values since there's two values here there's a way to access just the X values and let them calculate on their own looking at this line of code down here the zero zero this represents the X like we said before the x position and this represents the Y position but another way to access you know these positions is actually using numbers to illustrate this I'm gonna go ahead and grab one of these values up here let's go ahead and grab it in and I'm gonna go ahead and comment this out so this one doesn't calculate this double forward slash doesn't allow for a prefix to calculate this and I'm gonna go ahead and put brackets and put a number inside of the brackets having amp be next to these brackets is telling aftereffects that I am looking for a specific value within amp and the value positions in here are through numbers so the first position is actually represented by 0 so if I were to copy this and paste this in here and here I'm telling after-effects to only use the first value here 0.8 and let me change this so it's easier to read this I'm gonna make this negative point 3 I am telling after-effects to only use amps first value for both the X and the y position now if I were to let this do it that both the X and the y are gonna this first position because of this but if I were to change this to the next position which is one moves over to one one then it's only good as to take the values from the second position which is negative 0.8 so it is giving me back negative point-eight for both x and y if I had even more values in here let's say I have like one four seven if I had all these values I can tell after-effects to take any of these values based on what number I put in here so let's say I want to grab this for over here then the position that that is let's see 0 1 2 3 is 3 so if I put 3 and 3 then I should get back 4 so this represents the position with that as a position I'm going to go ahead and kill this and now come back here with understanding position we can tell after-effects how to find what position for X and for y with delay we want the x position which in this case is just 0 and then with offset same thing 0 amplify and it's 0 and this should give us our x value but what we need is the Y value as well so I'm going to go ahead and copy this paste it beneath turn this to our Y value and then change every single one of these numbers to the second position which happens to be 1 then the last thing we need to do is tell after-effects that I want to use the temp x for the exposition and temp life or the Y position so I'm going to put in my brackets and I'm gonna place in here 10 x + 10 Y with this you can see that the values work there's no errors are produced the layer is all the way up here because there's one last step that we're missing in this which is to riad these values if I turn this off you can see these values here we need to re add these back to the leaf and to do this it's pretty simple we're just gonna come over here for it value plus the rest there we go now we have ourselves an animated well-connected working leaf animation here we can see our movement right now obviously these numbers I have placed here we're kind of arbitrary and we should use the right values the key thing that we need to do here is have this leaf animate in between these two so the one's gonna hit the vine first and then the leaf second and the grass last so let's get a value that's in between that and then adjust the amplitude values so looking at the amplitude values I'm going to remove all the extra values so that we only have the two that we're working with and for amplify I actually want the x position to be more amplified than the Y let's go ahead and change this to one for now and then for the Y position I actually want this to be a positive so that it's moving downward when the wind picks up and I'll put this to like point two and then for the delay negative six is where the grass is currently so let's make this maybe negative three and see what we get I like how this turned out the vine is moving first then the blue leaves and then the grass and I think there's one more thing that I'd like to adjust which is the rotation of the blue leaves so it looks like the wind is turning it over slightly I'm just gonna grab what was previously there for the grass and then use similar values for rotation for the blue leaves so leaves both click the rotation paste the expression and then change the delay to be closer to the delay that we see for the position but I'm gonna make it slightly more of a delay and then last I'm going to drop actually I think that this this will work let's let's see this in action [Music] all right there rotations part of it and this is perfect this is exactly what I'm looking for and I think we've nailed the three elements in here I wanted to jump into particle creation and how the global variable is gonna affect particles within your scene here I'm using particular it's my particle system of choice I've already gone through and animated the particles it's a very simple animation here I have a few particles being created from the beginning starting off with only four particles at a time and then dying out over the course of this looping animation what we need here is for the wind to react to these particles so it looks like it's in the scene and right now there is some interesting movement but there isn't that interplay with the wind itself and it's relatively simple to connect these just like the other ones we're gonna go ahead and add the expressions directly to this effect to do this I'm going to go to our grass layer and reveal our expressions and grab this expression from from here and then go to this layer that has the effect on it and find my wind variable inside of here particular already has an x and y wind so it's kind of doing some of the work for us but we're gonna have to incorporate our expression in here so we can see that react let's go ahead and alt-click the wind X and then pace the expressions into here I know that the wind that we want here is pretty powerful we want this to really react since it is floating items with literally in the wind so to do this let's go ahead and increase the amplitude and remove the delay making it so that there's no delay here so I'm gonna put the delay to zero and then I'm gonna change the amplitude to I still believe it's a negative number let's go ahead and put it to negative let's say negative plugin and the other thing since we didn't add this before I want to make sure that this also has the values that I've already predefined here so I'm just gonna add you back to it let's see what we get yes oh man yeah so it's picking up it's slowing down it's speeding up like that this is all happening within these particles this is the type of look that we need for this to feel like a entire environment everything is being affected by this wind this is what we're looking for from these particles but I want the blossoms to also fall a bit more as if the wind isn't carrying it and gravity is taking over so to do this I'm gonna go ahead and grab this expression go to the wind Y and hit paste in this one I'm gonna I'm gonna drop down the amount here to say five for now and see how this looks this means that the wind is gonna really push it down in in this process all right it's pretty obvious that's pushing it down just a bit too much so let me switch this back to let's put it to two instead and see how this turns out all right this is feeling pretty nice I think this is a good a good starting point for the particles now to make these feel like there's finesse to them of course we're gonna have to add a few more particle systems and manipulate how the loop is animating here as well as maybe introducing like a an animated path to get the curling that we want from the end but this is essentially applying the global variable to everything because everything is connected everything is in you know a baked animation afterwards we could adjust everything on the fly I can't tell you how powerful how important this is in production when by the end of your animation you realize that something was wrong and you have to go back and reanimate all of your layers maybe you need something to speed up or slow down you know this will all be handled within this one global variable that was created and and to illustrate this I'm gonna go ahead and open up the global variable and show you what this looks like if we were to adjust this curve now after the fact everything is dynamic so that means that if I were to come to any of these values and adjusted we should see this update across all these elements so let's say I want is to be more amplified notice how everything is being adjusted all together that's the beauty of this this global variable this has saved me so much time in my own production and so with the setup although it does take more time to get it up and running and going you can depend on this setup to save you time later on you're probably wondering by now do I really have to put this expression on every single layer inside of my composition to get this animated environment well the short answer is yes and it does take time at least that's what I would normally say so it's taking me some time to get this video out because I've been in development of a new script that will solve this problem with the ease of clicking one button boom everything is connected to your local variable and I'm excited to show it so let me get into what this script has to offer and oh it's also free and it will be linked in the description down below full disclosure I wasn't originally planning on releasing this to the public I was developing this for my own needs and you know as I was going down the development rabbit hole I realized how beneficial this could potentially be for the motion graphics community so I'm offering this up for free just keep in mind this is in early development there most likely as bugs or certain things aren't working with it and I can't exactly support this or fix bugs after releasing this you may have noticed this window up here sitting here this whole time which is a core set of scripts that I use to help me with our global variable to help me connect all of these elements together and give us the expressions if you look at this it's a just a launch pad for all the different scripts that I've been developing and you could add more scripts to this list by going to the settings but we're not here to talk about that we're here to talk about delay so AFP delay is the script that will let us connect all of these elements to our global variable I want to go ahead and animate a cluster of leaves over here I'm going to go for the pink leaves that's in this environment and just our animating with the script to do this I'm going to go inside a voyage comp and in here it has each of the different sets of leaves broken up already and I'm gonna go inside have the pink leaves comp and in here I have all of these separated into their own layer there's fifty four layers of these pink leaves and to run the script I'm gonna select everything that I want to apply the global variable to and then hit my AFP delay script this handy-dandy window is what will allow us to attach everything to that global variable first off it'll tell you what you have selected so here we have 54 layers selected if you have properties selected then it will also indicate that here you know you could connect this to any effect property or you know puff pain or whatever and this will just showcase what you've what you have selected next up is the property driver so this is the force that we're going to be connecting to so this is our it's asking us what is our global variable so I'm gonna go ahead and select this and then make my way out to the comp that has our global variable that we set up earlier in this video select it and then put ok now it's asking hey which of the values do you want to use and this is a singular value so it's you know it's fine to have it check marked only in this first box but if this was position then the next box would open up and it will ask you which of the values you want you'd have the X to the Y or both and then because we've only selected layers and not the layer properties we didn't select rotation we didn't select you know position we only selected the layer so it's asking us hey you have layer selected which property do you want to apply the expression to and in this case I wanted to affect our position property so I'll keep it there and I won't talk about the options just yet I'll just go ahead and hit add when I add it a few things happens one it's going through each of these layers and I mean I this for a second it's going through every single one of these layers and adding an expression to it if I expand this you'll notice that this is very similar to the expression that we were building earlier in this video it's a similar set up a little bit more complex because of functionality reasons I'll get into that in a bit but you'll notice that the that we have our delayed variable that as the brackets because this is affecting position property so you see both of the variables here as well as the offset notice our negative 7.3 here with a crazy amount of numbers and super precise which is I guess a good thing and then we have our equation with the two properties broken up before the x and y well when you launch and use this AFP delay it will automatically launch the editor right afterwards the second script that's here and what this is is every single one of these layers all of the properties that you've selected to apply the global variable to they're all here so you don't have to go copy and paste and adjust all of the variables within the expressions you could you just do that directly in here so to show this here's our first layer people.you underscore one and here are the values for it here are the values for it and if I were to change this to let's say like three delayed by three notice that this changed to three automatically and the leaf moved over here so I'm gonna put that back down to zero so this is a really quick way to edit all of the values that we want for everything in the scene now before I get into editing values I'm gonna go ahead and close this and I'm gonna show you how the editor works if you hit the editor by itself as is it's gonna go through every single layer within this composition and look for this delay expression if it finds it then 8 will build out a complete list of all of the layers that has the AFP delay on it but if I select layers or properties specific ones and hit the editor it will only load the ones that I have selected but in this case I want to affect all of them because I am now applying the values I want from the global variable to everything at the same time so I'm gonna go ahead and load all of them in here now there are two sections in here one is the global adjustments and the other one is the delayed properties the delayed properties has all the layers in here I have a button in here so you could just select you know these individually if you want to go see where they're at and what they're doing I also have all of the variables here that we could adjust manually but then I also have this global adjustments up top that lets us change all of these at the same for instance if I go ahead and let this animate you'll notice that the animation is there this is our global variable affecting the X and the y equally but in this case I want the X to be more powerful than Y because the wind is coming from the right and heading to the left not going from down up so in here what I'm gonna do is I'm gonna change some of these these controllers so that it will change all of these in my favour I want this over all I'm trying to adjust my amplitude and I wanted to set all of my layers to set the amplitude to whatever values I have in here so I'll put this to one and then let's say point two when I do this it won't let me run this because I haven't selected which layers I want to apply this to I could either select them individually or select this button right here and I'll select everything if I select everything or select these individually it highlights the value that I am planning to change if I were to hit the Run button here notice that the brackets next to the amplitude for all the layers are highlighted with the brackets being pink if I hit run now everything will change all of these changed from one and point two and notice that only the X is the most visible and animation right now the Y it's really subtle but it's there it's that point two currently well that's not all we want to be able to manipulate the delay of this and we want it so that it's changing or hitting the wind is hitting these elements from right to left over time so we need to delay these over time so I'm going to switch this to delay and I'm gonna go inside of here and in this drop down instead of affecting all the same amount there's another there's a few other things that we could do here to change how to affect these globally so I'm gonna switch this to cascading from top down and what this means is that it's gonna take whatever values I have here and apply it to the first layer and then add on top of that with the same value over and over again in a cascading order so if this is one then this will be two three four and so on so forth so in this case I want to make it so that it feels like it's it's blowing from right to left so I'm gonna go ahead and put negative number here and I'm gonna make this like negative 0.02 and do the same on the other one negative point zero two and then hit run when I run this what will happen is it will start with that number on the first one and then add to it and keep on adding up to it and if you look over here we're getting our effect happening over time as if the wind is coming from the right first and then heading to the left and notice how we were able to achieve this within a few seconds rather than having to go through this and go to every single layer and I had these individually if I just go to these right now you'll see it's just the expression on each of these with the slight change of delay on on every single one of these that is affected from you know our global variable now there is more that we can do with this I showed you that there were other other drop-down items like random and there's custom and custom cascading custom will give us a really interesting result because what I'm what I'm finding here is that when I when we animate this it is animating from right to left but it's it's affecting the elements notice how you're seeing a ripple run up this and although that's an interesting effect it's not exactly what we're looking for instead we want it to feel like it's it's really coming from over here and heading this direction rather than coming from the bottom and moving its way up and the reason why it's doing this is because of the ordering of the layers in here it's ordered from bottom up so the animation is being affected or is affecting this from bottom up so instead of using just cascading top down I'm gonna use custom all and what this does is it introduces a new controller for us a new graph that lets us have really fine tuning on how we want all this stuff to be affected in here the graph represents all these layers down here from top down it starts over here and makes its way all the way to the end and so that means that all the values from the top will hold whatever is here and all the values at the bottom will hold these values up here so if I were to change this to negative 1 and negative 1 and hit run then the values that it's going to start with is 0 and then the last layer at the bottom is gonna be negative 1 and look at this it's ready helping us with how the values are being affected and we're still getting that ripple coming up up this but it is giving us a very fine tune very specific result based on these values well as part of this this is a Bezier curve so we could change how how these are being affected over time now I want these to be affected sooner more often than then at the beginning so to do this I'm gonna go ahead and make this Bezier curve go up slightly so it looks like it's equal from here but then gets affected more gets affected faster once it gets to the center of this curve so if I hit run now you're seeing this be manipulated similarly over here I think we could actually increase the priestess a bit more something like this and I could probably curve theirs down a little bit more and hit on great now it's kind of giving us a more equal to mount in this area I think we could probably make this go down a little bit more and the other thing that I want to talk about is there's this button here that allows us to choose a point at which we want everything to animate too so right now it's animating in order from our layering stack so P P leaf one is gonna animate first this second third and so on and so forth if I click on this button what it's gonna do is it's gonna add a another layer over here and I'll stop this for a second I'm gonna add a new layer here with a point two controller on it and this point controller wherever I place this any item that is closest to this will animate first so to illustrate this if I put this up here once I put it right here and I hit run what its gonna do is it's gonna animate these items first it's gonna animate from the top down notice how this is animating first and this last well that's because of where I place this point so if I were to place this point somewhere else let's say I put this you know let's put it in the center if I put it in the center then it's gonna animate from the middle first and make its way outward almost like an explosion heading outward go and I'll hit run and this is animating first and then these are animating second so in this case what we want to do is have it so that it's animating from over here since that we want them waiting to go from right to left we're gonna go ahead and put this point all the way over here that way if you we could feel the wind hitting this first and making its way that way and taper up I'm gonna see this thing in action now what I'm noticing is that the amplitude is actually going the wrong direction and we need to change all of these to the opposite direction because the wind picks up over here remember how it's really strong in this area well that means that all the these elements need to go that direction to go left not right so to change this I'm gonna go ahead and go to set all and instead of actually set I'm gonna change this to multiply and I'm gonna affect my amplitude and I will multiply all of these values by the negative number except for actually the Y I'm gonna multiply all of the values down here by negative number and not do anything with with this one actually I'll put nothing in this one and then hit run and what it will do is it'll multiply all these by negative and you'll see that all this changed and now it's doing it going the opposite direction all right this is looking pretty cool now I want to add in one more global variable to this a second global variable and the reason why is that I think that this is going to look really nice in terms of being affected by the wind but of course there's gonna be some sort of level of noise associated with the wind and I want all of these elements to feel that noise so let's add another variable to this stack and then see it all together so to do this I'm gonna go ahead and and walk this guy and then select everything and hit delay again I'm gonna go ahead and select a property and I've already created a noise slider here this just has a wiggle on it this is what that wiggle looks like it just goes up and down there's there's nothing too special about it it's just a looping wiggle so I'm gonna select this noise slider as my property that I want to follow and I want to apply to the position and then hit add and then when it adds it's gonna add the noise to every single one of these layers it adds it to the expression down here and it's gonna add to this stack right now it has noise on everything so if I just run this you can see that the noise is being affected or is affecting all of these all together and all at once so we need to adjust that noise so it affects each of these leaves individually and to do this I'm gonna go inside of here and you'll notice that a new tab has been introduced here is our global variable wind and this is now my new slider which is called noise over here as a tab when I select this it will load up all of the expressions here and it'll look for another target inside of the expression and once it finds it it adds it to that list okay so when we hit animates we want this to only affect the position but only the exposition just like we're affecting only the exposition a lot in the Y a lot less so let's do the same over here I'm gonna go ahead and go to amplify it select all the properties and then change the amplitude of the X 2.5 and then the Y 2.2 run okay now we're seeing the noise here it's pretty subtle not a lot happening here and I think that's okay for right now but the issue is that they're all running at the same time together and what we need is for use to have a random effect when it comes to noise so to do this I'm gonna go to my delay I want this to choose a value that is random within an 8-second time frame because this is how long I have the looping wiggle so I'm gonna go up here and choose eight and eight for eight seconds and change this to random it's gonna do a random number between eight seconds and then hit apply there you go now we got ourselves a random effect where it's randomly affecting all of these elements on their own now this almost looks as though looks a little bit too intense that are kind of like floating and doing their own thing a bit too much so instead of just doing that we will also turn down the amplitude a little bit for both the X and the y so I'll go back to amp go to multiply and it's do a set or a multiply all and I'm gonna make this let's say point seven point seven in a row I can actually think the wise is still too much I probably want to turn down the Y a bit more so I'm gonna go to set I'll remove the amplitude in the X and turn the Y let's make that just point zero eight for everything all right I want to add a rotation to this as well so that it's being affected in the position and rotation of these leaves so I'm gonna go and select everything again hit delay choose my global variable property so go out here go to our global variable okay and then I want to apply this to rotation instead and put add now it's gonna go through and add all these to the rotation property there we go and select all these I'm gonna turn the amplitude for all these to let's say like 0.5 and then I want to make the delay similar to what it the other delay for the position is so I'm going to go to custom all and change this to negative 1 5 and you see right let's see you this in action okay so we're seeing the rotation happen but it looks like it needs to go the opposite direction and amplify so I'm gonna go to amplify set all and then I'm gonna change this to look negative 5 yes there we go now we're really seeing a rotation happen very cool so now it's affected everything is part of this we're seeing that rotation we're seeing all this put together let's see it all together with the entire scene as we have it so let's go back out and go to our NEMA and let's see all these elements flowing together okay it looks great I totally forgot that we changed the amplify of this curve to be really high and intense that's why we're getting a really strong blowing action over here but everything is connected so we can go ahead and just move these back down and it will affect everything in our scene just like before so we can keep this down here and now we can see everything in action with that adjustment all that's left to be done is to go through all of our pre comps layers that we want to attach to our global variable repeat the steps that we did here with the pink leaves and then get our simulated environment [Music] of course the global variable concept can be used for so many things outside of your environment I've used it for character animation rigging cloth even text layer updates really the application of this is universal and wide open so I'm really curious to see how you take this and how you evolve this concept send me any examples you have I'd love to see it if you have any questions about the script or about the way I work please leave a comment down below and I'll get back to you as soon as I can and as always thanks for watching [Music] you
Info
Channel: Anthony Possobon
Views: 122,923
Rating: undefined out of 5
Keywords: After effects, scripts, expressions, rossdraws, animation, 2d, 2.5d, painterly, illustration, nima, anthony possobon, rigging, environment, grass, leaf, branches, rose pedals, ross tran, solstice, art, tutorial, tutorials, blossoms, cherry blossom, AFPScriptLauncher, AFPDelay, AFPDelayEditor, AFPBezier, AFPCollection, delay, AFPHairRig, Hair rig, Hair Animation, free scripts, aescripts, free, global variable, learn, japanese, fantasy
Id: fPoLG2CgQIE
Channel Id: undefined
Length: 54min 17sec (3257 seconds)
Published: Mon Mar 18 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.