Advanced Vellum Workflows | John Lynch | H17 Masterclass

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my name is John Lynch I'm a senior software engineer at side effects software and this is a masterclass on advanced develop or flows the goal this class is to go through some more advanced techniques in the velum solver that's new in Houdini 17 in particular we're going to look at changing the setup of the simulation over time during the simulation and this can be from something as simple as pinning or welding geometry together while it's running or animating the constraint properties to possibly even creating new constraints over time and breaking them due to the amount of stress or stretch on those constraints we're gonna also talk about some of the more advanced features of LM like plasticity and also look at soft bodies and grains within these same workflows so this is an overview of the topics we'll be discussing in this class I wanted to start with discussion of some of the internals of the velum solver and these are generally topics you don't need to think about too much if you're just doing basic cloths or hair sim but as you start to get to more complex setups or possibly try to debug simulations trying to figure out why things aren't looking exactly as you might expect it's really useful to understand a bit more about what's going on underneath the hood so we'll talk about what XP BD is at the extended position based on the AMEX algorithm and how vellum represents data the difference between first and second order integration what that even means and what that means for the simulation graph coloring and how that affects solver performance what graph coloring is in the first place I will also talk about the solver iteration choices the parameters there that control different aspects of the simulation both for collisions and constraint solving then we'll move on to pins and welds pins are a way to hold geometry in place welds are ways to attach geometry together I will also discuss the difference between hard geometry attribute based pins of Wells versus using constraints which are soft moral can act more like Springs and as well as how you might break those pins and welds either programmatically or as a result of stress or forces in the simulation we'll talk about how to animate constraint properties during the simulation how to create new constraints dynamically as well as breaking those and then we'll talk about some of the more advanced features of LM like plasticity and soft bodies and grains so the velum solver is a an example of a position based dynamic solver and we've had one of these in Houdini for a few releases now in the grain solver and the vellum solver is sort of a continuation and extension of the grain solver in a lot of ways they're similar in that they operate on constrained particles so you have what essentially looks like a pop sim a particle simulation except you have the addition of all these constraints that determine how the various particles interact with one another and you can use those constraints to make things like cloth and hair and soft pies and all these things that that bone supports and an important aspect of the way you represent this data similar to the grain solver is the particles and the constraints are just geometry with attributes so the particles are just points they have lots of attributes that represent the dynamic state of the simulation and the constraints are also just primitives that have attributes as well so things like stiffness and wrestling and all of those things can be manipulated with all of this sort of regular soft tools that exist in Houdini so vex wrangles attribute create I have to read randomize any of those tools multiple tools that we have for manipulating attributes can be used on the dynamic state of particles or any of the dynamic state of the constraints as well which which ends up being really powerful all of these constraint types are configured in Saabs with possibly chained velum constraints ops and these are all you know for all the various types of constraints that velm supports the solver itself is just a Houdini digital asset like a lot of solvers in Houdini and so it's Microsoft or based meaning it's a bunch of split up into a bunch of solvers within it that each do basically one operation the constraint solving is done with OpenCL on usually on the GPU the collision detection resolution is done with the detangle stop which is C++ but everything else is pretty much index so the particle and constraint logic is index in particular things like braking and plasticity and updating from rest geometry is all in vex so it's a sort of thing that if you really are sufficiently motivated and interested you can find the vex code that does all of these things and really understand more about exactly how those operations work so existing based dynamics is fast stable method for solving constrained particles like we talked about its GPU friendly so especially if you find a good way to separate up the constraint primitives so that you can solve them all at once on the GPU without any conflicts which is what graph colouring does then you can get really fast constraint solving on the GPU and we'll talk about how we do that you've probably seen this before but the basic position based dynamics algorithm at least for first-order integration is to store the original position of of the particle and you take one step forward we've given its current velocity so that's the the P equals P plus V times the time to increment then you update the position to satisfy all the constraints resolve any collisions and just calculate velocity based on the change in that position the first order integration approach shown here has some issues with things like damping out the energy in the simulation and will actually look at that in just a second there's actually some other sort of more sophisticated options within Belem but this is the the basic algorithm and on top of that a velum actually implements the extended position based dynamics algorithm which is sort of newer research and the three important things it gives gives the solver our iteration and time step and variant stiffness and so what that means is it's an iterative solver but if you find out that you need to for instance you're a very fast-moving collision so you have to take extra sub steps it won't actually go to infinite stiffness which was a problem with position based dynamics essentially all the constraints were sort of infinitely stiff but if you want something back like a spring that isn't very stiff at all then you want it to no matter how many if you take a huge number of iterations because you have super fast moving collisions you need lots of sub steps you don't want the behavior of the simulation to change I should point out that this is true as long as you've got enough iterations in the first place to actually converge to the proper solution so it's not going to magically make it so that you can only use it a couple of iterations and everything gets solved but once you use lots of iterations if you have to because of things like fast moving collisions you're still going to get the same behavior it also provides per constraint damping which is really useful to dial in particular looks and it also gives an estimate of the work done per constraint which we call stress and all of our user interface elements it's a little bit of a misuse of the term but it can be really useful for some effects like braking and it's also just really useful for visualizing where the the work is being done by all the different constraints so now let's jump into Houdini and look at how vellum represented simulation data so to set this file up I just created a very simple grid and chose the vellum cloth tool to send up with cloth and a torus object and excuse to the surface Collider tool so if we go into the auto down at work we'll see that we've got this primary object here and then we just source the geometry data into it and this is how pops works how the grain solver works and so again you're seeing that the vellum saw was really continuation of those ideas and the data itself the daps data itself is stored in two separate pieces of data off of the main vellum objects of the geometry is again this is like the particle data for pops and it stores which is basically the dynamic state of all the points within the system so you get things like position and velocity and P scale or the size of the particles and their mass and over time you can see these the solver is essentially updating the the dynamic state of of all these attributes and it's doing them in accordance with these constraints which were represented over here so you'll see that there's points here but they're actually just corresponding to the same number of points that are in the main geometry so there's 900 points in each one but there's actually no attributes here no no attributes except for position which has to be there all the data is really stored in the primitives which are the constraints themselves so if we get rid of this we want to see things like stiffness damping ratio and type stress for example we can see all the different constraints types there's been types and there's distance they all have oh and add a slice to that and they all have a rest length and the stress here is what we're talking about before which is part of the XP BD algorithm it's basically an estimate of how much work each constraint is doing it's kind of an output variable or attribute him from the solver so all these typically in the most basic simulations all of these attributes can stay primarily constant but the stress is going to be updated and with estimates of how much work these constraints are doing we can actually visualize that over here if we go to our guides and show guide geometry we can have us like stretch stress for example or the bends trust so this is the how much work is being done by the the Bend constraints so we can see you know in this sort of higher Bend areas there's there's more work being done by those constraints to try to keep things flat although we have very low that stiffness so it's not they're not really doing that much work but you can you can see where those constraints are operating and then if we go to where this was actually set up which is in the grid object so if we look at the velum constraints off in the first place this is where that data comes from we have two outputs from the velum constraints off and the first one is the geometry and the second one is the constraints and again we're just seeing that this corresponds to that same data that didn't just gets ingested into Dom's so as we change things on the con the velum constraints solve things like like so let's do let's go look at our we can change things like the P scale the thickness change the mass and if you notice things like we pinning a point also can have an effect it can do things like setting the mass to zero so and we'll talk about more a lot more about what pins actually mean but so this is actually saying that if with the math of a mass of zero this point actually can't move and then the constraints themselves similarly as we do things like change the wrestling scale we'll see the wrestling change as well that's being stored here so basically the velum constraints solves our ways to create this data in the first place and then manipulate the attributes that control the simulation and with tracking both pieces of geometry both the particles and the constraints the particle points themselves and then the constraint perimeters as well now we talked about the data that the velum solver uses to represent the simulation and I wanted to talk now about the integration methods that are available in side vellum and there are first order and second order accurate options that generally refers to just how accurate they are with second order being a lot more accurate than first and I want to explain what we even mean by integration so the goal of what's called numerical integration is to move the particles before we solve for constraint two collisions and to compute the velocity afterwards so if we look at the algorithm we had here is basically this step where we update the position before we solve and then this step where we compute the velocity afterwards first order integration uses the velocity at the beginning of the time step and it takes a linear step and that's generally fine the problem is it just does a not very good job of predicting where the particles are going to end up when you have nonlinear motion and constrained particles very frequently almost always have non linear motion sort of by definition they are attached to something else to another particle to a pin something where they're moving in a some sort of curved motion or at least nonlinear so what happens is we will take the first-order integration takes a step that is not very close to where it's going to end up after the constraints are solved and we end up losing energy that way and the constraints will end up taking longer to converge which which means you need more iterations to combat again stretch and things like that so you get a less accurate simulation and it takes longer to solve which isn't a great combination and the reason we care about energy in the simulation is energy turns into things like flapping cloth or a flapping flag in the wind or fine wrinkles in cloth so it's basically losing detail because it's not using an accurate enough prediction of where the points are going to be second-order integration does a better job of retaining the energy because it uses the previous time steps position and velocity to do a better job of predicting nonlinear motion so the initial position of the point before the constraints of salt is going to be closer to where it's going to finally end up once the constraints are actually solved for so we lose less energy and we will converge faster which means we can get away with fewer iterations the downsides are it requires storing that extra time steps worth of position velocity data and it can in some situations cause bouncing artifacts particularly with collisions I want to demonstrate that and talk about how we can get around those problems okay so we're in Houdini with a very simple setup here this is just a line that has ten points on it two meter long and we set up the constraints on it to make it act like a basically like a stiff rope it's got string constraints so it's got a distance constraint that makes sure that each one of these line segments retains its original length and then it's got a constraint on each of these angles to make sure that they stay something close to straight sounds like a stiff rope and then the velum solver itself this is the the soft version of the velum solver and we just turned off collisions we've turned off this drive with this wind drag or air drag and really that's it we are also visualizing the stretch ratio so if it play here you'll see that it's actually retaining a lot of this energy if we started if we retained all of our energy we'd start here and we'd end up over here but we're pretty close and doing a pretty good job and there's very little stretching happen happening with the second order integration if we switch to first order you'll see we lose a lot more energy it damps faster and then at the beginning we also get this stretch through here so this section here we're actually getting a fair bit more stretch and that's a result of the fact that we're doing kind of a worse job predicting where the where the particle is going to be before we solve for constraints so if we look at the attributes this is what I was talking about before we've got this sort of P previous and B previous are just the velocities at the beginning of the time step and then we've got the position and velocity at the end of the time step this is what first order so there's a little extra data but not too bad once we switch to second order we actually get yet another copy this is this last and B last P last and B last which are from the previous time step so if you're looking at the output of the middle solver and wondering why you have nearly identical copies of your position and velocity this is why if you are using something like the vellum IO soft to save your your geometry and constraints to disk which is a good idea it's already got a default for your safe filter to delete a lot of this stuff so a lot of this stuff won't go to disk it really just takes up memory while you're doing the simulation and it does there's a little extra computation involved in in this more accurate integration on the other hand compared to solving for collisions and solving for constraints it's it's really negligible so it's not worth worrying about too much so if we wanted to see why this works the way it does I've got a quickly a couple of different vellum solvers here that I've just modified - this is right here is the sort of constraint and collision loop right here I just am copying the the point positioning to this Petri attributes so we're just saving the predicted position before all the constraints are solved and so what reviewing here is really the templated line is where the integrator predicted it to be and the points are where it actually ended up solving after the constraints you can see there's a fair bit of error here as it moves down it's essentially not doing a great job it's ok of predicting where the point should be if we view the second order we see there's there's a good bit less error about half the air and that actually adds up over time pretty significantly so that's why it's it's more accurate it turns out that we should go back to this one and increase our sub steps so we're doing more sub steps we're doing fewer iterations per sub step so we're ending up doing the same amount of iterations per frame it turns out that the sub steps makes the integrator especially the second order integrator even more accurate so you can actually see where we're keeping pretty much all of the energy in the system as we solve so if you move to more sub steps and you're noticing that your cloth seems a little more energetic a little flappy or a little or whatever this could be why it is actually getting more accurate and solving for the system but it's just in case you're a little bit surprised by that that's why if you find out that you have too much energy here the answer is almost never gonna be to switch to first order because again you're gonna have your constraint solving much slower so generally what you're going to want to do is compensate with air drag or some kind of drug so because again you can put constraint drag as well but this is generally a good idea so if you'll notice we turn this on very quickly all of our energy gets damped out of the system we don't get any stretching or anything like that but we just we lose the energy very quickly so if you've got cloth that you're trying to to make slow down in the air or hair just until it end in water or something like that you're much better off sticking the second order and using these uh using some sort of wind drag here so second order sounds great and all why don't we always use it well we really do always use is it's the default but there is a problem with it and demonstrate that real quickly so we just got a piece of cloth here that is falling down on this sphere and it bounces like crazy and that kind of looks awful and very unrealistic and so what's going on here on this velum solver I've got second-order enabled but I've turned off this max acceleration choice here what this does is as the cloth is falling down it's basically predicting the position of the next for the next time step but if we come upon a collision where we've got this very discontinuous change in motion it does a really bad job of predicting where that points gonna be and it ends up predicting basically a big a big bounce so what we can do is turn this max acceleration option on and in particular this fall back to first order integration on collision so what this does is it checks to see if there was a collision if it is it compares the acceleration that's about to occur to this fairly high number so this is about 10 G's and if it exceeds that then it'll just use the first order estimate and what this does is gets rid of most of the bouncing so this number is possibly a little high this expects acceleration number is a default so if you're seeing bouncing especially with one sub step you can move this down to say 20 still two g's and you get a whole lot less bouncing you still get these sort of you know nice little wrinkles and behavior here but you don't get that big bounce on on the initial the initial stop so what the solver is doing is actually setting this fall back in a jurat to be adhere so we can actually click on that division set a visualizer and you can see where it's happening so basically it's happening where it hits the sphere there so we're falling back to first order there and then we're falling back when we first hit the floor but from then on it is in collision but it hasn't gone past this accelerations just it's getting still very fairly smooth motion because it's just sort of sitting here almost at rest so we're still getting the second-order accurate which is nice even though we're in we're in collision so the other option of course is to just switch to first-order the reason that's not so appealing is you get this kind of very damped looking kind of similar bit so we don't get those nearly as nice wrinkles as we had before and it's just not as good-looking as sin so the default is to always use second-order and it keeps its Mexico acceleration on if you see stand bouncing it's probably possible that this is at this default is a little high so you can set it down to 20 years or even 10 and you should generally get much much less bounce in that way the next topic on vellum solver internals is graph coloring and I want to just discuss quickly what graph coloring means and how it's done with a new Dini and then how it's relevant to the velum solver and in particular how it affects performance and how it can give you some insight into how the how the solver is going to perform with different types of constraints so there's a new saw in Houdini seventeen called the graph color sob and what it does is it segments primitives into independent sets and these are usually called sets of different color to graph coloring or graph theory of term so it's implemented actually in OpenCL this algorithm is it's greedy parallel and iterative and we'll actually see where you can you can see the code it's just written as a kernel with in an open CL saw and once it's done its work the primitives in each color set will share no points so what that means is each primitive that is in this set sher no points with any other primitive that's in that set so if you take a bunch of primitives in a particular color and send them off to for instance the GPU you know that you can be safe updating all of their point physicians and there won't be any conflicts so that's why you do graph coloring is it basically makes it possible to process large amounts of primitives that are connected in parallel and that's exactly what we have when we set up a bunch of constraint primitives so once you've turned these primitives or even assigned colors for all of these primitives the number of colors corresponds to the number of GPU batches so basically we're gonna send off each set of colors to the GPU and process it at the same all at once and in general you want lower numbers of colors because you want lower numbers of GPU batches just no fewer numbers of times that you send kernels to the GPUs is better the other relevant thing for vellum is that it's faster to sort all these primitives by color so that basically you're operating on them next to each other in memory so you'll see where we do that and that's actually relevant to operating with constraints within vellum because the the order that you send them into vellum is me maybe not the order that you see them if you're looking at them within the actual solve because they've been they've been resorted when this graph coloring operation happened anytime that we change the topology of the constraints so let's say we add a bunch of glue constraints dynamically to glue a bunch of hairs to piece of cloth or something like that that basically means that the number of independent constraints have has changed and the topology of that has changed so we actually need to recolor every time that happens so within belem there's a fair bit of intelligence to track the topology including welding and we'll see why that's that's important later and it read colors whenever those that changes so in particular it means that we don't really want to be sending in entirely new sets of constraint primitives all the time in development if we want to change some aspect of a constraint we're better off just changing that one attribute within within the solver itself rather than trying to import a whole bunch of new primitives every time step because every time then it would have to be doing that recoloring which is which can be expensive and so you'll see that any of the operations that effect topology in the velum solver in particular braking braking constraints has options to either operate each frame or each time step and that's because sometimes you can't really tell the difference between if you break something at a sub step but if you are recoloring every sub step because their topologies changed it can actually so this flow the solver down so we've we give a frequency so that if you want you can only break for instance each frame because you may not tell the difference in terms of how it looks but you will notice the difference in terms of performance if you say have five sub steps and you're colouring recoloring the graph all the time so let's jump in Houdini and see what that looks like so here's a very basic example to demonstrate graph coloring we've just got our basic squab here that we're going to run graph coloring on and look at the results so here's this graph color sob that is introduced in 17 and as I mentioned it's actually implemented as most of it most of the algorithm is in open CL here so it's at the parallel greedy algorithm is kind of an interesting bit of code if you want to look at have a look at it it's generally quite fast but we're gonna look at it it's because it is iterative and normally this max iteration defaults to like 20,000 and it just exits out as soon as it's colored the entire set so it usually takes maybe a hundred iterations but we're gonna actually set it to the frame number so we can watch it what's the coloring happen as we play the the frame bar so what this will do is will actually create a color primitive attribute and then we're just assigning a random color for each one of those based on that attribute so if we hit play here we can sort of watch the coloring process or a coloring algorithm executing as if we get to about frame looks like about 130 we've we've little not quite yet so yes about 140 so about a hundred forty eight raisins to color this so as I described before if you look at these like this primitive here for instance has a color that is different from all of the primitives around it that share points so all these primitive here share points with this one in the middle so they all have different colors the next one that has the same color is gonna be this one here and you can see it's it's points are independent as are this one's other this one's and the same thing happens with for instance this blue one so what this means is we can operate for instance on all of these green primitives on the points for all these green primitives at once and we know that they're not gonna conflict and then we can do for instance all the blue ones and we know they won't conflict and same so on for the kind of gray and the dark green ones here so that's generally why we want to graph colors because it lets us then do interesting parallel algorithms on the points for each set of primitives so we're doing another thing here which is we're actually we're sorting the Alpha primitives by color and we're creating these two different sets for detail attributes that are called work sets and these work sets we can actually send off to OpenCL and they actually keep track of these sets of different colored primitives so there's an actually an open CLS op and op mode where they can read these work sets and operate off them in parallel on the on the GPU so that's why we we run this and why we create these output attributes and if we look at the results of these so we can see that we've got eight different colors here a different work sets basically and we can see how big each one of them is each one of these sets so they start off fairly large they end up with the final one there's only a few few primitives in that in that last work set there and we can look at sort of the average size around 600 so we could send this off to the GPU and process it in eight batches essentially and most of these batches are pretty good size we're gonna sort of tail off towards the end there but in general we we would get good performance operating on something like this the other nice thing about graph calling so you can imagine if this was a set of constraints for example we'll actually look at that example real quick in a moment but let's say that this represented some some cloth here and then we wanted to have copies of it so let's make say four copies so we had four different independent pieces of cloth for example well you'll notice that these will actually color at this the same way and they'll actually color to around the same number of colors actually the exact same number of colors so they'll both have eight colors so what it automatically what it does it realize that these are all independent and so it will actually do that partitioning forest as part of this coloring operation so what happens is now we have the same number of batches they're just bigger and that's interesting because the GPU in general works really well with more data and a lot of cases you'll find that if you send you know a thousand items to a GPU to process it's fast but if you then send 10,000 items it's not much slower it's certainly not ten times slower because the GPU wasn't even saturated it wasn't doing all the work it could do when you send it a thousand items so if you've had much experience with vellum you'll sort of find that if you send it some sort of medium resolution cloth one piece of medium resolution cloth it's quick but then if you send it ten pieces of that same medium resolution cloth it only slows down a little bit and that's actually that this is why because essentially we're sending more and more data to the GPU more in these larger larger batches to the GPU there's course a limit so as you get to maybe a hundred pieces it is going to start to slow down but in general the fact that we can get these sort of automatically partitioned bigger and bigger batches is really nice for performance so if we send this geometry into an actual vellum constraints to to cloth to create from the the cloth constraints and color that instead you'll see it's essentially doing the same thing so this is actually what what we're really doing for vellum is all these difference for instance distance constraint all these different constraints we'll get in colors and they'll be put into the different batches to be sent to the GPU and you'll notice there's there's a lot more of them so once you have all these networks of constraints they actually get a fair bit more complicated so you'll have more batches and for instance here again because we've got these multiple pieces of of cloth we've got fairly big batch sizes across here if we and 27 of them if we disabled the copy we've still got 27 it's just smaller batches so that's just what I was describing before if you look at something like hair here and we colored the results of bad these are actually really cheap so we can see that essentially we because the hair the topology of this hair is so simple we end up with only four batches here so this is very fast to send to the GPU that constraints themselves for hair are actually fairly complex but because we can we can bash it up into such a small number of batches to the GPU it actually gets really nice performance and as you again as we move to lots of hair so let's say we need 500 hairs all all that happens is these batches get bigger and this is really why vellum can solve hair very quickly uh or at least from the constraint solving perspective because it's just it's a fairly simple operation in terms of number of assets that need to be sent to the GPU that constraints themselves are expensive but they're they're batched up very efficiently on the other hand if you look at something like a tetrahedral constraint so if we if we tetrahedral eyes that squab and create distance constraints along all the edges and create internally a bunch of tetrahedral tetrahedra that we're gonna maintain the volume out so this basically makes a squab soft body and we graft clear that we'll see that we have 80 batches which is a lot so then the reason is if you look at some of these internal points they're just they're affected by a huge number of constraints so all these constraints all these distance constraints along each edge all of the volume constraints for each one of these tetrahedra so that's why these can get a little more expensive again the constraints and cells aren't that complicated that there are a lot of batches to be sent to the GPU as you create more and more of these you have the same number best as they just get bigger and then finally I just wanted to show you where that option on the vellum solver is right here this braking frequency that's why we have we can turn it off completely but then you have per frame and you have per sub step and again this is just for performance it because we have to re graph color every time you change the topology and you may not notice if you don't actually break every single sub step you can choose how you want that to work just for performance reasons for the final topic of velum sulfur internals I'd like to talk about solver iterations so Velan is an iterative solver which means that it's solving constraints over and over again as well as solving collisions over and over again and in general the more iterations it has to do that it the more accurate it's going to be in particular with constraint iterations if you don't give it enough iterations you're going to see stretching in in cloth or springs or insufficient stiffness for things like bending in general if you need more stiffness or if you're moving to high resolution geometry you're generally going to want to increase those constraint iterations from the default as we saw from the integration examples earlier sub steps are actually better than just increasing the constraint iterations because you're actually going to do a better job in the integration step of predicting where the final position is going to be and it's a smaller time step so the constraints actually have to do less work so you're probably better off in terms of accuracy using five sub steps and 20 constraint iterations rather than one subset of the hundred constraint iterations but it is going to be more expensive just because each subset has more to do collision iterations usually with the detangle stop are interleaved with constrain iterations at a lower frequency and so what that means is at the default of ten collision iterations and a hundred constraint iterations for every one collision iteration the solver will then do ten collision iterations so the collisions are like the outer loop and they will generally run at a much lower frequency than the constraint iterations and you'll you'll maybe have ten of them while you might have a hundred or 200 constraint iterations and the reason for that is mainly just performance the detangle stop and collisions in general are just very complicated and time-consuming so in an ideal world you would actually be able to run those at the same frequency and we'll actually see an example where that starts to become more important or at least getting those frequencies closer so you'll need to increase those collision iterations when the collisions are fighting against constraints or other collision objects so and again we'll see an example of needing to do that and finally there's smoothing iterations and smoothing iterations are there to smooth out any constraint error so smoothing iterations are getting confer constraints and they're to smooth out error for impossible configurations what I mean by that is situations where you might have infinite stiffness on say some spring constraints are still our distance constraints but then you're trying to stretch them over a collision or or just with two pins on either side and there's basically no way to accurately solve it so you're gonna get some error but you want that error to uniformly spread across the geometry and this is what smoothing iterations helps you do so from a more technical perspective smoothing iterations are a Jacobi way of solving the constraints versus the gauss seidel which is the default for constrained iterations and again we'll see an example of that in just a second so let's move over to Houdini so this is a simple file to show some of the issues that can come up with solver durations I don't want to give a quick thank you to Thomas Lang chick I said that Wright who is one of our excellent alpha testers who gave us a file similar to this to highlight some of the issues he was running into testing vellum that really helped us sort of address these issues in the solver so this example here we just got this grid we are adding distance constraints along each edge so we're not we're not triangulating anything here we're not adding any Bend constraints these just like as if we're adding putting very very stiff Springs along each edge and then we're pinning each side and on those spring constraints on those distance contractually setting the rest length scale to 0.5 so were shrinking down all of these Springs by half but at the same time we have an extremely high stiffness is almost an infinite stiffness so it's kind of an impossible configuration to solve because we've got infinitely stiff material that we're shrinking in half and if we try to solve this with I've changed a few of the settings in particular I've taken away any smoothing iterations we'll see we get this not very attractive solve at all and so what's happening here is we're getting some error because this is an impossible configuration but because of the way we do this solve in those batches I was describing in the grass coloring we're actually biasing that error towards the first batches that get solved they kind of get a lower priority and then the ones that come along later will actually kind of get higher priority and so they'll get solved correctly we can actually see this if we so we're gonna take the constraint output from the so these are actually the distance constraints themselves that we're looking at we're taking the second output of the velum solver and we're gonna we're gonna just regress color them and we will have a visualizer on it so we'll look at it we'll see that the ones that get stretched really bad or all this same color and in fact if we select a few of those and look at their color it's all zero so these are the first ones to get solved and then these ones come along later and they basically get solved correctly in particular the ones that are colored two are gonna be solved last and most correctly so the error gets distributed unevenly so the question is how do we fix this and the one way to do it is to say well let's just make this no longer an impossible configuration let's make a much weaker Springs along each edge and now when we hit play we will get this nice distributed there's and there's not really any error and everything's nice and even the problem is that that's really not what we were looking for we didn't want these weak Springs we wanted a very a very stiff difficult to stretch material so this isn't a great answer so it turns out what we can do instead is increase these smoothing iterations we can even just go to the default here of ten and see that that basically smooths out all of that error and so what's what's happening here is we're solving the constraints again we're doing another pass through the constraints this time just doing ten iterations but rather than updating the point positions immediately we're accumulating the the updates that are going to be made basically sort of the deltas the the change in point position and then we're averaging them all together so we're running through all the constraints getting all of their point updates and then averaging that together which effectively averages out the error and smoothes out the error so it gets distributed across all the points instead of being towards the ones that get solved first where the constraints that get solved first this is pretty effective it's pretty cheap it's only applied to distance constraints so it doesn't have any effect on then constraints or anything like that so a logical question might be why don't we just solve everything like that and and I should say the smoothing iterations that's a Jacobi style solve is more the more technical term and their regular constrained iterations are a gauss seidel or you immediately apply position updates and like the grain solver works with these type of iterations what Jacobi style so why don't we just use that and since this is only distance constraints we can actually try that we can switch all of our solving to just be these smoothing iterations and when we hit play we'll see sure enough we get this nice smooth geometry but we don't really get the stiffness we're looking for at all in fact it turns out that this style of solving it takes much longer to converge to the proper answer so that's why we use this gauss seidel of this immediate mode of solving as a default and then we just use that kind of hybrid of to smooth out any air that might come when you get impossible configurations which happen a lot with cloth simulations because you've always got characters that are moving their arms or impossible ways or stretching things that shouldn't really be stretched so when the error does occur you want it to be smooth so this is an even more sort of challenging set up here on this side we're taking the our fitness pig head and turning it into a sphere and then extending that out a little bit so we've basically got I was sorry then we're turning it into cloth and setting the pig head as a collision object and again we're using a rest scale of 0.5 but we have extremely stiff cloth so ideally what would happen is the cloth would would stretch as much as it could over this and and sort of shrink wrap the pig but in a very sort of tight way there's not going to be a lot of excess and drapey cloth or anything like that but if we hit play here misses a set up with pretty much defaults we get a not very nice solution so we've got two problems going on here one is that error that we were talking about before things aren't really distributed very nicely as we've got again this sort of a configuration of infinitely stiff cloth or non stretchy cloth shrunk down to sort of an impossible degree and so the error gets biased again so we can fix that fairly quickly by again going back and just going back into the defaults of ten let's actually just try 20 smoothing iterations in this case and that works pretty well so we can see okay now we've done a good job of smoothing out all this error but we still got this problem around the ears and this is a result of the lower frequency of solving of the collision iterations so that we're talking about before the defaults of collision passes is 10 and constrained iterations is 100 and what that means is we're doing one collision pass for every 10 constrained iterations so if you've got extremely stiff constraints around a collision like this essentially the constraints are winning so they get to update their points ten times as often as the collisions do so when they're fighting they sort of get priority and so you get the same kind of non-uniform stretching here which is not good it's also pretty noisy but the main way to fix that is is just to increase the clusen passes and so we could also do that with more sub steps but if we're trying not to do that and let's just increase the occlusion passes to 50 and you'll see it slows down a little bit not surprisingly because it's doing more collision handling but we get a much smoother we still get a bit of stretching here which is not too surprising but we get a much smoother result writer here all around the ears and around the nose and sexually starts to look pretty good so this is a tough configuration to solve because we've again essentially got an infinitely stiff or almost infinitely stiff material stretched very tightly over this sort of complex collision object so this is actually a pretty good result for just changing a couple of parameters and actually the smoothing iterations obviously are on bond by default we've increased it a little bit and then really all we've had to do is increase the collision passes a bit more now that we've looked at the internals of the velum solver let's start looking at ways to control the geometry that it's solving and one of the simplest ways of controlling that geometry is to pin it in place or to weld two pieces of geometry together so wildung for instance two pieces of cloth together and in Velden there's really sort of two different ways to do that there's what we could consider hard pins and welds and then there's soft pins and stitches and so the hard pins are geometry point attributes so we talked about how the solver has two different pieces of data it has the geometry data which is the points the particles that is updating the positions for in velocities for and then it has the constraint geometry which stores all the constraint primitives so anything that is a hard pin or weld is actually stored as a geometry point attribute it's like a particle attribute and when the solver sees one of those it actually is directly updating the point position so it's not solving constraints to move these points around it is updating their positions directly so there's not any ambiguity about where the point is going to end up where its position is going to be it is a hard specification of where that point needs to be so if you want to create and remove these types of hard pins and welds you actually do it by setting those particle attributes and they're things like the well that would be to stop attribute or its mass and in general the only type of auto breakable features that we have for these are for welds so you can have welds auto break or auto release from one another based on things like stress and that's actually how we do I look like fracturing pre fracturing with a vellum or pre tearing and we'll look at some examples of that the other way of doing pinning and stitching geometry together are with constraint primitives and in this case you'll actually have constraints that are solved and that updates the point position so these constraints are solved alongside all of the other constraints for things like cloth or hair there will also be pin constraints or stitch constraints or glue constraints and you have to manually create or remove those constraints those constraint primitives if you want to update your your setup those types of constraints all are Auto breakable and they also can have plasticity so you could have things like a stitch that stretches over time based on force and then finally you can have those pins actually follow target geometry and similar to the wire solver or the FIM cloth solver you specify the target geometry at the solver level and then you can say that the particular pin is supposed to follow that target geometry and that's how you do animated pins and we're gonna look real quick also at how you can avoid some time dependency when working with transforming geometry so let's move into Houdini and look at some of those concepts okay so this is a basic set up that we're using to demonstrate some of the ideas of pinning in particular so this is just a tourist that we've created some we group some points up here at the top and put them in a pin points group then we're creating cloth out of the torus and then we're pinning that pin points group and turning on the solver here and if we play through this will see that the these are pins that are basically moving with the target geometry so this template of geometry is a target geometry and it's it's dragging the cloth along with it and you'll see that it's a very uh it's a very close match where the pins are relative to the target geometry so this is a this is an example of a hard pin where it's where it's updating the position of the points to directly match the target geometry so the way that we know this is a hard constraint is we have this pin type here so the pin type has their three options here it's permanent stopped and soft and the first two are hard constraints and the last one is actually this soft was actually a constraint primitive so these hard pins here are they're two different types of them and the permanent vs. stopped generally refers to whether or not you're going to be changing the status of that pin during the simulation and if you just want this to be a pin that's going to be there for the entire duration of the simulation you can just set it to permanent and it will be just a fixed pin so that's why that's the default and then we have this match animation enabled the orientation pin type is only relevant for hair and it has these same settings it can basically mirror the the pin type of the for the position or it can be soft and so that's actually useful and then whenever we talk about hair there's actually a way you could have the roots would actually be the position would be a permanent position change or a permanent pin whereas the orientation would be a soft constraint which could be useful but anyway we're not we're not going to look at that in this example so we have this match animation which tells the pins to update with target geometry and then the target geometry is actually specified over here and then in the velum solver we are pointing our target actually at this at this external solve over here so if we look at what this pin velum constraints is doing if we look at some of the attributes so what it's actually doing this is actually we're just looking at the pin points group here and it's actually setting the mass of all those points to zero and what that essentially means is they it's like they have infinite mass as far as the solver is concerned so these points can't be moved by constraints that can only be moved by the solver and in fact they are moved because it has this pin to animation attribute set as well so again this is like the wire or the FBM cloth solver that has this pin to animation attribute when it's set to one it will update the point positions to match the target point positions if we turn this off we'll see that basically that pinned animation actually just goes away and if we hit play it'll just stay in place so it doesn't follow it anymore so the other type of hard pin is this stop and what it'll actually do is it will then set the mass similar to all the other points but it will also set this stop attribute and this is useful if you're going to change the status of the pin during the solve and that's because we don't want you to have to try to remember how to set the mass from zero to whatever arbitrary value it is and especially again if you're working with hair there's another value called inertia that affects how it rotates which in some ways is a function of mass so in general trying to set the mass at runtime is just not a very good idea so what we have instead is this stopped attribute which is actually part of pot so any pops particle can also have be set to stop of actually stay in place so we're using that same attribute here to indicate that this velum particle should not update from constraint values for constraint solving it doesn't really look any different if we hit play we'll just see the cloth gets moved around and his pin similar to the one with the permanent but what we can do then is we can jump into so this is the soft based version of the velum solver if i jump into this I've got my where I can apply forces and update this simulation and so I've got a little very simple geometry or angle here it says if the frame is greater than 30 then I want to clear that stopped and that pin to animation attribute and so if I plug that in then after I get to frame 30 these pins are all going to be cleared off and then the cloth will just drop to the ground so this is this is the easiest way to unpin something if you have something that's that's pinned and you want to be a hard pin and then at some point you want it to release you can just set stop to zero if it's if it's pinned animation the sudden you need to make sure you set that to zero also you could also do things like just clear the pin to animation so if you just want it to follow for a while and then and then stop following in stay in place you can do that as well so that's what that's just what is what happened there so then looking at the other way of doing the pinning we can do this with a soft type and quickly the reason you can actually set pins here in the cloth cloth constraint as well that's really just a convenience because a lot of times you want to set a cloth and then just pin like two points and have that be your setup and so you don't want anything something more complicated than that but in that case any soft pin will actually just inherit these same stretch stiffness and damping values so if you want different values you need to use a separate vellum constraint set to pin to target and that's what we've done here so now we've got a soft constraint and if we hit play we'll see that that's what we're that's what we're seeing we're actually seeing the these are pins again and it's updating the the goal position of the pins but because it's soft it's actually got a fairly low stiffness protecting like a spring if we look at the attributes that we created there all the stopped in the met and and pinda animation are all gone and we're just looking at a regular mask here so these are just regularly constrained points they don't have any special point attributes on them at this point we've just got some new constraints and so if we look at these we can actually see that I'm sorry all these out so we'll have all these pin type constraints here at the bottom and here's our stiffness and the rest vector here is the original position and we'll actually see actually if we do this we can look at just sort of type equals pin constraints and we'll see the rest vector is actually getting updated by the solver so this rest vector is it's gold position so that's this value that's getting updated to each each time step and if we wanted to delete those we actually need to delete the constraint primitives themselves so this is gonna miss the velum constraint property we're gonna look at this table and some detail in just a second but for now we're going to just look at this pin group so when we created the velum constraints saw when we created these pin in these pin constraints we turned on the output group so we actually have a group called pins here so I actually could just type this in here as well and it would be the same thing these are all the ones with them the type of pin and then we're gonna operate on that group that group of constraint primitives and all we're doing is setting the remove which is basically like deleting the constraints and we're activating this table after a frame 30 so it's really doing the same thing that this unpin is doing is just doing it for the constraint primitives so if we plug that in we'll see that after frame 30 the constraints go away and you saw that little that little sort of hitch when it when the constraints went away that's actually that graph coloring that we were talking about it's basically having to update that graph when the topology change this so when those constraints go away we actually see just a slight delay when it actually when it updates that that graph calling that we're talking about we can see that if we select this that after frame 30 all these constraints are just gone so that's the differ between hard and soft pins the one other thing I wanted to look at real quickly is why we might set the target path this way the other thing you can do is so this is just a transform that animates that torus around you can also take that take that transform and just put it in line here and then set it to first input this is actually the default and it'll work the same way the only reason you might not want to do that is if you notice we've got these little green time-dependent badge on all these all these stops now so what we've done is we put this animation up here and then all the constraints are also time dependent so we're only actually reading the first input here so this is not that expensive but it can just if you have a bunch of these it can add up so in general it's not a bad idea to use in a separate target or if you want to do it in line and it makes sense for your setup you can actually do the transformation here so at this point the time dependency is just down at this transform it work exactly the same so it's just worth remembering for for optimization purposes that's there's not a bad way to do it it's just set maybe a separate target like this or if you can just add the transformation down right at the bottom right before the solver so now we'll look at hard welds versus stitches which are in a lot of ways similar to hard pins versus soft pins the the first is represented the welds are represented by geometry point attributes and the stitches are actually constraints that have to be solved and the welds are very useful because the solver essentially treats two points when they're welded together as if they're the same point so they won't collide anymore and their positions are always updated to exactly match so if you're trying to connect or attach two pieces of geometry together to make one seamless for instance large piece of cloth it's a really good way to do that and it can also be useful for tearing or fracturing effects because the cloth will look like it's one piece before the welds get released at which point it looks like the cloth has been tearing so let's look at a really basic setup of that real quick I've used the planar patch and stopped here to create two separate pieces of cloth and the reason it's useful is because it has these output groups here for for example this is the right seam of points here and this is the left seam of points here and then from this one and then when we kusa we'll create our cloth and then when we weld them together we can actually specify that right and left groups for the two different edges here and so what we're seeing is these these purple little points represent the welded points together and all we're doing is we're actually doing a constrained the closest point so we're saying each point in this group should look for the closest point in this group and should set up a well between the two and all that's really doing is if we look at the output of this we if we look at the the planar pass one right so this is all these points it's just setting a weld a tribute and if we look at the point number so we'll look I'd say this is ninety eight it's just pointing at one sixty six and the next one down is pointing to one sixty five so this is how welds work is just one point the weld the welded point we'll look at the weld target and they'll just specify as point number there although actually I should say if you have a point IDs you can use point IDs as well and then the one other thing you're seeing these these lines here is because we have this this add bend across welds option on and what that will do is will actually create between these triangles here that are welded together it will create Bend constraints as well that match because we have this copy neighboring stiffness it'll actually inherit all of these stiffness values for Bend so that when the cloth bends it will act like not only is it's attached together by position but it will Bend like the rest of the cloth will so if we run the solvent we've also pinned this point over here so we'll see that the two pieces snapped together and as they thus in sort of goes through it'll start to bend and it just bends nice and smoothly across that across that weld and we can we're just visualized in the weld here so if we one thing to notice is if we undo if we turn off our wire shading we can see there's kind of this line here and that's because there's still separate points the points are actually still maintained separately by the solver they're just update just through their point positions exactly match so if we want to get rid of this line if we want this to be act as if it's one piece of geometry we can use the vellum post process there and has this apply welds option and if we turn that on then what it's really doing is its rewiring oh I've actually got subdivision on to us turn off for a second so you can see it's actually fusing those points together rewiring those points so that there's only one point along that scene and so then if you do something like subdivided sorry you'll see you get this one nice smooth piece of cloth if we didn't apply welds you can see these are two separate pieces of geometry so this is a different geometry and this is a different geometry so when you subdivide along and you get that seam but if you apply weld and we're actually gonna look at exactly what that topological operation is in just a second but just to go back to the solver the other thing we can do with this is we can turn on braking and we're gonna visualize stretch stress and so what we're doing is we're breaking on stretch stress we hit play what we'll see is these welds release and were visualizing the amount of stress that is in these distance constraints that and that are along each one of these edges and we can actually see in the visualization so basically when this red makes it to the welds so I've tied this threshold of for the braking to the visualization threshold this just references that so when the red Basin gets to these welds the welds are looking at the maximum stress on all the constraints that are that are attached to it so it unweld at that point and you can sort of see the stress kind of moves down along this line as as the points are released and we get this sort of natural looking tear obviously this is kind of too straight so we normally wouldn't do with this likely if we were trying to do sort of a fracturing or tearing effect but it's just an example of course so let's turn that off for a second and the other thing we can do similar to what we did oh and I'm sorry we need to do one more thing let's keep that breaking off if we wanted to undo this manually so not do the auto breaking but have control over when we wanted things to unwell again this is similar to the way we did the hard pins so we're gonna operate on the geometry and the the points attributes themselves and we're all we're gonna do is reset them all to negative one so if we plug this in this is essentially unwelded all of the points so not by tearing just doing them all at once on frame 30 so and that's just like saying set stop equal to zero for a pin for a hard pin so it's a similar idea so this same velum constraint saab can just we can switch this to stitch points and so to see soft constraint version of attaching these points together we can do stitch points here and so now what we're doing is just creating constraints little spring constraints between these same sets of points just like the quilt but now we've got a we've got a soft constraint so it's actually a constraint primitive that's represented along this this these two seams here and again we've actually set the stiffness fairly low so it looks sort of like it's Springs so this might be more useful for things like stitching closed a jacket or something like that but where you want something to stay in place or stay closed but you don't necessarily want it to be fused together like one piece of cloth and similarly to the soft constraint if you want to remove something like this you just use a vellum constraint property again we've created a constraint group and we just said to remove and it's the same sort of idea so to say at frame 30 these releases again and just like with the welds we can actually turn on breaking for this as well let's turn this visualization back on although now what we're doing is we're actually specifying a breaking threshold for these constraint primitives themselves these stitch constraints along here so you'll see again as they turn red because they hit that threshold they're automatically removed by the solver so again you get a fairly fairly natural-looking release of the soft constraints in this case so it's worth going into a little more detail on what's going on with welds underneath the hood and also what's happening in this vellum post-process soft when we're rewiring refusing the welded points together this is a really simple example here I've got two lines and what we're doing is creating a weld attribute on the first point group point one here and we're just pointing at it at two so this is as if we were doing with in Belem this is just we're working on raw geometry here but as if we were in Belem and we're saying point one should leave welded to point two and then we're using this soft called rewire vertices we're actually rewiring that primitive that was pointing to one it's actually now pointing to two and because we've got this keep unused points on then point one is still round it's just no longer attached to any primitives inside the velum solver when two points are welded together this is actually what's going on with this constraints the constraints are actually rewired from pointing at the welded point is actually now rewired to point at whatever was welded to the well target so if this point one was welded to something it no longer has any constraints on it all that happens is the constraints of salt is if they're attached exactly to point 2 instead and we just update point one's position directly at the end of the time step that's what makes it a hard and potassium we also disable collisions between these two points so them and when we do this rewire we actually keep a vertex attribute that tells us where the wire was originally done the original primitive constraints so we can undo it and when we undo it it just goes back to the way it was so this is what happens when something gets unwelded does all the constraints that were originally on the point get restored so that's what's going on underneath sort of within the solver as you weld points together and unweld them together and that's why this is a is a hard relationship so basically all the constraints that were on one are now on two and so it looks like it's actually the same point and then the geometry that comes out in from a weld as we saw there's actually still two points here it's sort of hard to see but you can kind of tell that there that there are overlapping points here there's another it's 98 and 166 so in this 98 actually has a weld attribute pointing to 166 so all this is doing the velum post process the supply Wells is doing another this dis saying rewire vertices and it's just pointing it's just rewiring this whole topology so that the point 99 for example although everything that was attached to it is now attached to whatever it was welded to in this case we don't keep unused points we don't want those points around anymore we want it to be fused together like one big seamless piece of geometry which is what it is now so within vellum post-process there's one of these rewired vertices those doing that same work and then we could for instance subdivide this and it would all look like one smooth piece of geometry now we're gonna look at a couple more production oriented uses of welding in particular for doing tearing effects with cloth and using some attributes to control where and how and when the cloth is going to tear to get a lot more control over the effect so a pretty simple set up here we've got our pig head that we are remesh in here to get something works a little bit better as cloth we are pinning the some areas of the cloth just so it'll it'll stay in place and then we're using this edge crack source op to split up the cloth along these there we go along these em edges here so I'm gonna go into some detail on edge fracture and another in a little bit later but for now all we need to know is that we've effectively split up this cloth along these edges here and we've created two new point groups one of the original points that were along this seam for instance here and then the other one is the new points that were created when we did this split then we create cloth from the geometry we pin the points that we were talking about earlier and then we are going to weld all of these pieces back together again and so again we're seeing those little purple points indicating where the welds happened and the little white lines that tell us that we have been constraints across those welds so that this entire piece of geometries can act like one big piece of cloth and then we go into the velum solver and if we hit play what we've got here is we've got cloth pinned at these points that we were talking about we've got a strong wind that's going in the positive x-direction and eventually this cloth is going to start tearing along those predefined lines that we created earlier as these welds create basically passes stress threshold they're gonna unweld and make it look like the cloth tore and if we want to look at the actual guide geometry to see what's on here we can see well so first we've got the the well breaking set we've got a threshold set and it's breaking from stretch stress it's actually set to none here but I'll show you why that is actually not really what's going on so if we are visualizing the stretch stress here we can see that as the stress so that's the red parts where we've where we've exceeded the max stress here the red parts follow basically where the tear is happening so we can see as everywhere it gets red and it starts to tear because that's essentially where the welds are being are having their um so like there's a a tear that's propagating along this well this set of welds here and that's because the the stress of the constraints that are attached to it to stretch constraints that are attached to these wells have exceeded that threshold and if we turn this off we'll also see that same fact that when you are looking at the Raleigh AMA tree you can sort of see where all these splits of the geometry actually exist so you can actually see the fact that it's still separate geometry but then if we run it through the vellum post process that has it'll actually put it back together again as one piece of geometry and we can do things like maybe add a little bit of smoothing and subdivide for example a little more stringent Alex I'm sorry we want to loop subdivisions so it'll get end up with our nice it's a more expensive to scrub through but we'll see that we have one nice you know piece of geometry that gets torn over time so the way that we are controlling this is with attributes so if we look again at because these are hard attachments these are hard welds the new points group the one that was created by edge fracture is the one that's being welded and we can look at the attributes that they're being created and essentially that's our break threshold here our break type which is currently set to none and we're looking at the weld so all of these points are being weld are being welded some other point within the simulation and as we scrub through this actually the body looking at this one's higher will see that at some point to break type changes to stretch stress and this is when these Turing starts Howard a-tearing starts happening and over time we'll see the welds are automatically being set to negative one so this is when the solver is seeing that the constraints attached to them have exceeded the threshold and they're being released by setting the weld to negative 1 so the solver is doing this automatically and so although negative ones have been unwelded because of this because of stretch stress and if we go dive inside the solver again this is a soft version this unable break I'm welding this is what this is what's setting that break type after 20 frames just stretch stress so that's why that's how we're making it so that it doesn't start fracturing until 20 frames then and then we can we control this a few more ways we can do things like let's create a an attribute that is only positive on the for all the points that are in the positive x-axis so all the points that have let's turn this on and we're actually gonna create a visualizer for this so we created this break threshold scale attribute visualizer and what it's done is what we've done if we've set negative 1 to all the negative X point values and we've set point 5 to all the positive X point values and then in our weld here we can scale by attribute and were sent scaling by the break threshold scale I already had this set but because the attribute didn't exist it was just treated as one but so now we're actually scaling the threat and the break threshold by that attribute we can see that here we've got some that are negative and we've got some that are scaled by 0.5 and the negative one's a negative break threshold basically means to never break never from so a weld that has a negative break threshold will never release and the rest of them are scaled lower so if we solve this one we'll find that again after the first 20 frames we'll start to see that saying tearing but it'll happen a little easier because the lower break threshold that'll only happen and in the points that were originally in the positive x-axis so obviously you could paint this on or you can generate it by noise or there's all sorts of ways you can set that break threshold scale so that you can control exactly where you want that that tear to occur and then if we wanted even more control we could do something like turn the breaking off altogether and then go over here and so we're gonna take that original geometry and let's create a group that we're gonna call on well that's just an expanding bounding box here it's just animated and grouping and it's on and the idea is it's going to set all of these points into the unweld groups you could also do this by color there's sort of a lot of ways you could you could do this but and then within the velum solver what we're going to do is actually we don't need this anymore we're going to bind one of our inputs to that group table and then we're just gonna look up the point number there and if it's in that group we're gonna unweld it and do that manually so this just gives us a lot more control over exactly when that welding happens so again you can see as the points as the group is sort of moving across this way we run welding all of those all of these points so you can see it's just all coming apart and then we can do things like maybe add some noise and and don't unweld some of the some of the groups some of the points based on that noise and it'll do a sort of a similar effect but now there will actually be a few a few points that did never get unwelded and so you'll sort of get that same effect but then then some points will stay permanently together so it mostly tears but not all the way again it's probably best to look at this from through the post process so you can see the effect of applying the weld or applying as well so it looks like one piece of piece of geometry and so got this so that's just some ways to control how welding occurs or unweld occurs for for tearing effects and we're actually looking a slightly more complicated example now so this example shows how you might do something like a popping balloon so you've probably seen lots of velum demos or they show of things inflating or objects inflating but this is an example of how you might solve or simulate coupling that pops or any kind of inflatable object that pops and we're gonna sort of fake a couple effects here but it just the whole workflow shows a couple of kind of interesting aspects of welding and and unwelded in particular so we're just creating a sphere this is probably it's a bit 2 meter radius so it's really more like a big beach ball that is going to pop and we're doing the same thing where we create a attribute noise for the break scale so we're gonna scale our welding or unwelded by an attribute again we're doing an edge fracture again and in this case all we're doing we're actually turning off of the sort of auto creation of pieces and we're just drawing a simple little curve so we've drawn a simple curve here that's going to actually be where we where we want to break this geometry although again we're gonna break it along the edge we create cloth we're adding a pressure constraint which is what it makes it act like balloon and then we're doing the weld so again if we look at the weld we're seeing we've got all these points that are running along that fracture that we've created or that edge break we've created and compressible white lines telling us we've got we've got Bend constraints along it so again we're just creating a sort of inflatable balloon that has been welded back together again if we hit play on this what's what's happening in the in the simulation is the the pressure constraint is actually being inflated we're increasing the the rest volume so that it's causing more and more stress on the cloth and then eventually those welds are breaking because of that and then it's sort of flying across the room as they as the air escapes from the balloon so let's look at how we do something like this so this is actually the the post process so I think we're we're applying the welds and we're doing a subdivision on it so that's why we get this nice smooth one piece of geometry so you can actually see the fractures occurring here right along this line as as the stress along it gets too high so and if we look at it within the dotnet so this is actually a dotnet set up and we're reviewing the stress so the reason it's getting is getting more and more stress because we're inflating the pressure constraint and then eventually those welds start to break and then if we actually create this we're gonna have this visualizer we'll see we get these these vectors that are showing is kind of where we need to apply an impulse to make it look like that air escaping the balloon is sort of shooting it across the across the scene so now I'm gonna I'm gonna turn it sort of start over and show a couple of turn off a couple of these effects so that we can kind of start from the beginning first we have this inflate so this is the velum constraint property we're gonna go into a fair bit of detail on this but all we're doing here is is on the pressure constraint group which is which is just the one that makes it inflate we are animating up the rest length scale so that's basically how you inflate a balloon over time as you just in create increase the rest length and as it expands it's going to create more and more stretch pressure or stretch stress on the cloth that is the that is holding the surface together and then we've got this sort of complicated vexed expression here so let's remove a couple of things or disable a couple of things to return that remove off and so now all we've got is the info so I've left the inflatable rest length on and nothing else so we're gonna see is it's going to inflate and the welds are going to break but it's really kind of strange what's happening here we've got this kind of weird effect where the the balloon is just kind of like moving around and it's still sort of staying around the same size and that's because the pressure constraint here is actually still active so what it's doing is it's still computing the volume of this of this object and it's trying to maintain that volume by expanding the cloth outwards to keep that volume but because it's not a closed surface anymore we're getting sort of a very weird estimate for what the what the volume of the object is and we're just getting this kind of really strange look so what we first need to do is figure out when do we remove the pressure constraint because the pressure constraint when it removes is gonna make it look like the balloon deflated with something like this you could probably just keyframe it but we're going to try to be a little bit more procedural here so what we've actually done here is we're going to turn this remove back on and we've turned on use Vic expression so we're gonna use the expression to figure out when we're going to remove that pressure constraint so what we're doing here is we're actually looking at D so again we've we've bound the one of these inputs to the first context geometry which is the original geometry right here coming in here and then input 2 is actually the point the dot the dot data this is that geometry so this is the particles essentially so what we're gonna want to do is compare the number of welds that are in the current simulation geometry compared to the original geometry and when that goes past a particular ratio we want to say okay well enough welds have been removed that we want to basically pop the balloon so that's what this is doing we're basically saying expand point group so find all of the points where the weld is set and that's how many we have originally in the geometry and then we're gonna compare it to the current geometry how many welds are existing and as soon as half of them are gone we're going to remove the pressure constraint so we're gonna pop the balloon so now when we hit play on this we'll see the same thing the the balloon is going to start to inflate as we as we scale up the pressure dress length but now when the welds remove and half of them are gone we're going to essentially deflate so we remove the pressure constraint and the balloon pops and again subdivided this Jamo it looks better so that's nice but we would like to also have simulate the a or or emulate the air that's coming out of the balloon that's going to sort of shoot it across the scene so that's what this does so we now the geometry wrangle so again we're running on the geometry meaning the the points of the the particles essentially of the simulation and we plug this if this is the reason we're using adopt net here is we have to do this in the third input this post solve input so when a weld is broken it's actually put into a broken point group the point that is unwelded will be in a broken point group and you can actually operate it on operate on that in any of these geometry wrangles here the same thing actually happens for constraint primitives so you could actually operate on the constraint primitives at the same time they're put into a broken primitive group but for now we're looking at unwelded points so it'll be in a broken point group so what we're going to do is free we're going to look at all the unwelded points so everything that every well that popped basically or that broke in this particular time step and we're going to look at its pressure gradient so as pressure gradient is you can think of it as essentially the normal but it's really the direction that the cloth has to expand outward or the point has to expand outward to increase the volume the most and it looks a lot like the normal so we're doing is we're taking the opposite of that the inverse of that were scaling it up and adding that as an air vector to every point and then in our pop wind here we're actually turning that air vector into wind and this works well because we've got this tangent and normal drag set here which is what cloth makes cloth behave as if it had sort of a lift force on it so where the cloth is normal to the wing to the wind it will get a big effect and where it's tangent to the wind it'll just the wind will sort of slide right by which is generally what we want to have happen so we're doing is we're applying that air as as a wind force and it'll automatically take into account whether or not the cloth is aligned against or alongside that air if you notice this is actually going to be doing the exact same thing for every point that's on that on this geometry if we had a bunch of balloons that we're popping we'd have to do something like look for only the wells that were a part of the same balloon or something like that so we're not doing that here because this is kind of a simplified example but so what it's doing looking at all the broken wells if there is one it's adding its inverse pressure gradient to the air vector and that's what's basically giving those sort of little wind impulses to blow it across the lysene I wanted to finish up this section on welding by talking about edge fracture which is a new tool in Houdini 17 for splitting up geometry along existing edges and this can be really useful for then welding back together again to do like tearing effects like we've seen so the reason you want to tear a long existing or cut along existing edges is because let's say we've got this nice leary meshed pig head here and so we've got generally really nicely sized triangles it's fairly uniform across the across the geometry which is really good for cloth simulation but if we use something like Voronoi fracture and this is I've got the interior surfaces turned off so it's religious splitting up the the surface of the of the mesh here we'll see that we get this straight line that's actually cutting all of these triangles into these tiny little slivers and so if you see like right here you get these tiny little slivers here which is not very good for cloth simulation and not only that it also means that all of our tears would be perfectly straight which is also not very realistic because usually the tears gonna kind of meander along as a material tears apart under stress so for that reason we wanted a way to take input geometry and tear it or cut it out but again only along existing edges so this takes in the borrows an idea from the game dev toolset actually and what it does is it actually Polly reduces so it reduces the input mesh to generate a bunch of low resolution edges and then he uses the fine shortest path table to trace the edges between each pairs of pair of points here and then creates a group from that and cuts along this group so it's the fine shortest path that's letting us basically cut between or trace along but in these edges between these two these two points for example so all we need to do Perez fractures really provide lines that that are going to give us the cuts we want so it has this initial pieces option here which is just really specifying how many polygons to paly reduce the initial mesh to and that is a rough count of how many pieces we're gonna have so we can have just a few we get these very large pieces or we can go pretty high up and we'll get lots and lots of small pieces so again and we're just seeing the poly reduction as the guide geometry here so on top of the initial pieces you can also because we're just providing we're just drawing lines or just in providing input lines we can actually draw our own curves so I'm just hitting Enter here and I can then start tracing curves along the geometry and this way we can actually sort of guide where exactly we want the cuts to happen and it's not going to be exact because again it's tracing along the edges that are close to the curves that we've drawn and then the other thing worth noting is that you don't have to actually cut and draw an entire piece here we could just sort of let's say we just want the piece here to possibly tear across like in the middle but it doesn't it shouldn't have to be and its own entire separate piece if we look at the result of turning that into cloth and welding that we'll see that we've got this weld along here so this could tear open but it wouldn't tear this piece into an entirely new piece we're not cutting in it we're not cutting it like in half for example we're just making a Tara long the middle of it so that's something that that draw curve lets you do that won't happen with the the initial pieces which always cuts into separate pieces of that are distinct from each other if we want even more control we can turn off that initial pieces option and do the poly reduce ourselves and this provides these edges that we were talking about and then we can for example dissolve some of them like if we don't if we want the head for the most part to just have one big piece we could just solve those edges there and then fracture with those and we'll see if this one big piece is here and then we can send that in to draw a curve and then further further draw on top of that if we wanted to so this gives you a lot of as long as you provide sort of interesting curves it will trace them in ways that tough condemned to used for fairly realistic looking caring just to take this one step further we can do something like that Voronoi fracture I showed before but then we're gonna actually take that and take just get just the edges so these are now just the edges of the Voronoi fracture on the surface and we're going to remove all the points that aren't adjunction x' and convert that to a map to a a bunch of lines and then use that as our input a attractor so what we're sort of getting is a edge following Voronoi fraction so you can see as we go up and change the number of points we're getting sort of the same for annoy fracture type pattern but then following all the edges which is which can be useful because we've got different ways of every buttons you know sort of accustomed to controlling Voronoi fracture in various ways you can scatter points in particular areas for example if you want a fracture there so being able to go from born root fracture to this edge fracture is kind of kind of interesting and what you'll see is this you can see sort of another example of what happens if you have a bunch of which you don't resample the edges basically so if we look at this here we've taken away all the non junction points if we add them back in what's happening is we've got all these edges actually that are going to trace exactly along this straight line so when we convert to line we've got all these points that we're gonna send in to find shortest paths so the shortest in the pass those are gonna be found or gonna actually very very closely mirror the input which is they're gonna actually make them fairly jag you can see that here so you can see the difference between that off you get this kind of more natural sort of meandering look and then if you sorry if you keep the the non junction points in there it's gonna very closely try to follow this line which gives you sort of this this jagged log which might be might be what you want it might be interesting so anyway there's just a few different ways to to create sort of interesting patterns for for using edge fracture which can then be sent into welding inside vellum to get some nice tearing effects let's look now at animating constraint properties during a simulation and you usually do this with a vellum constraint property doll and this could be for things like changing the stiffness of the constraint or its rest length or something like that over time during the simulation so possibly as a result of some action that happened in the simulation and generally analogous to the Pape property da if you have worked in in pops at all you might have run into this but it's the same idea where you've got a bunch of toggles that turn on which attribute or which property you want to be changing and then there's also a use of expression option which lets you actually write little vex snippets to further control how you want to change those properties very often you're going to operate on specific primitive groups constraint primitive groups so if you create say a bunch of attach to geometry primitives you might talk along that output group option and call it attached or something and then you'll actually update just those particular constraints from within dots with with a particular velum constraint property doing it this way avoids changing the topology or redoing any graph coloring if all you're doing is updating attributes so we've looked at how vellum will partition up the constraint primitives into these very fast and batches it can send off to the GPU and we don't want to be redoing that or Rhian porting all of that constraint geometry just to update say stiffness or something like that so we want something much more atomic than that so when you update just a single attribute on existing these existing primitives the way that Houdini works in the way that it works with OpenCL it will actually only send that change to attribute back to the GPU but it won't cut the other attributes and that won't change in the graph coloring or any of these fast independent sets that we've generated before so it's fairly quick it's actually quite quick if all you're doing is updating a single attribute the velum constraint property dot gives you access to both the constraint geometry so those constraint primitives we've discussed as well as the geometry data which is the particles you can add additional inputs as well if you want to bind to say an external Saab to look up some animated values or annoyed values or something like that there are also pseudo properties for remove and broken so when we've seen some of these examples before but remove will actually just remove this specified constraint and broken is used with the auto braking capabilities of elements to essentially allow you to override a braking event so it will let you do something like if you want to do for instance change the stiffness to very low instead of actually breaking you can do something like that the other way of animating rest fate is to use the velum risk blend top-end up there and we'll see examples of both and this will only let you animate rest lengths so it's not gonna let you do stiffness or damping or anything like that but it's in some ways can be a really easy way to update that state because you can just point it out external geometry so it can be animated geometry that's bending or deforming and you can actually match the rest of the constraints to match that so it's actually an interesting way to provide some animation to during a simulation but by animating the external geometry in its original rest state and so we'll look at some examples of that the original wire solver and the FIM cloth solver and you Deenie both have similar capabilities so we'll look at how you can do that in Belem so let's move into adeney and see some examples so we use this simple set up to demonstrate animating constraint properties during the simulation have we just got a simple grid here that's sitting on the ground plane we're creating a group of a regular group of points that we're doing by just selecting every 11th one of them then we're creating cloth from that and attaching it to attaching those those are a regular points to just a copy of the of the grid transformed up by a meter so very simple oh and then we're also sorry where I'm this is the attach to geometry we've got these not very high stiffness so that you can act like like Springs fairly high damping ratio and we're sending an output group to called attach so we're gonna be able to update this by using Bill and constraint property by referencing the attach group so if we hit play on this nothing really interesting is gonna happen it because we specified a bunch of constraints and they're already at their wrestling so to solve them it doesn't have to the solver does time to do anything let's say we wanted the cloth to actually rest at about half a meter up from the ground plane we could go in and change the wrestling scale of these constraints to say 0.5 and now when we hit play it moves up to about half a meter above and it actually does it fairly smoothly and that's because of this high damping ratio so the constraints can't react that quickly because it's there they're highly damped but if we go back to the default damping ratio which is pretty bouncy we'll see that it kind of fly up really quickly and they sort of start to inner clarity or self collide and it's just a little uh sort of extreme so let's say we wanted to animate this wrestling scale from 1 to 0.5 and you might initially think well I'll just set a keyframe here and then I'll go to frame 24 and I'll set another keyframe and play and nothing happens and that's because as we discussed the solver really only looks at these constraints at the beginning of the saw or imports the constraints at the beginning of the solve that means that any changes to the attributes that are done at the soft level isn't gonna they're not gonna make their way into the solver so if you want to animate them you need to do it from within the simulation itself so back to one so we've looked at this before but the other thing to remember is that all we're doing when we set these these various have to be about these various properties here are parameters here we're setting attributes on the constraint primitives themselves so they've got things like stiffness and a constraint type we're just looking at the attached group here rest length the damping ratio so we're just changing those primitive attribute values what's nice is of course we've got lots and lots of ways to to change attribute values we can do it in verax we can without to be randomized or there's all sorts of ways to do it that's a quick aside if you're worried about seeing all these duplicate values and duplicate strings the way Houdini represent strings internally string attributes is actually just stores all sets into a unique string table so these likes to be all storing the same value and then on top of that you need to use a page to data structure where it can collapse you common values or strings a sequence of common values into a down to a single value so you get a fair bit of compression going on when you store things like this so so it takes up a lot less data than you then you might initially think but so as you can see when we're changing the rest length scale all we're doing is changing this attribute value over here so if we want to do something like randomize that those values we can use an attribute randomize set to just operate on the attached group primitives and multiply the rest length by a random value and if we hit play we'll see we get that same sort of effect but now all the rest links are sort of randomized within this kind of range that we specified but again it's not animated so let's look at how we might animate that use those random values and animate them so if we go in this again using the soft version the velum solver so able to dive into this and we've got this vel of constraint property and set here we're set we're operating on the attached group and for now let's let's start off and if all we do is disable it and hit play then again nothing really changed we I'm really funny thing here because there's breast length scale is enabled here this means that if any value we type here will actually update the attached constraint breast lines so and and in this case because we're operating within the solver we actually can animate this so we can set that to one and then we can go to 24 we can set this to I'm 0.5 and set another keyframe and when we hit play you'll see it's actually now it's actually animated and this again because we're within the simulation so this is just an easy way to animate any of these properties that you want on fuse but if we want to have a little more control than that we can use this use of expression thing here so I've got just a little one that I've written here and so what we've done is we're just choosing a random number based on the primitive number so we can access things like criminal because we're just index operating over primitives so we are doing essentially with that attribute randomize did before we're choosing an random number between 0.25 and point six five and then we've got this amount that we're getting from the parameter here which is again just animated from zero to one and then we're just fitting from 1 to whatever our random scale is so this is just doing the same thing of animating but instead of animating to a particular value its animating to whatever this random value is and then we've got this we'll look at this in the section in a second but this actually sets that remove value as well because this is not enabled it will actually be ignored so if we hit play here all we're gonna get is a nice smooth transition to that randomized rest length value and then if we enable the remove then it will start actually looking at the value of this and removing any constraints so in this case we're basically just coming with a random number based on the constraint number and the current time and if it's less than the threshold which is a very low threshold then the constraint gets get will actually get deleted so this is really just gonna be sort of randomly removing constraints over time and you can see it gets a little more active in the simulation because we're we are just randomly and letting go of pieces of the cloth has the simulation progressives and you can see as we go further long losing more and more constraints and if we play it through all the way which I don't have blue we we end up losing basically all the constraint so that's a pretty basic example of doing things you know you can animate stiffness basically pretty much all the different values breaking and plasticity and all these sorts of things you can animate by using this Phelim constraint property table and the bindings that we talked about is operating on the constraint geometry so it's operating on the constraint primitives and the second input will actually be the geometry so will be the particles themselves and we'll look at an example in using that now we've looked before at how some of these values in Belem constraint saab can actually be scaled by attributes but not all of them can and if these attributes are changing then this doesn't really work also because this is again like we said this is to set up the initial state so let's look at how if I let's say I take this initial grid and I want to add some noise to it this is just using attribute noise and we're going to create this amount attribute and let's um let's create a visualizer for that and so all this is doing is is doing animated noise between 0 & 1 so let's say instead of having an having just an animated single parameter for that amount between 0 to 1 we actually want to look up this animated value the basanta made a point value and use that instead so this is going through to this amount annul here so if we go into this other velum constraint property this is similar to what we had before as far as setting rest length scale but we can add an input here so we've added a reference to that that amount no and it's going to be the third input and so what that's gonna let us do is actually update these rest length scales based on this and those animated values and so what we're gonna do here is have this expression which does the same thing it generates a random number and then we're looking at so because we're operating on these constraints we can look at which of these points is being affected by this constraint so we can do that by just looking up the prim points array and grabbing the first one so all these constraints are only gonna reference one point so we can grab which point it's going to be and then go look up that point number in the third input which is that attach input so instead of using just this simple 0 to 1 parameter we're gonna actually use a different value for each point it's actually an animated value so we're looking up that amount that's weird using this point expression to go grab that the current value of that amount and then we're doing that same fitting of the rest scales between 1 and that value and if we use this instead then what we'll see is we actually get an animated set of rest scales and so let's actually go back and so what we're doing here is we're just doing an attribute copy this just so we can visualize it so we're copying the amount variable onto our simulate weighted cloth and that's just so we can simulate it so you I mean just so we can visualize it so you can see where it's red that's close to one so it's doing the rest length scale near its random value and if it's zero it's it's back to the original it's back at least close to one so if you see this animate over time and obviously you could you could paint this you could sort of do it however you want and actually let's look an example of them painting it so if we go over here I've created this out to be again and just paint a real simple little shape here and then we're actually using a blend shape and this blend shapes gonna just sort of blend in the value of that amount over time and so if we use that for our for our amount source instead of the instead of the noise then what we'll get is this sort of blend into the rest lengths everywhere at painting so again just a sort of simple way to go from the constraints we're going to look up which point is affected by the constraint and then going and looking up some value and it can be anything really from some external geometry that's animated and then using that to to animate some properties of the constraints so lots and lots of things are possible with with workflows like this so another way to update constraint properties is by using the vellum rest blend soft and op and so when using it in sobs is just sort of another way to set the rest lengths of the constraints using you'd end up s-- you can actually use it to to animate those those arrest lengths and change the state of the constraints over time to match some external geometry so this example shows a couple of different ways of doing so we've just got a tourist that we have flattened made sort of into a little pancake and then we've got an animated blend shape over here that's going to give us some rescue on the trail over calling rest geometry so all it does you can see every time it just Werth goes back to its original shape and we're creating fall from the flattened version of it and sending it into the velum solver and what's gonna happen here is we've actually set up this vellum rest blend table so we're affecting the bend and stretch constraints so those are the two types of constraints set up by the by the vellum configure cloth tool and the source for our rest geometry is actually going to be that external stop that we just looked at and we're just going to blend into that and we're gonna do it every frame and what that means is that we're going to start off with this with the geometry and all the constraints thinking that they should be flat and then over time we're gonna blend to this version this sort of fat version so the constraint rest links are all going to update so now they actually match this instead and what that will look like is as if we sort of inflated so we've got this the rest template here you can see that as we change the shape of it in rest space so we're just transforming it in rest face but it affects this simulation because it's updating the constraint rest and the constraint properties to are the constraint rest lengths to match this animated geometry that we've got here so there's lots of sort of interesting effects you can do you can do with this you can also affect how fast you want to blend into the rest version versus the current version if you set just to something low you'll still eventually blend to that inflated version it'll just it'll just react slower so that's what we're kind of seeing there's that sort of gets there eventually but this just takes longer for it to blend into that expanded rustic so the vellum rest blend dog is actually using the velum rest blend stop internally so the soft version let's so here we've got an example where you've used vellum drape so vellum drape basically uses is for sort of draping geometry over dripping cloth over usually initial collision geometry so then you want to basically start the simulation from a pre draped state so that's all we're doing here is draping 80 frames worth of this same simulation but then what we're doing in this saw is we're actually saying we want to use the current state here as we want to update the rest lengths of all of the constraints to actually match this so instead of being flat it's gonna have this bend kind of baked into it and then we've got a pin to target here constraint which is gonna match this target which is all all this does is this transform up over time so we're gonna basically lift this up so we can demonstrate that it's God the bend baked into it so that's what we're seeing is this Bend here that has been updated for the the constraints had been updated to have that been kind of baked into it using this vellum rest find if we disable this then when we lift it up you'll see so it just goes back to its original flat version and you can do the same sort of thing using external geometry so in this case it's actually just blending from this draped version back to the original torus and so that all that looks like is it's just sort of going from draped to back to sort of original fat torus one thing you might notice is we've actually set this only to 0.75 so it's actually not getting as big as the the rest geometry because we're not blending all the way up to it so that's how it works for sort of simple geometry I wanted to show one other example of vellum rest blend because it shows how do how to use this when you're working with multiple pieces of geometry so this is a slightly more complicated example of belem rest blend and in this case we're actually using multiple different pieces of geometry and that we're going into a dot map that's gonna use the velum source top to actually bring in these different pieces of geometry and in fact in the case of the the Torah here working actually sort of a myth that over time so if we look at what we've got here the most basic is we've just got a piece of cloth that's just gonna fall down very simple and then on top of that we're adding this these Torah that are being emitted every 20 frames and they've got a rest shape that is both bending and it's now you've seen it sort of inflating as well so it's going to be following that rest shape and then we've got one more thing that's coming in and that's let's get rid of the cloth as well these are these l-system trees and what they're gonna do these are actually hair this is a branching here which we're going to talk about another master class but and so what these do is they actually will for a while they're going to blend to a sort of a twisted version of the in geometry and then after 70 after frame 72 they're gonna go back to the original geometry so that's why they sort of look like they get released or you know sort they go back to their original mistake so all we've done here is we've got something very similar for the for the rest shapes for the Torah here you can just see they they sort of Bend and then they have flayed over the after a little while and trees just twist that's this one and the original one is what we originally sent in the the original untwisted tree so the main point here is just that when we have all these vellum source just like the emitter is like a pop source or pop locating and pop location actually create streams so there's actually pop streams that are created for this geometry for the particles that make up for instance the Torah here so if you want to add like a pop wind or something that only affects the Torah you can just put it right here and it will only affect them vellum rest blend for this group here when this isn't checked it actually looks up any of streams up above it so these essentially the vellum rest blend will respect these streams so the geometry for everything that's coming in for the tourists should only be breast geometry for the Torah for them and for the trees the same way and what that also means is that you need to make sure that so after the first frame I've only got one of these things and after say the 21st frame we're gonna have two of these Torah and so we need to make sure that in the rest geometry there's the same number of points here as we have in the simulation so we because we know we are emitting every twenty frames if we go to the rest all right that's actually what this copy does is this making sure that well at this point okay we've got to so it's not moving them around it's just making sure there's the same number of points because it looks at that by point number so that's how you set something out that's god yeah this is kind of a complicated or more involved set up I'm not sure how often you actually mean multiple places of arrest geometry deforming like this but in case you do and you need to source it like that you should remember that vellum rest blend will it will respect the omission streams and that you need to make sure that the rest geometry has the same number of points as the simulation geometry can we do it you can get these interesting animated effects that sort of just from having animation in the in the rest geometry itself so that is how you can animate constraint properties let's move on to dynamic constraints in Belem which are typically constraints created during the simulation often because two pieces of geometry may be moved close to each other or pulled away from each other or something and you want to add constraints based on things like proximity typically you'll create these with the velum constraint stop this is very similar to or at least in terms of parameters to the soft version because it internally uses amuses this off there are a few things that are disabled but for the most part you can you can copy any parameters over from the top to the top and get similar results in general you're gonna want to create an output group for the created primitives the constraint primitives and also leave the keep unique within-group option on and this is because if you're for instance stitching a point on a piece of geometry to another piece of geometry you don't want that point to be constrained a huge number of times you don't you typically are gonna want it to just have one particular constraint created on it not a ton of them we'll see some examples of that or and some exceptions to that in particular for glue but typically that's going to be on it's on by default some of the dynamic constraint types that you'll be creating with the veldt constraint stop are things like stitching geometry together gluing geometry together attaching vellum geometry to external geometry and pinning geometry in place we'll look at example of all those things and sometimes if you're using the vellum sources workflow so you've got several different sources of vellum geometry and you're you're bringing it into DAPs into adop net from separate vellum sources then the only way to really apply constraints to those is after the fact in within the dotnet itself and so again we'll look at it we'll look at an example of that so then in that case it's not really a dynamic constraint in that you're not creating it as a result of some situation inside the simulation you're just doing it to set up the simulation but because of the way you specify the geometry you need to do it from within dobbs with the dynamic constraints it's particularly things like stitch and glue and attach to geometry if you use them in concert with breaking and distance you get sort of sticky collision effect so you'll get constraints that only get created when objects or geometries are close to each other and so then they'll sort of hold the geometry together but then once the stress builds up they'll break and it makes this kind of sticky collision and we'll see some examples of that all the you're really doing with this workflow is creating new constraint primitives in that constraint geometry data like we've been talking about so in theory you could actually do the exact same thing just with a custom geometry wrangle and so I'll show an example of doing that it's you don't necessarily need to do that but it's just sort of something that if if you want some very specific very custom way of creating constraints it is possible and finally we look at how you can remove geometry from the simulation and this is just a little trickier than it might be otherwise because we do have the situation that if you you need to keep the content outs or the point numbers in agreement between the geometry data and the constraint geometry data so we'll look at how you do that if you want to remove points from the simulation so the first type of dynamic constraints we're going to look at are attached to geometry constraints these are a pretty simple way to have velum geometry attached to a on tree that is often the collegian geometry so this is really useful for the sticky collisions that we were talking about as the collision geometry moves closer the velum geometry the constraints will be created and then they can end up like braking because of stress and that sort of things so all we got here is some vellum hair that is hanging down here it's pinned at the top and this sphere here is both our collision geometry but it's also going to be the target for our attached to geometry constraints and if we play this we'll see as it moves into the hair and these constraints get created and then you can also see them breaking overtime as they as they turn red here you can see the stress gets strong enough that they are gonna break and and then they'll sort of snap off and you can see the the points then even the points that I've broken once they've broken they can actually reattach later to this to the same same piece of geometry so the way this is set up it's pretty simple this bellum constraints Dolph here looks for the most part just like the velum constraints saw we have this activation so just whether we want it to be on or not and then how often to create constraints and so this can be either only on creation frames so this is more useful when you're for instance having multiple velum source things that you want to constrain together but if you want to do dynamic you usually want either each frame or each sub step and this is really just a for performance reasons if you've got a bunch of sub steps but you only really care about creating constraints on each frame you can use a lower frequency just in case the creating the constraint creation is expensive it also has to do because we're changing the topology by adding new constraints we have to redo the graph coloring that we talked about so it can be a little expensive to do it every single sub step if you've got a bunch of sub steps I think we only have two in this case so it's not that much of a difference but other than we have to constraint tight and we're constraining all the primitives so any any velum geometry points can be can be constrained by this one and then the target path is actually just borrowing it from the static object here so from this collision object so all that's doing is saying we want to we want to constrain to the same thing that reason for collisions and that's why we get these sort of sticky collisions the other important part of that is it acts just distance so we only want to create the constraints want the once the velum points get close enough to that object to that target path object we wanted both constrained to the local the closest point on the primitive I'm sorry on the target geometry and use the closest location so we're not actually restricted to constraining two points on the geometry where we're going to point on the like in the middle of the primitive here for example and then finally so we've got sort of other bests not very stiff Springs type constraint with a reasonable damping ratio and then we're creating this output group as we talked about and doing the keep unique without within output group so what that means it's like say when one of these points here gets constrained by this table it stays is constrained and it's only constrained that one time until once the constraint breaks it can then actually start being constrained again so that just means that instead of having you won't have this particular point trying to constrain itself over and over and over again which is really generally not what we wanted to so and then be open sorry then we also have the breaking threshold on so that's what gives us the constraints that are gonna break over time as the stress builds up and give you these kind of kind of sticky collisions so then the other interesting thing I want to show with this just cuz I mentioned it earlier is we're gonna we can use this bellum constraint property and look at the broken group of constraint primitives and change their stiffness to 10 and then override the broken so and we're using this expression that basically says if the if the z-axis point position is greater than 0 then it can then it can still be broken otherwise we're overriding it and so if we turn this on what this will do is it'll mean that all the constraints over here that normally would break they're just gonna turn into very low stiffness constraints instead you can see that happening here so that's what's that's why all these ones just turn into very low stiffness constraints instead of breaking so we're overriding the breaking and changing the stiffness to something very low that's why also why they're stretching so much so that's just kind of a can be kind of a useful effect so that's kind of the most basic approach to when actually goes to show this real quick this works as well with with cloth there's too much difference here so just showing that the hair and cloth pretty much would work the same way for uh for these types of constraints what we're doing in this soft levels were actually using the velum pak sobs to turn both the geometry and the constraint geometry into one piece of patch geometry and then that's mainly just so we can use one switch to to switch between the two setups here and then we just use an unpack to get back to our geometry and constraint separately and send it into the dotnet and so this is a very similar setup on a different file for but in this case instead of attaching vellum geometry to external geometry we're stitching or gluing vellum geometry together and so in this case we are actually stitching the cloth to this to the vellum hair here and again we just set them up to be breakable so you get this kind of sticky colliding effect again in this case obviously with with self collisions and we're just visualizing the stress so we can see as they turn red that's basically when they when they start to break so the only real difference here is we've set this up to again be on each frame but now we're doing stitch point constraints which so we're actually stitching to between two vellum points so that's what these um these constraints are always going to be between a point on this geometry and a point on this geometry and we are going from the cloth to the hair group and that's generally how if just for what it's worth if you're ever especially if you're welding and you generally want to go to hair because hair has an orient attribute that that the cloth doesn't so in general if you have a hair geometry and non hair geometry the target should usually be the hair and we set this up to be have a max distance again so these only get creatives as they get close to each other and again a sort of a weak spring type constraint and the same thing with an output group and breaking threshold so there's very similar to loop of the previous set up just working with stitch points instead of attached to geometry and then the other type of stitching is actually glue glue is very similar except that instead of having one stitch per point you can actually have multiple so in this case we have this kind of glue Serge here and this constraints per point is actually applies to the group we're talking about here so instead of only getting one constraint per point that's in this group you can actually get up to the numbers specified here and so we'll see that as we and this can be useful for things like gluing hair or make it together and anything where you want sort of a mass of constraints on a particular point to sort of hold it in place better so please about just a little bit you can see that a lot of these points actually have multiple constraints on them now to two different points on there between the cloth and the hair so this like this piece of cloth right here is constrained about this point on the hair and this point on the hair and then finally this is actually we can look at how these what the velum constraint stop is actually doing internally it's just creating a new constraint primitives so if we wanted to we could create them ourselves so this is actually only about of this little page of vex code so this is a geometry wrangle it's set up to work on the constraint geometry so that's the geometry that holds the constraint primitives and our inputs are the constraint geometry and then the dot data so these are the points themselves is gonna be our second input so this is actually again what's going on inside the velum constraints property I mean bill and constraints property and gob and this one which they're all just operating on these two pieces of data so the code here what it's going to do is it has a source group which is going to be the cloth and the target group which is the hair and so what we're doing is looking at the point that's in the geometry the particles essentially and if the current point in the constraint geometry is in that same group then then we want to operate on it otherwise we just return out we look up the position of the particle we look for the nearest position being the nearest particle that is in the target group in the particles and if it doesn't find anything it doesn't do anything but if it does then it creates a poly line primitive between those two points and then just sets all these attribute values and these are common stiffness damping ratio rest length as the distance between those two positions and then it Flags this particular constraint point as being glued so that and then we only use the unglued once so and then we just have parameters for all these things so it's basically doing the same thing as what this bellum constraints table is doing is just replicating it in sort of its own code but if you hit play you'll see it basically it does the same thing so obviously for this case you would never need to do that but if you you come up with new and interesting ways to create constraints dynamically or in sobs you can that all you're doing is creating primitives so this is how you can do it without even going into a soft solver and generally you don't need to are necessarily even want to go into a sob solver if you if you could avoid it so now I'm gonna quickly just go through a few more examples of dynamic constraints there's a pretty basic set up where we've got a sphere that we apply a mountaintop to to make it sort of noisy and then just move it up here and turn it into fairly stiff cloth add some velocity and then we're gonna commit a bunch of these over time and if we look at what this simulation looks like we've got a bunch of dynamic constraints being created as the spheres or as these kind of noisy spheres hit the wall and then there's also dynamic constraints between the rocks themselves and then some of these constraints that are attached to the wall become very stiff or uneven unbreakable at a certain point so to set this up all we're really doing is we've got one set of constraints or one bell and constraint stop to attach the spheres to the wall so it's using the dot context geo that one too so this is basically looking at the third input of the DAF man which is this grid and again that's the same thing being used by the static object so there again this is just fishin the collision object and the target of the attach constraints are the same and then we've got another set of constraints but they're being created between and these are glue constraints between the rocks themselves this is just like we had it before they've the particular search distance and we're making the breakable and oh and a compression stiffness at zero that basically means that they can get as close as they need to together but then they there's only there's only stiffness as I start to pull apart from one another and they're all on these are breakable as well obviously and then one other thing we did with the velum constraint property here just as an example of so we're operating on the attach group and we're going to affect the break type and basically as soon as we go below 4 in the y-axis here we just set the brake type to none it just turns off braking so that's all that's happening here is these particular attach constraints the ones that attach the geometry to the wall are making being made unbreakable past a certain point in Y there's another way to do it you could you could basically do the same thing with this belt and constraint property and in this case we're doing similar to what we just did in the previous example we're operating on any broken constraints and just overriding it if it's below a certain point so that's kind of just a simple example of again these kind of sticky collisions that that we were looking at in the previous example just just kind of more involved because it's actually this constantly emitting geometry and so now we're looking an example of creating dynamic pin constraints so in this case we've got a just your basic circle that we've fused together at the at the end if we don't do this it's it's not going to be on by default in this final point isn't actually fused together so we're just fusing this together and turning it into a loop of hair and then we're gonna set some of velocity and admit these over time so if we look at the results basically we're just sort of throwing these loops on to this collision object and this is fairly quick but the problem here is that as this as this pile of rope gets or pile of hair but it sort of looks like rope gets gets taller or we get more and more rope on it and you start and you see it sort of starts to bounce and kind of jitter a lot just because it takes a lot of solving to get these kind of lower levels to support all this weight without we going to in a purely sort of stable pile so it's not bad but it's just a little on the kind of jittery side here so I wanted to look in a few different ways that you could you could fix that one of the easiest ways is to go in here and actually create a layer point attribute so as the velum constraints come out of the hair we're actually going to add a point attribute this integer called layer there's sent it to the current frame and what this does is this works in conjunction with the velum solvers layer shock so this is if you've ever worked with grains it's a similar idea but when it does when it's solving collisions is essentially means that layers that are higher are treated as if they weigh less than the lower layers just for collision purposes so if we hit play here what that means is that each layer and it only it only compares which whether one sticker layer is higher than the other so as these points are coming in because their layers set to the current frame value they're always at a higher layer than before so then the lower ones the ones that are already been emitted so you can see we get a much more stable pile from this which is really nice so this is kind of a nice way of doing that and and pretty cheap and pretty you know built into this all for now which is nice actually when I originally created this test this we didn't have layer shop yet for Bell we only had it for grains so this actually works works pretty darn well and then on top of that we can even add auto sleeping so if we do that what that's going to basically do is as we as these points slow down we're gonna actually set their stop to attribute and actually I need to increase this radius a little bit so we can actually see that that's too much okay so what's happening here is these points are actually once they are slow enough for long enough so below this velocity threshold for this is this amount of time they're actually having their stopped attribute set to one so it's basically dynamically painting them but this is as we talked about at the very beginning this class there's a this is a permanent pin so it's adding pins but it's adding a hard pin so by it spending basically setting that stop attribute to one which kamancheh we can see if we look at the geometry so things start out nothing stopped that overtime just more and more these attributes are gonna be set to more and more of a stopped attribute it couldn't be said as as things slow down so the only problem with this is if we go back up to the geometry level and look at the results we're using the velum post process to look at their guides actually a poly wire might even be a better way to do it it looks just a little a little unnatural because we're actually getting this everything here just freezes in place so there's absolutely you know once it's stopped it's a heart because it's a hard pin none of these are gonna move at all and it'll it just looks a little bit unnatural so what we can do instead is if we get rid of that we can even get rid of that layer and go back and turn off all those sleep so what we're gonna do ourselves is we're gonna do something kind of similar but we're gonna find all the slow points so we're basically using that same threshold just looking at the velocity vector and putting it into this group this slow group and then we're gonna do a dynamic constraint but we're gonna actually do pin to target and make it a soft constraint so it's similar to what the auto sleep is doing but we're making any soft pin here with a very high damping ratio so that lets us and we could even do things like plasticity and breaking all that stuff but all we really want to do here is get a similar effect to the auto sleep but not make it nothing did a hard thing we want to make it a soft pin so you can see we're creating our pings here but as the higher up ropes fall onto the pile the lower points the lower ropes are actually responding a little bit so it generally is gonna look a bit more natural especially at this level because we get this sort of reaction within the within the pile not a lot of reaction is still fairly it's still quite stable but you get just a little bit of bounce and you can dial that in based on those the stiffness of those dynamic constraints so this is just kind of an interesting example of using pin constraints to kind of come up with a more stable pile of rope here there are some other ways to do it but this just is a way that kind of gives you more control so this filed an example of using velum constraints to not really dynamically but to constrain pieces of geometry that come from different velum source jobs so this is to look at this real quick it's just a file where we've got these balloons that are attached to strings and then over time they then they're pinned at the bottom then over time the pins release and they sort of float up into the air so the way this setup works is we've got all these lines that are gonna create the the balloon strings and we just copy them around the circle and we're creating a group for the pins here in the middle and then we use hair constraints on the strings and then we set pins for those points here and this is a stopped type the pin so it's a hard pin but it's not permanent so again that's how we release it later and then we'll randomizing the rest length a little bit so these are gonna all be these hairs are gonna just be a little bit different in length just for the kind of look you could also do it and do that up here just by changing the geometry path and then the balloons themselves or just spheres obviously and copied around that circle again the tie is just the point right here where the string is gonna attach to well really whether they're tied the balloon is gonna attach to the string and then we create a cloth just like creating the configure balloon but this is creating a a weak cloth or a kind of stretchy cloth and then with a pressure constraint and then we're just randomizing that that volume a bit so that's what some of them are gonna be a little more inflated than others basically then within the dotnet itself we have one sort of LM sorts that's bringing in the strings and then one belem source that's bringing the balloons and so I mentioned earlier that these actually work similar to pop emitters that actually create streams like pop streams so we can put pop is below these things and applied and that by default they will only apply to whatever emitter is above them so this is all the strings and we want drag on those strings so they kind of hang down below the balloons and then the balloons themselves we actually need a way for them to to go upward in the sky so we're just putting some some wind on just the balloons that points upwards with a little bit of noise and so that's why you get this kind of noisy bouncy have look as they want to because I want to sort of move upwards and then finally here's the actual constraints so what we're doing is we're welding the and again remember that the cloth should go to the hair so we're welding the tie this point at the end of the balloons to the hair and we're sitting in this case this is not dynamic we're just saying on creation frames on frame one set up these welds and the reason we need to do it here is there's no place that the geometry is all in one location like these stops don't know of these chains of stops don't know about each other but once they come into the simulation then we've got all the geometry here we can actually refer to these grooves and constrain them together we and we don't care about any Bend constraints in this case because they're really not relevant and then finally this is the once we get past frame thirty we're just looking at all the currently stopped points which will only be these pins here and just based on some sort of random threshold we're releasing them so a pretty simple setup over in reality but it gets kind of a kind of a nice look and then finally I just wanted to look at what what you need to do if you want to try to actually remove some vellum geometry from a simulation and so this is just the example is just a pinned cloth and and it's just basically kind of being eaten away as it goes below the the y equals zero axis or y equals zero plane sorry so all we're doing here is we're looking we're creating a group of the points we want to delete so these are the particles it's looking at so once it goes below zero and Y it's putting it into this - to delete group and then we're using this vellum constraint property here and we've said so what we need to do is remember we've got the strange geometry that has all the primitives and points that have identical point numbers to the particles and then in the in the geometry itself then we've got another point as well so we need to remove both points and and the constraint primitive as well or any constraint primitives that reference that point so all we're doing here is saying look at all of the points for the particular constraint that we're looking at if any of them are in that to delete group then we want to remove it and we want to remove the corresponding point that's in the constraint geometry so this is all this is operating on the constraint geometry this is operating on the particle geometry and so all it's doing is then deleting that same point in their in their geometry in the in the particle geometry so this removes everything from the constraint geometry this removes everything from the particle geometry so the point numbers are gonna stay in sync and we get this sort of nice effect of just removing all everything that has to do with a particular point that we want to that we want to delete may be a little more involved than it should be but this is if you want to remove a film tree this is what you need to do just as long as you keep those point numbers in sync than you should generally be okay our next topic is plasticity and the velum solver and so what we mean by plasticity is the solver can blend constraint rest state towards the current state when deformed past a threshold so what that means is if you've got something like a straight piece of hair that has been constraints on it all of their rest day will be will be an angle of 0 but if you have plasticity enabled on those constraints if it goes past if it gets bent past a certain threshold either by say a collision object or when there's any kind of forces then once it's past that threshold the solver will start to blend that resting of zero towards whatever the current state is so if it's a rest angle of zero and it's bent past say five degrees it'll start blending that rest angle towards zero so it might end up and say two point five or something so once the collision object or the wind has passed by when the hair returns to his rest state that rest it will no longer be straight it will be bent and so it'll actually look like the collision object has caused this sort of permanent deformation in the in the geometry so the amount of that blending is called plastic flow or at least in elements called that it's specified per constraints of all these thresholds and every all the different plasticity parameters are specified on a per constraint basis and each one of those parameters can be scaled by a point attribute it's implementation is most similar to the wire solver which has similar parameters and a somewhat similar implementation so the plastic flow begins whenever the constraint has exceeded the plastic threshold and so for Ben constraints that's specified in terms of degrees for stretch constraints like distance that is specified in terms of either a ratio like like ten percent one so it'll start having plastic flow once it's stretched past ten percent or an actual just regular measurement so say 10 centimeters so plastic rate is the parameter that specifies the amount of flow per time step so basically how quickly it blends from the rest state to whatever the current deform State is so if it has a high plastic rate it will very quickly look like the the geometry has deformed to match whatever the current state is and if it's a low plastic rate it'll take a while so it can be deform for a while and it will actually still snap back to with something close to its original original state and we'll see some example of that and finally plastic hardening allows the constraint to be either stiffened or weakened during that plastic flow so that can be useful for effects like if you have a character that's gonna say mashed out a bunch of grass or something you want the the grass to look like it's been sort of stiffened and mashed together in place so they won't then be blown around by any wind or something like that because it's it's basically been been hardened in the process of deforming down to that that new resting so let's jump into Houdini and see some examples of this so this is a simple example of using plasticity with hair and in particular for using it for using Bend plasticity so all we're going to be modifying with a plastic flow here is the of these particular of all these hairs so all we've done here is create a grid with some points on it and created a bunch of lines that are just straight I think there's a couple of thousand hairs here and then we've created hair from it we've got this enable plasticity on and so here's that plastic threshold which is five degrees as we've specified here plastic rate which is two and then we're actually we actually not creating this attribute yet so this won't have an effect yet and then we've got a little bit of plastic hardening so if we hit play here we've got a bit of wind going in the end of elam sulfur and we've got this collision object moving for until moving through the hair and so it were visualizing here is actually the plastic flow so the amount of basically the blend of that blending from the original state of straight that has occurred towards the deform State and so just to jump into the velum solver real quick what's happening if we've got a wind of that after 72 frames stops and the collision object has already obviously moved past the where it's gonna be colliding with any hair at this point so this is the new state so if we're if we hit play we'll actually see the hairs aren't moving anymore but they've sort of deformed to this this state that is a result of the hair here has just been blown by the wind and you can actually sort of see what the noise looks like in the kind of parts of wind that we're blowing it around and then this part obviously has been done by the collision object itself so you can sort of see this and so you can see here like in this through this section here even though the winds blowing it around the rest date is now bent through all these sections here where the collision optic went through so the best way to kind of figure out how to set these values is actually to do something like let's just move the rate down to zero for now so that's effectively turning plasticity off and instead of visualizing the amount of plastic flow we're gonna visualize the bend angle and so if we hit play here we'll see everywhere this is red is where plastic flow is going to start happening that's why you saw it in like this section up here and down here and then of course obviously where the collision object is there's lots of it here if we wanted to have these sections here maybe not respond quite much as much we can increase our visualization so that we are looking at a maximum angle of 10 and we can see that in that case the only place we actually exceed that threshold is where the collision object happens so everything else are very rarely does it actually get red so if you want to go back to our plasticity and go back to say 2 and change our threshold to 10 sorry I need to change our visualization back to the plastic flow so you'll see that we're actually not getting any plastic flow here no at permanent deformation that's tiny bit right at the edges here but in general it's all happening just in this one section or the collision object lectures because that's the only place that we're exceeding that threshold and then if you look at it you can see though that it's actually not deforming the collision area of that and much and that's because it only defendant it only deforms it past 10 degrees for just a few moments like not very long at all so what we would want to do is if we want to get more plastic deformation just localized to where that collision optic is then we should increase the rate so with that what will happen there we go very high here is as soon as it deforms just in this collision area it'll much more quickly move to that deform state so you can see that the the hairs through that collision object actually will stay down will stay deformed much more than they were before because very quickly they move to that to that bent state so it does a pretty good job of bending the hair down just where that where that collision arms kiss and then finally if we go back to let's go back to our original settings or something close to that we can create a an attribute on these points and so we'll just we're just doing it where we set basically everywhere on the positive z-axis to to zero and everything over here is one and then we're scaling the plastic rate by that and so the effect of this will be to make it so that there's actually no plastic flow that happens in this section here because we've scaled that rate to zero and so any plus plasticity that's going to occur will only be in that section where we have about attributes given a set to one and so you'll feel you can see that that that's limiting the areas of the plasticity can happen so that's a an example of hair and in general class to see it works really well with with hair in part because it's pretty easy to make very stiff hair there's usually only there's not that many points in a lot of the the you know there's ten points here and the constraints for her hair can work pretty well to be stiff there's they're really on the operating along this one dimension here it's a little tougher to get really stiff cloth to do things like bending metal or something like that in fact with vellum it's quite difficult to get high res or even medium res really high res I'm sorry really stiff cloth so we'll look at how you would do something similar to this with cloth but just be warned that it's it's a little tough to do at anything approaching sort of production resolutions so here's an example with cloth and as you can see it's it's quite low resolution and we've actually got a or even cheating it a little more by turning gravity off at the beginning but if we hit play here when we've pinned the edges over here so we'll see as we move up again we're doing Bend plasticity here so we'll see that we're getting this bending this plastic bending through all our plastic flow through all this section and then after a certain point we disable those pins or they're just stopped pins and let the let the cloth fall down and you'll see that it's now it's state is now this deform state so it's sort of acting like like bent metal or something we're actually using bail and post process both to visualize it and to some divide at once so what this looks like because it bends up and then just drops down like that you need to it's now bent state and if we go into the solver this is again the soft solver I mean the soft version of the velum solver so we're doing a few things here we are at frame 40 we're basically turning off plasticity so we're turning off for all of those Bend constraints we're setting their plastic rate to zero so once frame 40 is when it starts to fall so we want to turn off plasticity at that point so that everything that happens in this sort of rocking back and forth doesn't cause any more plasticity or any more plastic flow this removes the pins so we're just doing a music a popper angle to set that stop to zero so we've seen that before and then the other thing we don't have any gravity on it so we're turning gravity on at the same time so that just makes it so that it's not like bending down at the beginning or anything and just been and just bending down when we are just falling down when we have also removed the pins so you know as I said this is if you're gonna do these types of effects with the element ends didn't really need to be pretty pretty low resolution cloth for it to work but you know you can then do things like take it and use it to maybe point deform or somehow deform higher resolution geometry but do all the ideas for how the plasticity works are very similar to to hair finally I wanted to talk about soft bodies in grains in Belem there are three types of soft body typically simulated with vellum and the first two have a shelf tool or a tab network tool that can help you set these up and the first ones called vellum configure soft body and that sets up two vellum constraints ops the first one just creates cloth for the external surface of the soft body with struts which are basically like Springs that are internal to the soft body and keep the overall structure of the other soft body and you can make them sort of bouncy Springs if you want for a soft body type effect the second one is the vellum configure balloon tool which again uses cloth for the external surface in this time in this case it's often pretty stretchy cloth because you wanted to act sort of like a balloon and then the pressure constraint will create will maintain the overall volume of the enclosed soft body and you can do things like increase or decrease the rest length on that pressure constraint to mimic like the inflation and deflation effects and then the final type we don't have a tool for at the moment but I wanted to just show how you set it up quickly which is to actually tetrahedral eyes the soft body and then you can use the tetrahedral volume constraint to make the tetrahedra maintain their volume and then use the distance along edges so basically you put sort of Springs again kind of soft Springs along each tetrahedral edge to keep the soft body from deforming too much even while the volume is being maintained so we'll look at an example of setting that up and especially in that last case the typical way are the really the best way to work with soft bodies is often to simplify the geometry that you're going to be simulating with and try to get a very uniform try to say triangular mesh and then usually they're like the point deform or cloth deform workflow to to form the actual render geometry before rendering and that's just because a lot of times the way that your render geometry is modeled you'll have very small polygons in particular areas that are just before just to make it look right but in general for a simulation you want the much more uniform mesh if you can do it so we'll look at it an easy way to create that then finally we'll talk about grains which are similar to the grain sulfur that's been around for a while so we're not gonna spend too much time on them they generally need additional sub steps versus the one that comes as a default for vellum and then I just wanted to show a quick setup using grains part plus some breakable glue constraints and attach to geometry constraints which can give some interesting effects so let's jump into Houdini and look at that I wanted to start out with a pretty basic deflatable balloon type simulation and so here we're just gonna take all these different copies of flip here and we're going to inflate them over time Harold's hit play I've already cast this out to disk and this object comes down and squishes them and then lets it up and then at the end they they deflate so the way we set this up is we're taking the just flipped test geometry and as we can see this is where like this area here when we're doing soft bodies or even cloth really most kinds of simulation this area here is not going to be very friendly for instance with our simulation because it's got all these tightly sort of squeezed together polygons and lots of points right in this area so we want to generally have a more uniform mesh if we can when we're doing simulations so we're gonna first boolean end which is going to just sort of because these are separate pieces of geometry like the legs are separate from the body we're gonna bully in it so that they all become one piece of geometry then we probably reduce it and we're gonna actually rematch on top of that then you can see we get this nice even mesh that's gonna be really nice for simulation and and simulation for soft Bundys it's also lower resolution which means it'll be a lot faster than if we tried to work with the with the regular mesh and so then we've just got reference copies here so we've got a copy that just as a copying transform here to create a bunch of copies of the simulation data then we reference copy that over here and we do the same thing with the render geometry and again we have and we do the same thing for color then over here we're actually setting up the soft body so we have the cloth which is kind of stretchy not not too stretchy this was a quote these two are equivalent to basically the devel and configure balloon shell tool and then this pressure constraint and we are putting it into an output group called inflation and then when we go into the velum solver we actually have this foam constraint property that we've looked at several times before but we are just coming up with a random scaling of the rest length scale so basically the rest length width in this case of the initial volume of these guys and then we've got this animated pressure that we're multiplying advice was just going to animate to a real high value to inflate everything and then over time eventually it's going to animate down to a low value so it starts out it goes up to ten pretty quickly and then it drops off to 0r actually clamping it at 0.5 here with this max but so then each different constraint pressure constraint will get scaled to some value between 0.5 and 2 so a pretty basic setup really mostly interesting because of the just of this workflow for deforming the rendered geometry so then I've cast it out with a vellum IO stop here and we've I don't know if we've looked at this but one of the nice things about Bill and post-process dick and it'll actually let us look at all things like stress and everything on cashed out values because it's got this same visualization here so we can look at sort of the stress and how it increases by a huge amount as the as the soft body gets and gets pressed down or anything collision object and then finally we take we are time shifting the first frame of the vellum of the cached simulation we're doing a cloth capture here we could also shoot this with point deforming to be honest I'm not entirely sure I remember why we did cloth capture here not point to former because they both should work similarly and then we do a cloth to form so what this is doing is it's basically deforming the render geometry to match the per frame alpha coming from the velum solver from the cast of written to file simulation data and then finally we are transferring velocity over so that we get point velocities on each one of these high-res render geometry and then we're subdividing and actually for something like this it turns out that it can often be faster especially if you're using geometry attribute velocity blur like this to subdivide in Houdini and not subdivide at the manager level so that's actually what we're doing here and the results of this is looks like this so we can see we have the full res geometry here even though our simulation geometry is is much lower but you can yeah once it's once it's simulated and deformed at the right before rendering you really can't tell that it wasn't simulated this at this hi Reds so this is a pretty common workflow and generally a good way of working with both cloth but especially working with things like soft bodies so let's look at a couple of examples of other types of soft bodies so this is a basic example that shows the different types of soft bodies all in one file it's really pretty simple overall that looks a little more complicated just because we've got the different different ways of setting up the soft body all demonstrated here in one file but the general idea of the simulation is we have these three tour I everywhere that read they have plasticity enabled and every word that they the other areas are they don't have plasticity enabled so you can see they all work like soft bodies here but they'll actually get to sort of permanently deformed wherever the plasticity is so this is just an example of so we're setting up the soft bodies and showing that you can actually do plasticity with soft bodies as well to get this kind of permanent deformation so this is actually the this is actually showing the pressure constraint so this is like a deformable balloon so it's essentially and you can sort of see that as it presses out here you get this this sort of inflation effect along these outer parts where it's trying to maintain the overall volume of the soft body but we're actually making so here's the here's the cloth again let's which is stretchy and the pressure we also have plasticity enabled on the print on that pressure constrain so it's actually deflating a little bit due to being pushed down like this and then finally we're just using a vellum pack which is just again just an easy way to put the geometry and the constraints into one piece of pack geometry so we only have to use one switch here so this is as if you did the vellum balloon we're going configure balloon tool this one is if you did the soft body so if we look inside these you'll see these are the struts that are created and so these just act like some internal Springs but again we have things like we can have plasticine plasticity enabled here so you again get a sort of soft body with permanent deformation and so we can actually look at you have played blasted all these different examples out so this is the drugs example you see they're a little more rigid they don't have quite as good volume preservation like it doesn't really sort of look like an expanding balloon because there's nothing to maintain the overall volume it's just those local struts but and again you can get this deformation so the struts across here for example deform a little bit when they when it first hits here and then even further as you as you squeeze it down and then the next approach is to this is actually the tetrahedral one so what we're doing here is we're gonna actually do this solid conform which is a good way to create the potential representation so we see we've got all these internal tetes that are going to be used for the simulation and we've actually got this add surface triangles option enabled and what that means is that not only do we have these internal tetes but we also have triangles that are along this surface everywhere and we're actually not gonna use them in the first case but we'll look at a case where we actually do use these in particular they're useful for making Bend constraints along the surface so if you want to have the surface actually have a bit of bendiness or stiffness along the each triangle edge you can actually do that by adding the surface triangles and then having a separate velum constraints it just does Bend across triangles but for the moment we're just going to do distance along edges for this one so what this will do is that I should create a each one of these tetrahedral edges will turn into a spring and in this case a fairly soft spring and again with plasticity enabled and then we've got I'm sorry I'm looking for on one then we've got a tetrahedral volume ones here and so these are very strong so that what we want this to do is basically when you do this combination the springs along the tetrahedral edges are how much the soft body will deform so how much it'll sort of maintain its overall shape how soft or stretchy it looks versus how rigid it will look and the volume constraint tetrahedra volume constraints are just maintaining volume so you can have something that looks like can maybe squeeze down like a pancake but it'll automatically bounce back up because of these tetrahedral volume constraints so you can generally think of distance as being deformation and Ted volume as being volume preservation and then we do the same thing with packing that together and then the result is this one and then it ends up looking a bit more organic so you can sort of see you get this local volume preservation so it doesn't look much as much like a balloon is like sort of organic flesh or something as you see there's it's kind of maintaining volume around here but again we can have the plasticity so that it ends up with this kind of permanently deformed and loss of volume along the the collision object here and so again it just it gives us kind of more more sort of organic sort of flesh or tissue type look which can be kind of useful and then finally and so these are the three main examples I want to give but if you take this tetrahedral example to sort of its extreme you can actually make these tetrahedral edges internally very stiff and then they actually start to act sort of like these struts that we looked at before so again that would just give you an object with very stiff strings internally so another way to create soft bodies that are actually a little a little more rigid is to create a very strong Springs internally or I should they're not that strong but pretty strong strings internally and then actually use those create those bend across triangles constraint on that surface triangle group so what we're having is a combination of fairly stiff springs inside the object along with Bend constraints on the surface of the object on these surface triangles and and then with plasticity in both those cases as well and so what that looks like is this and you can see it look it's a bit more rigid actually and looks more like a sort of hard-shell kind of a kind of object and that's from the bend constraint that are along the along the surface triangles and again all of this is just going through a point deform on the original from the original tour I here which when we're using the things like struts and and the pressure constraint really isn't required but when we're doing things like tetrahedra lysing it really is so just in this case we're going in all cases we're going through this point to form and then subdividing at the end so that's all I wasn't sure about soft bodies pretty simple but but there are a few different ways to to create the soft bodies and they all sort of have different properties so it's worth playing around with the different different setups here finally we'll look at a great example and this is again fairly straightforward I just want to show how you can use vellum constraints on top of grains so we're starting out with another torus and creating grains from them using the the velum configure grain stop here and then we're going to use the cluster stop to actually create a bunch of different sort of clusters within this point cloud here and the reason we're doing this is because when we actually are going to we're gonna glue these grains back together again when we worked with glue you've actually got this cluster attribute and what this means is the glue will actually only look at other points within the same cluster so we're when we have these clusters were gluing them together we're basically gluing these different clusters to themselves only two points within the same cluster so we're basically creating these sort of a bunch of different pieces of this grain geometry here and you can actually see that if we give an explosive do you here on just the constraints themselves so these are all the glue constraints so we've basically created a bunch of different pieces with with these glue constraints between only the only the grains within those pieces and these are not terribly stiff they're their stiffness thousand so they're kind of soft Springs and then we're creating a bunch of constraints per point so each grain can point at a bunch of can be configured to a bunch of other points around it the other thing we need to be careful about here is normally this group type isn't quite so important so you can normally leave this group type as like primitives the problem is that we don't have any primitives we only have points here so if you set this to primitives basically all the constraints go away because it's trying to create a group out of all the primitives and then use the points in those primitives but we don't have any primitives so if you're doing constraints on grains you need to make sure you set this to two points you can leave this part blank in both cases and then finally we've got just some detached object chance just means sort of the chance that particular grain won't be attached to from another grain so we'll get sort of falling off grains within these pieces which is convenient looking and finally we created just a scale from across the Y part of the grains to basically make the glue weaker as you go towards the top and then we're we're using a scale by attribute to control that and then we've got some pins across the top here and they're pointing at this at this target geometry which is just a really simply animated version of the of the grains over here so if we look at what that looks like the grains are falling down and then they're sort of sticking together on their particular pieces and then the pins are actually holding this part up and they move apart and then they these constraints break because we set the breaking here good so then the other thing we can do is kind of interesting we can actually get a little bit of a like viscoelastic fluid look I just surfacing this it looks a little boy now shaving cream or something but if we look at that in real time it looks and this is just going through and showing the simulation and then the visualization with all the glue constraints and then finally the surfaced version this is all those glue constraints and we can see as they're getting they're getting read here is they're about to break and they break-ins would move forward and again and again it's a little easier to tell that these are really separate pieces of of grains that are done per cluster then if we wanted to we could do things like add a attach to geometry constraint so have it fall down on this grid and so just you develop constraints stop in here set to each frame again make sure that we set the group type to points and then reference that same geometry and creates you know loose I mean soft breakable attach constraints and you'll see we're getting those here these you can see these are the attests and geometry constraints all these grains are actually getting attached to this collision object here and they're sort of sliding down but they're they're breaking as well so all this shows is just that the grains can be a lot of these like sticky collision effects and you know breaking up pieces and that sort of thing can all if you if you set up the constraints the right way can all be used in the similar way to the until we looked at with regular geometry all these same sort of techniques apply which can lead to some nice effects anyway this has been a very long class thank you for your attention and for listening all of these example files will be available and so I hope they're very useful to you thanks very much
Info
Channel: Houdini
Views: 37,789
Rating: 4.9881482 out of 5
Keywords: vfx, visual effects, visual effects software, vfx software, cg, cg software, fmx
Id: NwabG-znu9Y
Channel Id: undefined
Length: 176min 23sec (10583 seconds)
Published: Sat Jun 08 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.