Making Foam (Circle Packing) in Cinema 4D Scene Nodes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone let me show you a quick way in Cinema 4D scene nodes on how to create this and it's very simple and in the process we're going to learn one specific node and a way to set up things so we can create object manager generators so let's just create a new blank scene and the basis for this is an object group so go and type object group object I can't teach you how to type so here it is object group and just drag it in here right make sure it's the one that's called object group nothing else so you can close this now now um you can go here and you can double click and get your node editor but I have my own layout so I'm going to select this and we are going to put just one node in here so that we can create that now let's begin with a couple of input objects number one I'm going to use a disk as a surface to distribute those circles and of course a circle that is lying on the X Z plane so with a circle selected go to the object and set it on the X Z plane now how can we get these two objects to be read by this node setup so that we can do something with them the way to do that is first of all I'm going to put these as children so we have child one and child two you need to go to the object group node graph and you need to go here and right click and just add an input clicking on the add new input so there you go here's an input the next thing you need to do is right click on this input and go to the edit Port because we want to tell the node system that this is expecting an object and don't be afraid of this interface just go here where it says scene Port mode and set this to object that's it just go and close it so this is expecting an object but an object itself if you select any object in the object manager it has some colors basic visibilities coordinates the object parameters and all sorts of things so we need to tell this input which parameters of a potential object we want to use and we are going to use right click go to add nested port and if you go down to this flight menu you'll find the object bundle this object bundle has all the data an object can provide to us and all we need in this particular case is the geometry and now you will see that we have this nested input called geometry and this is going to read because it's the first input we added I can just go and name it one I double click and edit that this is one and this is going to read the first depending on what is higher on this list if you have more than one of these inputs I'm going to go and add another one so right click let's go and add a new input again let's right click on it and go to edit Port scene Port mode Let's go to object close this let's name this two and right click on the two go to add nested port and go to the object bundle and add some geometry so this now reads the second object in your hierarchy if you take this and you change the hierarchy level then this is going to be the first one this is going to be the second one so just make sure you name them appropriately so you don't have any problems now the node we're going to use to do this is the distribution [Music] and I'm going to use the go down here surface scaled blue noise distribution let's bring it in here and see what this provides us with now you see that this is a generic node if you right click and toggle the node type this will create one of those nodes where it allows you to link objects and let's open the parameters and see what this does the op expects the object that we are going to clone the circle the one that's going to create those little Bubbles and that is the second one over here this over here is the full object bundle so let's go here and put this over here so now this is going to distribute whatever is the second object and it's going to distribute it because it's in surface scaled blue noise mode on the geometry of whatever we input in here so you can take the geometry from the first input which is the disk and put it over here and all you have to do is take this up which is the combination of everything that has been generated and outputted in our generator and you can see these huge circles now again the way this works is that anything that is a second child of the hierarchy so the circle in this particular case needs to go in the op because it's the Clone and the cloner is the surface scaled blue noise and it's set to surface scale blue noise and requires a surface because it's called surface scale blue noise and we need to put a geometry of an object in order to distribute on now one last thing you need to do is when you're using this and it has various parameters here for example the maximum size minimum size and all that these are essentially multipliers and you need to set this circle to have a radius of one so that the circles are going to be adjacent and now you can see that we get this little bubbly shape now let's select the surface scale blue noise node let's open up a bit more space in our viewport and let's go and play with the parameters to see how we can make this look a bit better first of all maximum size is the largest size of a circle this is going to create and the minimum size is the smallest one I'm going to set the minimum to zero and I'm going to set the maximum let's say to 40. so we get now these circles distributed so they don't overlap each other and what happens is that it's going to try and fill the gaps using a number of circles at different scales currently we have only a hundred of these so let's increase this to three thousand so we get a lot of tightly packed little circles the other thing which seems counterintuitive but it actually works is this improved packing now you would assume that the improved packing will become better as it grows but it has to do with the accuracy of the adjacency of these circles as far as I understand it in order for these circles not to pop because now if I take the disc and move it in and out you will see that depending on its size it's going to generate these circles but we see all this popping and that's because it's trying its best to make the circles be very accurate but we don't want accuracy we just want stability so select this and set the improved packing to zero and you can see they're all white now and now if I go to the disk and change the size you will see that we don't get popping we just get these growing bigger and smaller and you can go and adjust the maximum sizes maybe you want the maximum size to be 20 instead of 40 and all that nice stuff and there are some other parameters you can change the distance between them so they are not adjacent but you can create all sorts of polka dot shapes and all that now that the setup is ready you may want to expose some of these parameters to your generator because in the generator now you don't have any of these parameters so the best way to do this for example the sample count if you press Ctrl or command on your Mac and click on this it will expose it over here on the Node let's get the minimum size the maximum size the distance and maybe the seed anyway uh let's assume that these are the ones I want now all you have to do is just take each and every one of these go here and just propagate these ports and the propagation is going to expose that parameter on the generator itself there are ways to group these and do all sorts of interesting things but I'm not going to deal with that right now so now I select this I have the operator which has all my parameters here from this point onwards you don't need the node interface so you can always double click to get it let's go back to my startup layout and now we have a fully functional generator let's call this guy bubbly bubbly and we can add as a first child the object we want to put these on and as a second child what we want to clone and of course you'll ask me what if we don't want uh circles and we want spheres well we're going to do that in a moment now one thing I want you to pay attention to is that this is generating a bunch of splines so you would assume that if you get an extrude object and set it to Y and set this to let's say 20 and you make this a child that you will get extrusions you don't you get only the first object that appears over there now if you select the extrude and state hierarchical then you're going to get everything but there's also that multiplier based on the scale because it's just scaling the objects therefore the product of that is going to be scaled up so don't use hierarchical unless this is what you want to do and everything should work this is not that bad you can create some interesting things what I would say is that instead of using the hierarchical unless you want it all you have to do is get a connect object deselect the weld we don't want any welding to occur and make sure your bubbly is under this so this is going to generate a single spline and all the scaling and all that is going to be eliminated it just takes a geometry and now you have your nice little generator let's put the distance zero let's go closer here and let's go and change maybe the number or you can go to the disk or you can move it around and create these things now again instead of a circle maybe you want a sphere so let's go and generate a sphere let's make sure the sphere is one because that is the let's say Baseline number so that all the scaling is going to work you can remove the circle from here and put the sphere as a second child and now you have exactly the same thing using spheres hemispheres or other objects and this is not a bad effect so I hope you enjoyed this and it gives you an opportunity to get into nodes a bit it's not the easiest thing on the planet but it's a very interesting especially if you are technically inclined and curious let me know what you think
Info
Channel: Athanasios Pozantzis
Views: 14,815
Rating: undefined out of 5
Keywords: Cinema 4D, C4D, 2023, Animation, Noseman, cineversity, Maxon, 3D, 4D, Mograph, VFX, Effects, Nodes, Scene Nodes, Geometry Modifier Group, Deformers, Modifiers, Clones, Cloner, Surface Scaled Blue-Noise, Circle Packing, Hierarchy, Object Manager
Id: F82AuduoN_g
Channel Id: undefined
Length: 11min 59sec (719 seconds)
Published: Mon Feb 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.