How to Scatter Objects WITH GEOMETRY NODES in 2023! (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys Justin here with the CG essentials.com so it's been a while since we've done any kind of geometry nodes tutorials I wanted to make a quick tutorial teaching you how to scatter objects on a Surface in 2023. let's go ahead and just jump into it alright so geometry nodes can be a little bit intimidating so don't worry about that we're going to approach this in a way where it's easy easy follow and I'm gonna go step by step so first thing you need to do is you need to add a window where you can actually control your geometry nodes so we're just going to click on the add workspace button over here just the plus and under General we're going to add a geometry nodes window and so what that's going to do are geometry nodes workspace and what that's going to do is that's going to create a workspace that's kind of set up so that we can work with geometry nodes and so what we want to do is we want to take some objects and we want to scatter them on this plane so we'll talk about a couple different ways to do that and some ways to randomize those in this video and so the first thing we need to do is we need to select our plane and we need to click down here to add a new geometry node setup and so when these come in these come in with an input and an output and we're not going to worry too much about those though we are going to add some inputs those are what's going to show up over here on the right hand side of the page where you can make adjustments but what we need to do right now is we need to start by just adding some points right so we need to have this so we need to take our geometry nodes they need to reference this surface we need to add some points to our surface so the way that we're going to do that is we're just going to click in here we're going to do a shift a and we're just going to search for distribute points on faces we're going to click right here and we're just going to click right in the middle of this and so what you're going to get right here is you're going to get a number of different points so it's going to reference this object right here and it's going to find different points on the object notice how if you drag this up and down you can change the density you can also change the seed to randomly set where the points are on that surface okay and so right now the first thing you might have noticed is okay that's great but my object is Now hidden and so the reason for that is because we've told this to take the group create a bunch of points and then output them but we didn't tell it what to do with the original geometry so what we want to do is we want to join our original geometry with the points that we've added on our faces so to do that we're going to do a shift a and we're going to add a join geometry node right here and we're just going to click on this line now nothing's happened yet but what we want to do is we want to drag a node from this point into our geometry right here now we can see our original object and it's joining it with the points that are being created in here so now we have something that's kind of distributed on this surface and one thing that's cool about this and I'm going to tap into edit mode real quick and I'm actually going to subdivide this face so I'm just adding some additional geometric detail so I'm just going to right click on it and subdivide it a couple different times but now if I select a vertex in here and let's say I do some proportional editing and move this up notice how those points are going to move along with the surface so it's using the surface and it's placing those on the surface in here like this so it's Distributing those based on whatever that surface is which is cool but now what we want to do is we don't necessarily want points on this surface right we want to add some objects we want to scatter some objects on here and so first off let's do a shift a and let's add an object so we're going to go with a cone for you know what let's go with the monkey actually we're going to add a monkey and I'm going to move this over I'm going to rotate it 90 degrees and I'm going to scale it down one thing that's important about this and I'm not going to do this right now just so you can see what I'm talking about is you're going to want to apply your rotation and scale when you scale an object like that but I'm going to leave this as is just so you can see why that's an issue so the next thing we want to do is on these points we actually want to distribute an object so what we want to do is we want to do a shift a and we want to add an instance on points node right here and we want to take the points plug that into the points we want to take the instances and we want to join it with this geometry now one thing you're going to notice about this is notice how that all went away right so nothing's on there anymore that's because we haven't told this this uh node what instance to place so we need to put something in here and in this case we want to add an object info node and so what an object info node is going to do is it's going to allow us to reference an object in this case we're going to use the eyedropper and we're going to click on the Suzanne right here and what we want to do is we want to take the geometry from this object and we want to drag that into the instance and so notice how when we did that what that's doing now is that's placing instances of that Suzanne on the surface now one thing you might notice is this is a lot bigger than the Suzanne over here and that's why I told you we weren't going to apply our rotation and scale so that you could see what this does because we didn't apply our rotation and scale these objects don't have that applied to them so whenever you scale an object in object mode you want to make sure you go to object apply rotation and scale notice how now those are the same size and rotation as this object over here and so one thing you might notice about this is these objects are currently not placed so they're sitting on the ground right they're like halfway through the ground and the reason for that is because what our geometry node setup is doing is it's taking our object origin which you can see is right in the center of this monkey head right here and it's placing that on the surface so the object origin is being placed on the surface but the object itself moves down below that origin and so what I'm going to do is I'm going to do a quick rotation of my object so that it'll sit on the ground a little better but then and I'm going to go ahead and I want to apply the rotation and scale again because I rotated this but now what I want to do is I want to move this origin down and so the easiest way to move that origin down is to take this object go into options effect only Origins and we're just going to move that origin down to the bottom of our object right and we could move it over here maybe that's probably the lowest point of our object so that's probably going to be the best fit but then we're going to go ahead and toggle that off but notice how now all of those objects are sitting on the ground like this so now we've got this geometry node set up in here that's randomly placing objects in here note that by the way you can adjust the density by adjusting the distribute points on faces setting right here you can also adjust the seed which is the randomization of those objects now let's say that we wanted if we were in layout mode let's say that we wanted to be able to go into this geometry node modifier and adjust the number of objects that are in here well the way that you would do that is you need to add an input so for our group input right now all it says is geometry right but what you can do is you can click on this and tap the in key so the in letter on your keyboard and you can go down to group we'll notice how within group there's an option in here to add additional inputs so what I want to do is I want to add an input for density and so you can double click on this to rename it I'm going to rename it density well then I want to take this density and I want to plug it into the density right here so notice how now this isn't something you can drag over here anymore it's something you said in your modifier settings so now I can drag this up to set my density so now I can adjust my geometry node in my layout view without actually being in the geometry node View and adjusting the nodes back here I want to add another input for density no location and I'm going to drag that into my seat so now I can adjust my seed by clicking and dragging this over here as well so we're making our geometry node set up a little more interactive okay so now we've got this setup where we can adjust the density and the seed but let's say that we wanted to be able to adjust our scale right so let's say we wanted these to be randomly sized that could be something that could be really important if you do trees or something like that so the way that we do that is notice how right now our scale is said based on our instance on points object well what we want to do is we want to set our scale so that it's adjusted based on something we set so I'm going to add a scale input right here well in this case we want our scale to be randomized right so what I'm going to do is I'm going to do a shift a and I'm going to add a random value node right here and I'm going to drag this in I'm going to drag my scale into my Max like this and then I'm going to drag the value into the scale over here and so notice how now I've got a scale option that I can use in order to randomize that scale however sometimes I just want to be able to change this without adjusting my Max right here and you could put a minimum in here too so you could do a scale Max move this up we call this one scale minimum and you could drag this into your minimum so that would give you like full control right of your minimum and your maximum right here but then you could also add a scale seed like this we're going to drag that into our seed so now we can adjust our scale seed over here as well so we're actually creating a pretty robust geometry node setup over here now let's set this up or we can set a random rotation so I want these to be randomly rotated so they're not all facing the same direction right but in this case this one's a little bit weird because we only want to set the rotation so that it's applied to the Z value right we don't want that to be applied everywhere else we just want it to be the Z because we don't necessarily want these like turning or anything like that we want them to be pretty flat on our surface so in this case we're going to use a different node so in this case first off I want to add so first off I'm going to add a rotation value right here but second I want to add another random value and I want to place it over here but the problem with this one is if I drag my value into my rotation and I set my rotation and my Max like this when I adjust it we don't really have any control over the direction of the rotation right it's just like randomly rotating Things based on the randomization that's over here so what we need to do is we need to add a different node which is a combine x y z node and so what that's going to do is that's going to allow us to separate out our Z value so this is going to take a vector and we can take that vector and plug it into our Max right here and then we can plug our rotation into the Z and so notice how that's still not working right and the reason that's still not working is because our random value is just set to a float a float is just a value right but what it's not doing is it's not looking at the XYZ vectors and differentiating between the three so what we do is in our random value node we want to change this to a vector instead of a flow so you don't want to float you want a vector right so you want to drag this Vector into your max right here and then you want to drag your random value into your rotation well now when I adjust this because we've separated out that Z vector and plugged it into our Max our rotation is only going to affect the Z Vector now one other thing you might want to do is you might want to add a rotation scene so I'm going to click the plus button right here we're going to make this a rotation seed we're going to drag this into our seed right here well now we can adjust the seed of the rotation using this value as well so we've got a pretty full featured scattering node set up right here now gives us control over pretty much everything you could add a rotation minimum a Max in here if you wanted to to give you a little more control but now let's say that we didn't want to scatter just this one object let's say that we wanted to scatter a collection of objects so I'm going to bring a couple of those in real quick okay so let's say I have these three trees right here and I want to scatter all of them on this surface well what I can do is I can add those to a collection so over here I'm going to add a collection and I'm going to call this trees to scatter and I'm going to take those three trees and I'm going to drag them into the trees to scatter collection all right so what I've done is I've created this collection of trees right they're all in this trees to scatter collection right here what we want to do is we want to jump over into our um we want to jump over into our plane and we want to change from an object info we want to do a shift a and we want to add a collection info right here so that's going to let us do basically the same thing but it's going to just pick a collection and in this case we want to drag our geometry into the instance button right here in order to place that okay so you might have noticed that nothing has happened yet so in this situation I want to make sure that I've checked the box for separate children but then the other thing that's kind of weird right now so notice how this is all kind of getting placed based on a location relative to the central point of our model right here and so you can see if we really zoom out that these are being placed but they're like way up in the sky so you can kind of barely see them up here so what we want to do in order to fix that is we want to make sure we check the box for reset children and so when we reset children what that's going to do is that's going to reset this transformation in here because what it was doing is it was setting that transformation based on our Central Point right here which isn't necessarily what we want I'm going to the scale Max down because it's really kind of throwing this off now one other thing though that you might notice is right now it's placing all of those objects on those points again not what we want so what we want to do is we want to go up into our um into our instance on points we're going to check the box for pick instance and so what that means is that means that that's going to come in here and that's going to just pick a singular instance in here rather than um rather than placing all of the instances on those points at once and so again notice how we can adjust our scale min max other things like that we can also adjust our density up and down as well as our seed just like this and so basically we've got this like full-on scattering geometry node set up in here and we might even call this scatter on object okay and so one other thing we might want to do and this is something I'm hoping to add in the future is at the moment we can't take a geometry node setup at least as far as I know and save it as an asset for our asset browser right you just can't do it um but what you can do is you can take the object that has the geometry node modifier applied to it and you can mark that as an asset so what I might do is I might call this geometry node better right here so basically what I've done is I've renamed my plane but I can right click on this and I can mark it as an asset and so when I Mark that as an asset what I can do is I can then add that to other scenes so for example now if we jump into our current file we'll click on all and we've got our geometry node scatter right here if I drag this in what that's going to do is that's going to bring this object in well when it does that it's also going to bring in the geometry node setup now this is a little bit of an issue um because at the moment that'll only show up in the current file right so what you would need to do is you would need to do a save as and I'm going to create a folder called geometry node setups but I'm just going to call this geometry node scatter right so I've saved this in that folder but what I can do is in my preferences I can add that folder as an asset Library so I'm going to click in here all right so then I can save that in my preferences well now if I open up a new blender window and I go down into my assets and my asset browser that geometry node setup is going to show up in here and I can drag that in and so what it's going to do is it's going to bring in that plane and also these objects right here well then all I would have to do is just add a new plane right and then now that geometry node setup is in my scene so I could add a geometry node modifier I could click the drop down and I could click on the scatter on object okay and so when I do that if I set my scale to one and I set my density to one notice how this is scattering on this new object as well so it's a little bit of a workaround right now but you can save that geometry node setup in here and then apply it to New objects and then you can just Place new things in this collection in order to scatter them on the surface all right so that's where I'm in this video we'll talk about some more advanced ways to do things like this in some future videos but leave a comment below let me know what you thought if you're using geometry nodes for anything I just love having that conversation with you guys as always thank you so much for taking the time to watch this and I'll catch you in the next video thanks guys
Info
Channel: The CG Essentials
Views: 48,052
Rating: undefined out of 5
Keywords: blender, blender 2.82, blender 2.8, blender modifier tutorials, blender tool tutorial, the blender essentials, the cg essentials, thecgessentials.com, justin geis, justin geis blender, blender 2.9, blender 2.91, blender scatter, blender geometry nodes, blender geometry nodes scatter
Id: iNU-1ORXw74
Channel Id: undefined
Length: 18min 53sec (1133 seconds)
Published: Wed Jan 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.