Distribute Objects using Weight Paint-Geometry Nodes (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so recently i created this tutorial on how to distribute objects on a plane using geometry nodes and in the video comments people are wondering how they can place the objects in just specific spots so in this tutorial i'm going to show you how to set it up so that you can wait paint on your object and then where you've weight painted that's where the object is going to show up and we will be doing this with geometry nodes and if you haven't seen that other video i will have a link in the description to that video but real quick i will show you how to set it up so that you can distribute the objects onto a plane or onto some other object and then after that i'll show you how to set up the weight painting so that the objects are only in some spots and i will also have timestamps in the video description if you've already set up your geometry nodes but you just want to skip to the part where you can learn how to set up the weight painting all right so i have this pretty detailed subdivided landscape right here and i created this by using blender's landscape add-on and then i also imported my low poly hand painted nature assets so this is a 3d product of assets that i'm selling links in the description if you'd like to check that out and so i just added this into the blend file and we'll be putting this on the plane so we need to add a geometry notes editor so what i'm going to do is click right here when that crosshair appears in the corner and i'm going to drag out and that is going to split the window and then right here i'm going to change the editor type and i'm going to go right down here under general and i'm going to change it to the geometry node editor and then just make sure that you have this plane selected so i'm now going to click on the new button to create new geometry nodes so to set this up i'm first going to press shift a and i'm going to go to the search here and i'm going to start to type in distribute and i want to add the distribute points on faces so let's click on this node and just drop it right down here then i'm also going to press shift a and i'm going to go to the search here and i'm going to search for instance and i'm going to add the instance on points node so let's drop the instance on points node right here and then you can see that the plane has disappeared and so what i need to do to fix this is press shift a let's go to the search here and i'm going to search for the join geometry node let's click on this node and we're going to drop it right down here and then we want to join the original geometry of the landscape backup so let's take the geometry from the group input and we'll put that into the join geometry so now what i need to do is add the collection as an instance right here on the instance on points so if you're doing this with just one single object you can press shift a you can go to the search here and you can search for the object info and then right down here if you click on this you can click on this and then just find the object like for instance the mushroom 3 and then you could plug the geometry up to the instance and then that would instance that mushroom on the plane so you could do it that way if you're just instancing one object but i am instancing a collection so i'm going to press x to delete this i'm going to put all these nature assets into their own collection so i'm going to press b for the box select and just box select all these and then i am going to press the m key and that is going to bring up the move option and then i can just click on new collection and i can just rename this to nature and then i will click on ok so then right over here in the outliner you can see we have the collection and then also the nature so now i can add the collection instead so i'm going to press shift a and i'm going to go to the search here and i'm going to search instead for a collection info so instead of object info we're going to use the collection info so that i can click right here and i can just choose the nature and then i can plug the geometry right here up to the instance so now you can see that it's instancing all of the collection instead of just one object now you can see that all of the nature has been put over here and that was because of this offset so these objects right here these objects are not in the very center of the 3d space if you move them back then they would kind of move back over but i just want to leave the objects here out of the way so to fix this what i can do is i can click on the separate children i can click on the reset children and then i'm also going to check mark the pick instance so now all the nature is going to be added right there on the plane now the scale is way too big so i want to give this nature a smaller size and i also want each object to kind of have a random size and a random rotation so you can just change the rotation right here on the instance on points and you can also change the scale right here so what you can do is you can click and then drag your mouse down and then you can drag back and forth and i'm also going to hold down the shift key to make my movements more sensitive and you can just make that much smaller but instead to make these values random for each object i'm going to press shift a and let's go to the search here and i'm going to search for the random value node so let's drop the random value node right here and then i can plug the value into the scale so for me i'm gonna turn the maximum to like a point zero three so they can only be as big as point zero three and then for the minimum i'm gonna do a point zero one so all of these objects are going to be in between these two values and then i also want to give just a little bit of random rotation so i'm going to take this random value node and i'm going to press shift d to duplicate it and let's just drop it here now instead of it being set to float i instead want to change this to a vector and you'll see why i'm doing this in a moment so i can now take this value and i can plug this one up to the rotation now why i'm setting this to vector is because i don't want the rotation to be all around in 360 degrees i only want the random value to rotate it on the z axis because i still want all of the objects to be pointed up so now right here on the maximum i can turn all these values to zero so just turn all of the values to zero on the maximum but then right here on this bottom one this one is going to control the z values so just the z rotation so i can now just turn this up to a really big value and you can see that all of these objects are rotating and then if you want to have them just kind of slightly rotating to the side i am going to change these values right here so i'm going to turn the x and y both to a 0.1 so right here on the max both of these values i will just turn that to a 0.1 and that way these objects will just be kind of slightly rotating to the side and then you can see that there aren't very many of them so if you want to have more of them you can take the density right here and you can just turn the density up and that is going to add more of them now you can see that there are some of them which are going through each other so if you want to fix that so that none of them are overlapping you can click on this random here and you can change this to the poisson disk so i'm going to change it to poisson disk on the distribute points on faces so now that you've changed that to poisson disk you can change this distance min and by turning up this value it's going to give a little bit of space between each object so i'm just going to turn this up to a .02 just so that it's a very small value so now i can turn up this density max and when i turn that up there's going to be much more of those objects and then i also want it to mostly be grass so what i'm going to do is just select all of the grass objects and i can press shift d to duplicate and drop them here and as i duplicate them they're still in the same collection so you can see that now that i have more grass more of these objects are going to be grass alright so now to get into the main topic of this video i'm going to show you how to set this up so that you can just wait paint on the object and then the objects are only going to show up where you've weight painted so just make sure you have the object selected and then i'm going to click on object mode and i'm going to go over to the weight paint mode so now you can start to draw and you can see that it's adding these color values here so basically where it is red there is going to be lots of objects distributed in that area but then as it gets more blue there's going to be less of the objects distributed and then where it's dark blue there isn't going to be any of the objects and you can also change some of your brush settings right up here so you can change the radius and that's going to make your brush bigger and then you can also change the strength value if you don't want to paint quite as strong so you can see that i'm painting but it's not actually changing where the objects are placed so how i need to set this up is i need to go right back over here to the geometry nodes what i want to do is i want to take the density factor and i'm going to pull a wire right here out of the density factor and i'm going to put it right in here in the group input so there's an extra value right here and you can just stick it right there now when you do that if you click right over here on the modifier properties you can see that when you add geometry nodes to an object it actually adds a geometry nodes modifier and you can see that when we plug that up it added this density factor so you can now just drag this value to change the amount of density but instead of using a value from 0 to 1 i want to use the weight paint that i've created so i'm going to click on this button right here and this is the input attribute toggle so now right here instead of adding the number value we can add an attribute so i'm going to click right here and you can see there's some different things you can add but i want to add the point group float and when you do this that is going to use the weight paint and just to make sure you're using the correct weight paint what you can do if you still have this object selected is you can click right over here on the object data properties and then you can open up the vertex group tab and you can see that here is the weight paint that we created and you could just rename this so i could rename this to like nature and then what i can do is i can go back over here to the modifier properties and i can click right here and you can see there it says nature so now if i paint on this weight painting where it's more red that is going to have more of the objects but then where it's blue there's going to be no objects and then if you want to remove weight instead of adding weight what you can do is you can click right here on this draw and then you can change it to subtract so if you change it to subtract now you can paint and you can paint away the red color and so it's going to be more blue or if you want to add more color you can just click right here again and i'm going to change it to add and now you can start to paint and so you can see that now the objects are only being placed where it is red and there we go so i've just painted a little path so i'm now just going to click right here on the weight painting and i'm just going to change this back to object mode and there we have it so that is how you set it up so that you can wait paint where you want the objects to be placed on the plane thank you so much for watching and i hope the tutorial was helpful and if you'd like to help support me and this youtube channel then i'll have links in the video description to my gumroad store and patreon page where you can get 3d models and assets you can get the tutorial files and procedural materials and other blender content on my gumroad and patreon and you can also check out the youtube memberships so if you click down there on that join button next to the subscribe button if you join my memberships then you'll be helping to support the channel monthly and you'll also get some cool perks on youtube so i hope this video was helpful and thank you for watching
Info
Channel: Ryan King Art
Views: 70,290
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, geometry nodes, weight paint, Distribute Objects, geo-nodes, weight painting, blender tutorial
Id: 6LMuT2hN2yw
Channel Id: undefined
Length: 10min 34sec (634 seconds)
Published: Thu Apr 07 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.