Create a Bubble Deformer in Cinema 4D

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
a couple of weeks ago when tagma came up with another tutorial uh link is up there on how to create a bubble deformer in houdini the amazing simon fiddler did it and i'll have all these details in the description text below today we are going to do something very similar to that maybe identical it depends and we're going to use the target effector as a deformer in repel mode and you'll be surprised as to what you can do with that the main difference between a displacer the typical deformation we use to create these kind of things and what i'm creating today the bubble deformation is that in the case of the displacer what happens is that all the points are moved in a straight line along the normal of the point what we're going to do today is we're going to use some other method to create this concave surface between these and you can see that the bubble shapes are much more interesting than the typical displacement let's open a new document and let me use from the tools the doodle doodle paint so i can draw a sketch here and explain exactly what we are going to do now usually when you have a surface and you use some sort of noise or any other way to deform it everything moves upwards from that surface so you get bumps that look like this what we are going to do is take the surface and put some points underneath it these points are going to move closer and further away so they're going to oscillate up and down and what we're going to do is move the surface in the direction of that point from the point of the surface so this point here is going to move in this direction this point here is going to move in this direction and that point there is going to move in that direction so we are going to create something like this and this is basically the effect of a bubble rather than a bump or a displacement so now i can go and remove my doodle and we are going to start by creating the original points by creating a sphere setting it to ecosahedron and i'm going to turn on my core shading lines and i'm going to change the number of segments to 24. then i'm going to use a matrix object in object mode and this is going to reference the actual sphere and i want one point on each and every one of these vertices so let me go and set the distribution to vertex which is basically another name for a point and to start adding some sort of randomness i'm going to use the matrix with a mograph push apart effector over here push apart and what i'm going to do is change some parameters over here i'm going to set it to 15 just so we can have a slight variation in the position of our points you don't have to do this but i just like it because it gives me a nice little effect now one thing i like to do is just put things in a certain order and it helps me work a bit better i'm going to leave the iterations to 10 but you can play around with these numbers to change the effect you want now the main thing i need to do is make sure that all these points are inside the sphere so with the matrix selected i'm going to go back to the mograph menu and i'm going to bring up a plane effector i'm going to rename it to plane setup because i'm setting up my points and i'm going to use this setup with a parameter of z so let's zero out the y and go to the c and with my cursor in here i'm going to use my down arrow to just move them inside the sphere until the last ones go in and you can see around -14 somewhere like that works now i can go and turn off the sphere because i don't want to see it and you can see that nothing particular happens yet so the next step is going to start moving them inside and outside and again i'm going to select the matrix and go and add another plane effector and this time again i'm going to set the z to a value of 20 and for this value over here i'm going to mask it by adding a falloff in the form of a random field and i'm going to go down here and add a random field now if you go and set the animation to 500 because i want it to animate quite fast and increase the scale you will see that these are going to start changing the way they are being randomized and this is the motion of these points which i'm going to use as a reference and throughout my project i'm going to change these numbers to adjust them to whatever i want but the facts of the matter is that we have some moving points so now i'm going to go and create my final sphere and i'm going to set this again to ecosahedron i like the topology but this time i'm going to set the segments to 250 so it's quite dense in order to move the points of this sphere i'm going to bring it down and name it sphere 1 high res i'm going to go and add a target effector i'm going to make it a child of the sphere because i'm going to use it as a deformer in points mode now nothing's going to happen yet because i need to tell the effector that the target mode what it's going to target is not an object but it's the points we're going to find in a field and actually it's not even the points it's just the values of a field so set this to field direction now the other thing you need to do is to activate the repel and the repel is going to access the points of this object let's move on now to the actual object that's going to create the repulsion in the falloff i'm going to drag my matrix as not a mograph object because the mograph object in a field list brings in the weights of the mograph object i want to bring it as a point object now let me make a slight digression at this point a matrix object although it's a mograph object internally it's just a set of points so cinema 4d has the ability to see it as a point object an object that has only points and no polygons or edges and that's why we're going to use point object so activate point object and immediately you see this horrendous thing happening so first of all let's remove the value and just make it work with the direction because the target effector predominantly uses direction and if i select this just make sure in the direction the length is set to use value now if we go to the effector i can use this value to control how much it's going to repel so you can see now that this effect is quite different from a simple displacement because it moves from each point and not in the normal direction now if i go and press play to see this animation you can see that many weird things are happening the most obvious thing is that when one of these matrices goes above the surface it's actually pushing the points inwards and of course that makes sense because it's outside the object it's going to push them in the opposite direction at this point you can go to the plane setup go to the parameter and just move them further in your object so that we have none of the objects outside or you can go and control this plane and make the actual value it's moving up and down a bit different once you've stabilized this part so nothing goes inwards you can go to the target effector and increase the distance to create the size of the bubbles you wish to have and you can see it's quite interesting don't worry about these jaggies here we're going to fix them quite soon so you are going to adjust how these bubbles are going to move in and out by changing the parameters of the plane the plane setup and the target distance repulsion now let's go and make this a bit more tame let's go and make sure that it has no jagged edges anywhere and what i found works really nice in this particular case to solve these problems is to go and add one of our new smoothing deformers but not this one but the delta mush this deformer is predominantly used for character animation to create nice smooth surfaces when you have overlaps certain elbows and armpits and stuff like that but we are going to use it just to smooth our mesh make it a sibling of the target and go and make sure when it's selected that the smooth view is on and the reason is if it's off you may start seeing some artifacts in this particular case they're not very visible but you may see some polygons just fly out so just turn the smooth view all the way up to 100 and you can see now that the model is quite nice and smooth and it's still very very performant and you can see the nice little bubbles so once you've done this you can just go and play again with the plain setup the values or the plane value itself to push things up and down so that you get exactly the shape of the bubbles you want at this point what i want to do is make sure that this rotates as well i want these bubbles to move around and to do that the best thing you can do is get the sphere and rotate it because it's the source of the points now for some odd reason if i rotate the sphere here nothing will happen but if i go and add keyframes it will work so select the sphere go to the coordinates make sure you're at frame 0 and let's add a keyframe on the h rotation and i'm going to extend my animation to 180 frames and go to frame 180 and set this to 180 degrees and add a keyframe and to make sure that this is going to play at a linear speed right click on the h go to animation and bring up your f curve now if for any reason you can't see the f curve make sure your automatic is active or just go and drag the object you want in here so now with all the points selected so just click here and press command a and click on linear this guarantees a constant speed and i'm going to zoom out a bit because now i'm going to select the actual track select the track over here and in the attributes you'll be presented with the before and after and i'm going to set this to continue you can see now this black line goes all the way down and this one here is going to go all the way up when i switch the after to continue so now we have a rotation that goes on forever despite the length of my animation so everything looks quite good but there are a couple of things still we need to add so number one i want to be able to identify where these bubbles are because i want a different material or a different color up here and to do that we do need to do something to the sphere we have to make it editable so select it press c on your keyboard and now the sphere is editable and the reason now we need it as editable is that we're going to create some vertex maps but we're not going to do it manually we're going to right click and go to the rigging tags and bring up what's called a tension tag this tension tag has multiple functionalities one of them is to create a stretch map which is going to give us in the form of a vertex map the vertices that have stretched so it's going to give us all the bubbles now there is no vertex map so you can go to the stretch map right here and make map and it's going to create this vertex map you can see it doesn't look good yet so select the tension tag deactivate the deformers make sure you fix the tension to the current tension so that it records the length of each edge and now when i turn these on and select this you will see that now it adds a value of one to all the vertices that have stretched where the edges from small have become bigger now let's go and smooth this out because this is on or off go to the tension tag and just increase the amount now the problem is that for me to see the vertex maps i need to select the vertex tag but i want to select the tension tag so let's go and create a material and apply it so just go down here double click create a material and i'm going to go to the color channel i'm going to turn off the reflectance and go to the texture and in the effects i'm going to add a vertex map click on this and drag this vertex map in here fantastic now i'm going to close this and i'm going to apply the material to the sphere and now i can select the tension tag and at the same time see the colorization which indicates the value of the vertex map if you go to the amount and start increasing it you will see that you can control the contrast of that tension that stretch map that's stored on the vertex map and therefore you can control the value that gets transferred depending on the amount of stretching so i'm going to put it somewhere around i would say 25 and i can always go and change it and you will see if i press play now this adjusts depending on the bubble size how much it stretches excellent let me rewind if it doesn't update just press a to force an update in your viewport and continue now there's one more thing we need to go and fix and uh before i do that just so that i can see this better i'm going to go to my material and instead of using black and white which is basically values from 0 to 1 i'm going to go over here and with the vertex map already loaded in my texture i'm going to go over here and add a colorizer by default the colorizer is going to apply a black and white gradient so now i can go to the gradient and load the preset the heat seems to work well i'm going to remove the black and remove the white and just stretch out the yellow and the red and i can see something which is a bit easier to manage a bit easier to view what's going on now let's go down here and see what's happening this is the final problem we're going to solve and it's certain intersections because these bubbles actually inflate there's a good chance that two neighboring bubbles are going to overlap for most cases that won't be a problem but i'm going to show you how you can go and change that so we can avoid the overlapping and it's based on a technique i developed in one of my previous videos i think i'm going to link to that video if you want to go and see it that was about cell packing creating avoidance of cells in order to do this first of all i'm going to take the sphere hi-res and i'm going to go and create an instance because this instance is going to be the final thing we're going to render let me turn it off for now i'm just going to keep it there for the time being now select the sphere high res and go and create a volume builder and make the sphere high-res a child of the volume builder let me pull out select the volume builder go to the object set this to something like five but change the mode to fog and what this does is it creates a fog volume where all the volumes that happen to be on the surface have a value of zero and one voxel in and the rest of the object is filled with ones so anything on the surface will be zero and anything inside the surface will be one and because inside the surface means that these two overlapping surfaces happen to be inside the volume because they intersect their own mesh that means that we can use that as a way to make some sort of avoidance the way i'm going to do it so i'm going to turn this on and i'm going to hide this and now i'm going to activate the instance which is just a copy of this sphere over here and let me turn off the render as well what i'm going to do is go to this sphere and add a smoothing deformer make it a child and you can see everything smooths i don't want to smooth everything i want to smooth only those parts of the surface that intersect the surface itself so the overlaps so go to the smoothing go to the falloff and remember where is that data stored it's actually the volume builder bring it in here as a volume object and what you will see i'm going to go close we don't have overlaps anymore let me just turn it off and on you can see that the maximum impact of the smoothing deformer occurs where the object intersects itself and therefore we've created a quasi collision avoidance with the mesh itself it doesn't fall on itself anymore fantastic just for good measure i can go and add one more smoothing deformer and put it underneath i'm going to change the settings of this so that it has a bit of a smaller effect you can see it just smooths out a few of these things without affecting the rest of my mesh and now i have this object which animates has bubbles and does not intersect from this point onwards it's up to you to do whatever you want with this and you can save an alembic if you wish and as i said before if you see any inconsistencies between where the data should be and where it is just press a so that it updates maybe you need to press it a couple of times but it's just a small priority issue that won't be a problem if you bake this as alembic talking about alembics let's go and save this as an alembic file so right click and bake as alembic now that the alembic has been baked what i'm going to do is i'm going to take this material and drag it onto the alembic i'm going to cut it from this scene open a new scene paste it in and you will see that we've lost the connection with the vertex map because i use the material from another object with a vertex map so make sure you select the color go in here then go in the vertex map and you can see it's empty just make sure you drag the vertex map over here and now we can have a near real-time playback over bubble deformer what are you gonna do with this it's up to you but this is the technique well i hope you enjoyed that so don't forget share like subscribe follow me on twitter and keep an eye out for more tutorials and always remember noseman knows
Info
Channel: Athanasios Pozantzis
Views: 10,170
Rating: undefined out of 5
Keywords: Cinema 4D, C4D, R21, S22, R23, S24, Voxels, Bubble, Deformer, Target, Effector, Volumes, Texture, Points, Knowsman, Nose, Noseman, cineversity, Maxon, 3D, 4D, VFX, software, Procedural, MoGraph, Motion Graphics, Entagma
Id: JOIM4XO4TaU
Channel Id: undefined
Length: 21min 17sec (1277 seconds)
Published: Mon May 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.