Learn How To Create Animations In Grasshopper (Grasshopper Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we're going to learn how to create parametric animations in grasshopper we're going to create three different types of animations in this tutorial one that moves geometries one that grows geometries and then we're going to combine these together to create a hybrid of the two to complete this tutorial you'll need the human plugin for grasshopper as well as the weaver bird plugin for grasshopper so please ensure you have downloaded these plugins before we get started on my screen i have two pieces from the chunk model i was using in the previous tutorial one slab piece and one timber strip members of thedifferentdesign.com can download this template from the website the first animation that we want to create is a movement animation which we're going to do using the slab geometry so i'm just going to my layers i'm going to turn off this timber strip for now and we're going to basically create an animation where this slab piece moves in from above and lands in this position here using grasshopper so in grasshopper i'm going to start by creating a brep and i'm just going to reference this breath into here and then i'm just going to go ahead and hide that guy for now actually not hide let's just turn the layer off and then let's go ahead and just mesh the brep with the mesh prep component there like that just because it'll have you know implications when we run this animation later on essentially what we're going to do to build up this logic is we're first going to just move this rep out of the way like above our screen up here and then we're going to move it back down and we're going to create an animation of that using grasshopper's animation tools so i'm just going to create a move component and i'm going to move that mesh geometry like that and then i'm going to create a unit z component like that one there and plug that into there and we're going to go ahead and move this one by i don't know let's say twenty thousand i'll go zero is smaller than twenty one two three um like that and then as we drag that slider up you'll see that moves that piece out of the way i mean 10 000 is probably enough so let's just go to there for now uh just to get it off our screen like that in fact no let's go with 20 000 just to make sure cool so that's moved off the screen and basically now what we want to do is create an animation that's parametrically going to move this piece of geometry you know back into that original position like that so that's a pretty easy thing to do we're basically just going to reverse this vector here that we've created the unit z vector and then we're going to um go ahead and move the geometry by this vector which will go and put it back into its original spot right but what we want is we want control over this process we want control of moving this thing back down here so i'm going to create a multiplication component and i'm going to multiply this vector by a factor of 1.00 with three decimal places so one point triple zero actually and i'm going to plug that into multiplication and put that into motion and now what happens is as we go up with our number slider our geometry nicely moves into place so it comes from rather just slots in like that just like as a little parametric movement relationship that we've created so that's kind of like the basis for our animation the last thing that we want to worry about a little bit is the actual presentation of our animation so um we're going to basically use human to grab the material that is currently assigned to this slab piece and apply it inside of grasshopper so the human component that i want to use is called material table which is that one there and it gives us access to the random materials in the document so i'm going to drop that into the canvas and basically if we just create a small panel coming out of that you'll notice we have you know material called timber then somewhere here we should have another material i'm guessing it's custom which is the material added onto this slab piece here so i'm going to just go and get a list item and it was item number 34 in that scenario i haven't purged all of the old materials from this document so that's why we're kind of getting that so i've got that material coming through and now i'm just going to create a preview a custom preview of that geometry and the material we're going to apply is that custom one and that gives us that nice concrete material that we're kind of going for there so now we've got our parametric relationship set up to move that component but the big question is how do we go ahead and actually turn this into an animation so the first thing i'm actually going to do is just make sure that this is a rendered viewport so we get just like a nice rendered output of this geometry and the way that we create an animation in grass opera is basically let's just drag that number slider where the multiplication is we can basically create animations that step through number sliders so if you right click on the number slider name there is a little animate tab just there so we're going to click on animate and it'll bring up an animation toolbox that looks something like this it's called animation controls and it'll give us the ability to go ahead and save out these images to another file somewhere so i could go ahead and you know specify where i want to save it so in the previous tutorial i'll save it in documents animation and i'll make a new folder called g-hop move oops like that and i'll click ok and basically we have a lot more control over this animation than we did over the previous ones we can specify the resolution so i highly recommend you go 1920 by 1080 which is a full hd we can specify the frame count i'm going to drop that to 100 for this animation and then it gives us a little preview of what our animation looks like so at the moment we've got like a blank white because our piece of geometry is up here but that's okay and then if we hit okay um we will see that um rhino is going ahead in the background and generating all of these frames kind of in a similar way to how it created them for our turntable animations so i'm going to pause the video here for a second while this runs and then we'll come back once the frames have all loaded okay so that's gone and completed and it's gone and saved all of our files into this hop move folder so you'll see here as you move across through these frames you start to get this you know geometry appearing very slowly as it moves down and you could go ahead then and combine these in photoshop as an image sequence and you know render it as a video or combine those image files in some other kind of formatted software so before we move on to creating the growing strip animation that i was just talking about i just want to point out one little error that can come up when you're creating these animations so we've created this slab animation but what's coming through is actually like a slightly red kind of shade over our slab and that's because we still have the preview of these grasshopper components turned on in our algorithm so before you ever create any animation please make sure you turn everything off preview it off except for the actual thing that you're trying to animate so i'm not going to redo this animation but i just want to make a very big point of that try and preview everything else off except for like this custom preview thing for the animation that you're trying to create so just below this i'm just going to keep working and i'm going to turn on this um timber slab oh sorry not timberslav this piece of timber geometry here and we're basically going to give it a bit of thickness and then simulate this piece of timber kind of twisting around it's actually quite an interesting piece of geometry i might just kind of try and quickly show how it looks in perspective mode basically it kind of snakes around and then does a little bit of a twist and a curve at the end there just like that so you can see there and we're going to go ahead back into parallel mode and basically just simulate this guy as a animation so just to start with i'm going to reference it in as a surface so i'm just going to go and right click and go set one surface and set that guy in here like that then basically what we want to do still on how we're trying to kind of deconstruct an animation we want our strip to grow from here all the way out to here with a bit of thickness so i'm actually going to use a component called the iso trim component and this is going to enable us to extract a subset of this surface so the surface itself is that guy obviously and we actually want to re-parameterize let's re-prioritize coming into the iso trim just to be sure actually and then we're going to create a domain for our surface so it's going to be a domain squared a domain is obviously values between you know two variables but a domain squared is basically you can imagine that our surface is made up of values along this axis which is called the v axis and then values along this axis which is called the u axis i think if our surface is built in the way i think it's built so we actually have to create a domain from this point to this point and then another one from this corner all the way down to here to extract that subsurface that we're after so i am going to go ahead and construct a domain squared from two simple domains as you know i don't want to do it from two simple domains i want to do it from the u mins and u maximums like this guy here so basically we can imagine like the u minimum of u is going to be 0 to a u max being 1 is probably like that height i imagine or it's either maybe the u value is actually the length if we are able to basically control these values we should be able to grow the length of this strip and i'll kind of demonstrate that in practice a little bit and then explain it so i'm just going to create a number slider that's 1.000 in value so similar to what we're doing before with that previous animating number slider i'm going to plug it into umax and then plug this 2d domain or this domain squared into this output and let's just see what happens here so if i pull this guy down you can see i'm getting a little bit of a subset of this surface coming through right so this surface is you know going in the comp it's actually kind of growing in the opposite direction that i would like but that's okay it's not a huge deal for us if we wanted it to grow in the other direction we could do a deer command and i think you can reverse the use like that hit enter or return and then hopefully it will actually grow for us yes in the direction that we want to so we've flipped that u around so 0 is actually back here now and 1 is up here and basically what we're doing is we're extracting a subsurface from this larger surface so you get this kind of like growth effect of this initial condition and you can probably already imagine where we're going with this from an animation perspective so i'm going to go ahead and do a similar thing i'm going to go and mesh the wrap that's coming through here and then we're going to use a weaver bird component so if you've downloaded weaver bird that's great we're going to use the thicken mesh component so weave of bird's mesh thicken and i'm just going to thicken this mesh here i'm going gonna give it a distance of about um a hundred let's go with a hundred actually let's go 95 doesn't really matter too much though um just me thinking ahead for the next task um after this when we combine all these things and now i've got a thickened mesh output that parametrically links itself back to all this stuff so we've actually got a thickened piece of geometry that's able to grow and shrink based on this number slider over here and then it gets really simple we basically just want to do the same thing that we did before we're going to get a material table the material name we want is actually that timber001 so i'm just going to get a list item that guy there and that'll give us that material we want and then i'm just going to do another preview custom preview it's going to be this geometry here which is our thicken geometry with our material our timber material applied to it and i'm going to preview everything else off so we don't make that same mistake again and this time i'm going to zoom in a little bit on this timber strip so we get a bit of a nicer animation and of course we can control the length of this timber strip now so we can now go ahead and create an animation from this guy using the animate command so we can go to number slider animate it'll bring up our little animation tab we'll go and create a new folder under what was it under documents i was trying to create it nope not there where's my documents folder libraries documents animation we'll make a new folder called g-hop timber i'm gonna save it into there make sure that's png that can actually have like an adverse effect when you go back into photoshop and everything else looks okay to me so i'm going to hit ok and grasshopper once again is going to go ahead and run this animation and grow it so i'll just pause the video here and we can come back to this once the animation is complete great so that animation is completed running and if we go back to our animation folder we can go to the g hop timber thing and you'll see we got like a nice kind of you know growth animation so we could go ahead and once again you know combine those frames in photoshop maybe just give a quick demo of that if we go to g-hop timber get that first frame and do an image sequence of it open it all up we should have a nice little animation of our timber growing inside of photoshop and we can of course export that and render it as a video cool so in the background of that i've actually got open um my kind of chunk file of this little like architectural study from the first video and i've gone in and loaded it up and um referenced in you know the grasshopper strips for multiple timber surfaces so you can kind of see here my timber surfaces can grow with multiple pieces as well which works really well i've also gone in and referenced the movement breps here so they're all kind of like moving into place as you can kind of see there maybe that one actually needs to be a bit higher just looking at it from the purposes of this little animation we're trying to do uh like that so they would go and move into place as we increased that guy there one thing i'm not super happy with um with this movement thing is just kind of like the fact they all start from the exact same position basically and move in so i might just quickly like add a little bit of variation which i always encourage you to do with these types of animations you want to look make them look a little bit more natural and interesting so i'm actually going to add a little bit of a random varial in variable inside of this movement vector basically it's going to come into play um just before we hit this unit zed thing so it's going to sit in here i'm going to basically create an extra piece of movement for every item of these blocks so this brep is going to take that list length and i'm just going to go and you know plug that into place there so we get 17 random numbers i'm also going to create a domain so we're going to construct a domain and the domain is going to be between 0 and maybe 5000 just so we get a bit of variation there that goes into our range and then those random variables are going to be added to this uh 30 000 here like that so then rather than every single um slab starting from 30 000 above they're going to be like slightly varied so i'm going to plug that guy into there and we could probably just move these guys just across a little bit like that and get that guy moved over here so that becomes a slightly different um algorithm like that could be seen as our kind of movement or maybe we include that one and say that's our first move this is our base geometry and then you know materials [Music] and this is our second move over here like that so now if we go and you know move this slider around we get a little bit more variation in the way that they all appear so rather than them all coming in really flat they don't actually become flat until they hit that last moment and because both of these algorithms are set up to use this between zero and one slider i could go and use this zero to one in here like that and then maybe we could just remove this guy from the group so i'll just give a little bit more room so it's just combining both of our um algorithms here and this can be like basically maybe we'll make it a nice red so it's obvious and we'll give it a blob outline this can be our animator like that so then when we say go to rendered mode now and we go ahead back to zero with this slider here we are able to go ahead and create an animation that becomes even more complex than our previous one so i'm going to go ahead and go animate get our little animation um slider up and down here i'm going to make a new folder called g-hop combined like that go okay um that all seems pretty good to me so i'll hit okay and we can see this go ahead and animate our um our entire process so i'll just pause the video here and we can check this out in photoshop after cool so that animation has run and we could go ahead and try and combine that guy in photoshop once again so we go to animation g hop combined and we'll do an image sequence of these guys and we should get a really nice image you'll see i've got a bit of a um transparency in the background so i might just create a layer and fill it in white oops um okay let's just turn that off for a second okay it doesn't let me do that for some reason there we go that's better let's move that out there um and then you know we can fill in that white background really easily so now if i hit play you see we get this kind of really smooth animation of my timber pieces growing and my slabs moving into place in that animation like that all my um timelines trying to play that little white bit a little bit longer so that's basically how you go ahead and combine some of these animations together to create a slightly more complex animation that could showcase some of your design ideas just using simple tools in grasshopper
Info
Channel: Grasshopper Tutorials
Views: 11,496
Rating: 4.9767442 out of 5
Keywords:
Id: pWCnWwy4jT4
Channel Id: undefined
Length: 20min 45sec (1245 seconds)
Published: Mon Sep 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.