Vellum Constraint Features | John Lynch | H18 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 new vellum constraint features in new Deenie 18 so we've introduced several new features for constraints in vellum the for 18 and some of these are workflow enhancements and the include things like automatically computing mass and thickness for your vellum geometry based on density which makes it much easier to work with geometry of differing resolutions we've added the idea of normalizing stress computations over sub steps and which is really just so that if you are doing stress and braced fracturing effects if you have to change the subsets you shouldn't have to change those threshold values very much we've introduced some new constraint features such as stiffness drop-off and tangent stiffness we've added the ability to stitch vellum geometry points to other pieces of L and geometry but within the interior of a primitive rather than just point to point which is how it had to work in previous versions of adeney we've added sliding for stitch and attached in geometry constraints and this is a the idea where the target location on the part of geometry that the constraint is attached to you can actually move along the target geometry during the simulation and provide some interesting sliding effects and then finally we've introduced a new type of constraint called as rigid as possible or a wrap constraints and these are very useful for organic effects simulating organic materials and just general soft body anything that needs to have good stretching behavior and good compression behavior and these show up in both a triangle stretch and the tetrahedral stretch versions so we'll go through what those look like and how they work so the first workflow enhancement I wanted to go over is the automatic computation of mass and thickness for the velum geometry so this becomes important because we want to reduce the resolution dependence of the of the simulation so as you change resolution of your velum geometry the behavior of the simulation shouldn't change all that much and if you're working with something like infinitely stiff cloth as you increase the mass if it's infinitely stiff the mass doesn't really make that much of a difference but for something like Ben behavior how many wrinkles you get into your cloth having much heavier cloth will actually been fairly differently than very light cloth so if you were trying to dial in particularly look for different resolution geometries it could be sort of difficult the other problem was that we had a default uniform thickness that we would use for all vellum geometry and if you fed in very high resolution geometry and started singulated what turn out that all of those points actually started out overlapping which just caused some different types of problems with collisions in general and so this is much more of a sort of fire-and-forget type it set up you can you can set up and not think too much about setting any of your thickness values so the way it works is it will use the length of a polyline the area of a triangle or the volume of a tetrahedron along with the idea but a density of the material to compute mass and then as well if we use the edge length to compute a thickness value so that the points won't overlap both of these values can be scaled by point attributes so you can paint areas of higher thickness you can compute at different ways and we'll look at a quick example of doing that so this Auto computation is enabled for all vellum tools and weeding the 18 so if you create cloth or hair or tetrahedral soft body for instance all of those configure tools will be set up to use this Auto computation if you load in a previous file from 17.5 or 70 no it will be set to the original previous setting of set in uniform so behave the same way it did before but I would encourage you to use this although computation and all your future setups and maybe even convert your old ones to that so we're gonna jump into edenian and see how this works so now we're going to talk about how to use the auto computation of mass and thickness in Houdini 18 for vellum this becomes actually pretty important in the context of cloth which I'm not gonna go into we're gonna have an entire masterclass on some of the new features that are very cloth specific for Houdini 18 so I'm gonna show it actually in the context of this tree simulation here because it shows some different uses for it where it's still pretty valuable I think so this is a very simple setup we just created it followed l-system here and it creates this little tree if we click on it we'll see that it's about a meter tall if we look at this size you can see that's about point nine seven so let's ground a meter tall so we're gonna scale it up actually but so to get started we just create a little root point here a little group that just encapsulate this bottom point here and then we'll transform up the tree by scale it by three everywhere so it's about a three meter tree now and then we'll create some vellum hair out of it and we'll set the thickness very I'm sorry that they been stiffed that's very high and seemingly and if we run this we'll actually see that it doesn't okay job but it's actually sort of falling over so we're obviously not getting this extremely stiff Bend stiffness that we were that we were looking for part of this is just because we're not using enough constraint iterations and so if all we wanted to do was keep these same values and and get a stiffer simulation we could just increase the substeps and now when we play it it's obviously slower but we're getting much more constrained iterations per actual frame so we get this much stiffer simulation and that's fine as an option but well I think we should be able to do better and so if we look at let's start off by looking at what these parameters do and we can the auto computation parameters I mean you start to get some ideas about them what the issue is here so what we're doing here we're actually visualizing thickness and this is a new feature in the Deenie 18 so you can actually visualize the thickness on the vellum constraint node instead of having to go through the solver so and you can sort of change these parameters here and see the effect of the thickness immediately so we've got the mass set to calculate varying and we've got the thickness set to calculate uniform so both of these options are new and Houdini eighteen the the beany seventeen equivalent would be set in uniform this is how these things work before you would just set every point to a uniform mask and to a uniform thickness so the visualizer is useful even in this context at least you can see before you start single ating whether there's any overlap but generally we want to use the calculated uniform and calculate varying and so calculate varying means that each point will actually have a different value and it'll have a different value based on the cop mutation of it's sort of immediate geometry calculate uniform means it will take some sort of averaged over the entire instead of connected geometry and then apply that to each point so let's look at the thickness first and so what we're doing actually is looking at the edge length so the different the length of the edge between each point and then making a calculation based on that so because of the calculate uniform are looking at the average edge length and then scaling it by 0.25 and then assigning that to the thickness everywhere if we did this calculate varying then we would actually see and we set that to one you can sort of see here what this is doing basically in each point is just getting it's kind of edge length to the next point to all these thickness values all these spheres will basically line up at one so we want to go back to like a quarter of that so this gives it pretty good spacing to start off with and actually was kinetic integrity influenced so as we run this simulation we can also visualize with a thickness here so let's turn that on so we're just seeing the same thing we just saw that it's also got this nice extrude option that when working with polylines will actually draw a little cylinders along it to to actually let you visualize the thickness along the line and if we hit play we get kind of an idea of the problems is that we're simulating a tree but the in fact mass of all the branches up here are exactly the same as they are down at the bottom here in the trunk instead of having this big thick trunk that's that's very strong and hot and dense and heavy mass and then these lighter branches that are gonna be supported by the constraints so let's look at how we can use these computation values to fix that really quickly so this is gonna bring use this edge transport node and edge transport does some kind of interesting things where it can calculate things like distance along a network of edges which is what this is so we've got the sets of the edge Network and we're just basically gonna be calculating a distance value along these edges from starting from that roof point that we started down here so because what we're gonna do is we're going to calculate the distance from the root to all these points up here and then use that to create a variable density value that's going to make us specify that the lower points down here at the trunk are much denser than the ones that are up top here so if we visualize this unless you have nothing we have this well I say so well how to visualize are real quick on the distance parameter I mean the distance attribute that we created so you can see that it starts out blue so it's zero down here and it gets higher as we go up and in fact we can we change that to a a marker we can see the values so it starts at zero at the root and then we're just measuring the distance along each branch and so as we go up to here we get up to around 1 meter so we're gonna actually create a density value and there's a very simple thing we're just gonna create the density and we're gonna map that zero to one because it starts out at zero down here and goes up to about 1 and we're gonna say well the density of the roots 0.1 on the density and these are kind of made-up numbers because we can scale them later as we want to in the in the velum constraint but we mostly the important thing is that it's quite high the brute and then at the branches it's quite low and then if we go into our vellum hair which lofts are off then when we say calculate very masculine sorry let's switch this switch over here and so now we're gonna actually be scaling by this density attribute before the density actually didn't exist that was just created and treated like one but now we're actually scaling by the density attribute and then if we go to our vellum solver and hit play you'll see that all of a sudden we have this fairly stiff simulation because we basically got these high mass values down here and these much lower mass branches up here we've still got the same thickness everywhere which looks a little bit weird so in this case let's go ahead and change our thickness calculate varying and we're gonna scale by an attribute well actually go and use that same density attribute and you can use a different app in fact it it defaults to um to a thickness but we're gonna go ahead and use density just for convenience so we're gonna have to scale this way up you can see we have these tiny little points if we um and you know everything is extremely narrow here so we want to we want to scale this up so as we scale it up you can actually see the we've kind of got this nice thick trunk here and the branches are very narrow and you know it's gonna look pretty much the same because there's not too many collisions going on but if we do things like make forests out of this and maybe you remove the pin at the bottom we right now we're tuning the route but we'll let them sort of all fall over play and we'll see if it answer the clue didn't start to happen again you've got these and not a lot of collisions happen in this case but you've got these thick heavy maths trunks down here and then these much lighter thinner branches up here that are all interacting and I'm sort of more believable way than if they just been these ol big thick branches or all uniform thickness through the extreme entire extent of the tree so this is just a quick example of how you can use those computation values to your on kind of get have more control over any sort of simulation where you've got geometry that's the varying in thickness or in mass along it and in the cloth master class you'll see examples of using differing resolutions for doing some of the same types of effects the next workflow related feature I wanted to go over is normalizing stress computations and this is important mostly in the context of breaking or tearing cloth based on something like the stress threshold so we can now normalize these computations over time which just means if you need to change the sub steps for some reason if you for instance introduce some very fascinating collision geometry and need to increase the sub steps you shouldn't have to change the values you're using for those threshold very much relative to the previous versions of Houdini this also works well in conjunction with density computed mass so what we were talking about just before if so you've got cloth that has a consistent density but you're changing the resolution does the stress values should still be fairly consistent so it just makes it easier to set up values that will work across a wide range of time steps and resolutions so it's enabled by default in Houdini eighteen similar to the although computation but will be off for any versions previous to that just so that you get similar behavior from your old files but again in future setups you should probably always use the normalized trust option on so it's just a kind of a convenience feature and I'll just will quickly walk through how it works so this file it's just a really simple example of cloth tearing we've got a planar patch here that of the cloth and then we've drawn a curve across that cloth and used edge fracture just to separated it into pieces yeah so you can see the two pieces here that we've uh that we fractured the cloth into then we turn it into cloth and we weld it back together again so a very basic tearing setup and we're and we're pinning this corner up here and we've got a low breaking threshold for stress here the type of breaking stretch stress and then in that solver were actually visualizing that stretch stress actually let's assume you are wells and our pain photography as well so we play here we'll see the stress value is kind of starting up here and then where you'd expect up near the pin and then it starts to tear and then the stress kind of propagates along the tear here I'm sort of see if they get red basically these will start to brai and so we've we've actually tied this visualization here to the same value as the well breaking so again just a very very basic setup for tearing the problem is that if you then went to the velum solver and I should be clear under advance so now all of these what these used to be folders and now they're collapsible dropdowns so under the motion one we have this normalized stress which again in 18 defaults to on but if this were a file brought in from a previous version the vinegar would be turned off so it's off here and if for some reason let's say we had to move up to three sub steps for some reason new fast collision geometry something like that and hit play you can see the stress values are completely different the ones that are being computed by the solver for all of these stretch constraints in the cloth they're getting very different values and so basically our tearing doesn't work anymore so we would actually have to go in and change these values fairly significantly these threshold is fairly significantly to get some sort of similar behavior so I think over here we've got our pretty similar setup let me turn that visualization on real quick so they're all weld and pin to target and we're getting a similar tear at one sub step and you'll notice that the values we're using are quite different and that's because these values are being normalized over time so the why the normalize dress is not on by default because you have to change all these values so we're getting it we're using a different guy here for the Terran but what's nice is that because on the solver on the Advanced tab we've got this default normal I stress on if we say move to 3 sub steps let's see the stress fighters are fairly similar you're not gonna get the exact same terror just because you're moving you're doing more sub steps here and so things are gonna look a little bit different so you might have to go from say well it seems to tear faster so you might have to go from say 0.05 5 to like 0.06 for example but it's a very small change I mean know the values in that same sort of ballpark should should gently work and then so then just to demonstrate that this holds up pretty well with different resolutions if we let's say switch to it at a lower resolution cloth we'll still have a similar fracture across here because we're just using a based on this curve if we change we need to change the pin point real quick the point numbers have changed and then I should let's go back to one side step and you see the stress values are around the same so the tear works fairly similarly and that's partly because we've got this the defaults for the auto computation of a phone of mass here so that the the overall mass of the of the piece of cloth is staying the same even as we change resolutions and so the fracture or the tear is working fairly similar both across these different resolutions and across the different number of sub steps so that's the value of the normalized stress option now we want to move on to new features of constraints that we introduced in Houdini 18 and the first one to talk about is stiffness drop-off and so this is the idea that you can actually have a stretch or bend constraint reduce or increase its stiffness as the constraint moves away from the rest state so that would mean for a stretch constraint as it moves further away from its initial rest length so let's say it's a pin as it moves further away from the pin it can actually fall off and stiffness or increase in stiffness so it can say start at a very high stiffness or me stiffness method stretches it will actually get weaker over time if it's reducing you can also use it with a bend constraint so you could do something like have a bend constraints start off very weak and then increase as it moves away in degrees from its initial orientation to get stiffer over time and both of these can be sort of interesting effects this feature was actually introduced in Houdini 17.5 but we've never demonstrated it before so I just wanted to give a quick demo of using it in the context of a stretch constraint so let's move into Houdini and see how that works let's look at an easing stiffness drop off with stretch constraints so we've got a simple set up heater where we've got a grid that we're applying some attribute noise to or we're creating this pin scale attribute this just using noise mapping from 0.1 to 1 we've already got the visualizer on that so let's let's look at that so the areas of the red will be very stiff and the repairs that are blue will be less stiff and then we're creating cloth from that grid and pinning all of the points so we're putting every single point and then we're scaling the stiffness of those pins they're actually uh they're uh they're soft pins and we're scaling it stiffness by that pin scale entry we created so if we solve this and we're visualizing those pin constraints on the visualize side by stretch distance and so we hit play we can actually see if those blue areas where it's weak it sort of stretches a lot from the original pin position and the red area is it staying much closer to the original position so what we can do is we can so we're looking at the stretch distance here and so these are stretching maybe then stretch distance is always in terms of length so this is point two meters so this looks like there may be stretching about half that and what we can do here is actually go to the pin and we're gonna turn on that stiffness drop-off for the stretch constraint and so what's going to happen actually if it's coming soft moment what's gonna happen is as these pins stretch they're actually getting weaker so we've got a stiffness drop-off and it's decreasing so I think it's closer and closer to point two meters of stretch it's falling off to zero the stiffnesses so you can see where we're visualizing stretch distance here as they get closer and closer at about 0.205 they're starting to get closer and closer to returning dread by the time they turn red they are actually down to zero a stiffness so as this stretch distance approaches this value the stiffness gets weaker and weaker because it's such a decreasing as a Medicus to zero as it reaches that full stretch and so basically we've got a bunch of constraints all these constraints on doing anything and you get this kind of soft release effect of the cloth from the pins just sort of releases it gently sort of on develop of ground now the other thing we can do is since these these constraints aren't doing anything these are all zero and effectively having zero stiffness we can actually make them breakable and use that same threshold so we're gonna we're gonna make these pins breakable by the same stretch distance that we're using so when they get to zero effective stretch stiffness because of that drop-off we're gonna just go ahead and break them it'll look pretty much exactly the same but you'll see these constraints actually go away as we reach the same that's that drop off point so again you get this kind of soft release of the constraints so it just sort of fairly gently puts the cloth down because the stiffness has dropped off to zero so that's just a very simple example using the stiffness drop off member it's always in terms of distance so in the case of the of a length constraint or stretch constraint it'll be length and will be meters and in the case of the case of a bend constraint it'll be it'll be degrees so that is a stiffen strong off the next constraint feature I want to talk about is tangent stiffness so that's the idea of once you've constrained say cloth to a character's waist for example you want to constrain any movement of that cloth in the direction tangent to that target geometry so you don't want the cloth to slide up or down away from that original attachment location so it just does a better job of holding cloth in place without sort of falling down or rising up it only works on attach to geometry constraints so when you're attaching vellum geometry to extra geometry you very often and usually the collision geometry so for example like the cloth to a character body it works in conjunction with sliding which we're going to talk about soon it's sort of fights with sliding as well in a lot of circumstances so we'll also look at how that happens and it's worth knowing that this actually adds another constraint primitive when you turn on tangent stiffness and it's mostly worth knowing that just if you're doing something advanced like braking or something like that but in any event let's look at a quick example of how you can set this up and how it works so see an example of using tangent stiffness to hold up a piece of cloth better on its collision geometry so here we've got this sort of something like a skirt that we've subdivide just gets more resolution and then there's another two button that's gonna be on the inside that's gonna act as our character body and we are attaching this skirt to to divine no so there's just using the attach to geometry type and we're doing it for this edge that's around the top of the skirt here so fairly simple if we solve this we've got all these distance constraints here that have a rest length of the original distance from the skirt to the to the body and so if we hit play you'll see that the first thing it does is it falls down so it's maintaining the distance of the points on the skirt to the body the problem is that it's because that original distance was there was actually a fair bit of a gap there that distance then it just as the skirt falls down it can maintain that distance but the skirt is moving in the tangent direction like basically falling down vertically as soon as the simulation starts so even though the constraints are being satisfied it's really not probably what we want it's not very not a particularly good look so what you might do previous to Deenie 18 is you might say okay well either use different collision geometry that maybe is expanded outwards or something like that or you can do something like say okay well let's just change the wrestling scale so maybe I'll change that to 0.25 and so it's gonna do is it's gonna basically decrease the length of all of these strains and sort of suck in the skirt around around the waist as you see here so that's not a terrible solution but it also changes the look of the skirt now you've got this sort of all these Springs are these distance constraints are actually much closer and so it's kind of created all these wrinkles and kind of folds in the skirt that you may or may not actually want to be there so what kind of stiffness is designed to do is actually let you say well with this particular set of stiffness here I want to actually keep the skirt constrained in the tangent direction of the collision geometry so if I get clay you'll see what it does it basically has another constraint applied that holds it in place in the tangent direction so it's maintaining the distance away from the waist but it's also maintaining its distance from this normal basically out from from the waist here so the shape of the skirt stays much closer to what was originally and it stays in the same vertical location as well and if you decrease this a lot like say put this to say ten or something like that you'll actually see there's there's actually for the visualization this first top sphere may be decrease it further to one yeah this first top sphere is the normal location and then this is giving another indication of how far it's dropped away from that normal location so this is how much it's moved in the tangent direction and normally obviously you probably don't want a lot of that a lot of that movement so the higher just get a tiny bit of movement there and you can obviously make that even stiffer if you wanted to so the one thing that's also worth knowing is if we visualize the attach constraints that are coming out of here so we've created a groove here and we're looking at the constraint geometry and let's look at the sand tight so normally there's just a bunch of these strong attached constraints that we've created with this almost infinite stiffness but if we enable tangent stiffness we actually get a whole bunch of new well actually the same exact same number of new constraint primitives that these attach normal constraints so what it's actually doing with this stiffness that we're setting here so it's actually doing they're having another constraint that's setting a distance to this normal from any of any attachment point and they will have actually if we look at target values they'll actually have the same target values though they'll be pointing to the original target geometry which is again in most cases of the collision geometry so just like the attach constraints these attach to normal constraints will be pointing at a particular location on a primitive but then it'll be using the normal out there to try to basically stay constrained to that normal so that's what tangent stiffness does it actually creates these separate set of constraints that will constrain the location to the normal as well we've also made some enhancements to the stitch constraints in Houdini 18 which just as a reminder our distance constraints between pieces of vellum geometry and before Houdini a team that could only be point-to-point so you could constrain one point on a piece of cloth to another point on either the same or different pieces of cloth but you couldn't for example constrain that point to the middle of a quadrilateral on that cloth which just ended up being fairly limiting when you were trying to say attach a you know a pocket or something to the middle of a of a shirt so in hitting the 18 that can now that point could now be constrained to the closest location on a primitive so for example the middle of a of a quadrilateral that target primitive can be a polyline a triangle or a quadrilateral it actually when you enable this it actually creates a different constraint type called a point print constraint which you don't really need to know you'll never see it unless you're actually looking at the output of the velum constraints on the UVs are stored in the rest of Ector so that they can be used in the constraint solve and then this is not really a stitch enhancement but the attach to geometry constraints which again remember our velum geometry to external geometry like linking geometry those can now target polylines as well which is new to add any eighteen so we'll see an example of that when we talk about sliding actually but for now let's look at an example of the new stitch enhancement so another very simple example here we've got a hanging piece of cloth we're calling a shirt and we've got a smaller piece of cloth here we're calling a pocket and we're just going to stitch this pocket to the to the shirt so here we've got this mutant location on primitive off this is how this would have to be set up in anything before 18 18 because it's this option wasn't even available on stitch constraints so if we hit play as you'd expect these these points here on this pocket cloth are constrained to the nearest point on the larger piece of cloth and you know it's staying in place it's kind of okay but as if anything sort of pulled on this cloth it would start to become extremely obvious that everything was attached to these points and you get these weird situations where like these two points are connected to this this particular single point whereas all the other ones only getting connected to one point so it's just a little bit of an unwieldy situation and if you did something like well I want to I want to make them you know closer to their pin location so I'm gonna decrease the wrist length scale to say 0.5 you start to see these you know as soon as you do that and you realize that you've got this kind of long distance constraint that's really creating a lot of cooling and wrinkling that's a kind of unpleasant in this setup so with needing 18 you can now turn on this use closest location on primitive which an option that's been for the attach to geometry constraint available but now it's available for stitch constraint and now you can see we're stitching these particular points to the interior of these target primitives and so you just get kind of a much nicer sort of consistent set up here where all of these points can actually go to truly the closest location on the target geometry and if you do something like you know decrease the rest like to get it it really makes no difference because all it's doing isn't making it become a little bit closer to that I'm already very close point and as I described it actually is creating a different constraint type here so if we turn that off we get what you'd expect which is a stitch constraint with the rest length and if we turn it on we get a slightly different constraint type and we're actually storing the UVs here in this rest vector you still have the rest length but you also have book location is specified by with SUV store in the risk factor the complication on the primitive and then the the other thing to see is that this actually works with polylines as well so if we switch to where our target geometry is going to be this line here this piece of string and it's the same sort of situation where if we hit play it generally works okay we've got cloth constrained to the to the string but again we've got you know each couple of these target points have two constraints going to them one of them has one it's just kind of unwieldy and again if we do anything like decrease the rest length things just get very ugly quickly so again we can use this use closest location and these constraints like should be so close to points but these are just sort of in the middle of these line segments here and if we hit play we could just get a much nicer smoother simulation and we can do things like decrease the risk of length scale and it just looks fine because all we're doing is making these points go closer to to the location on the polyline itself so this just can be really useful with with sketching in general it also makes sliding available or possible because we can slide along the interior of stitched primitives and so we're actually going to see some examples of that of that next the next new constraint feature I want to talk about is sliding the constraint or at least that's how they were referred to in the launch video for Houdini 18 if you happen to see that and this is the idea that you've if you've got sketch or attach constraints they've got a initial target position that the point is constrained to and with sliding enabled that position can actually slide along the target geometry in the launch video this was described as a new type of constraint it we've looked at some new constraint types in this master class so far this is actually not a new constraint type it's really just a new feature of this stitch and attached constraints essentially you enable some parameters which create some new attributes on the constraint primitives and that acts as a signal to the solver to try to slide the target point along the target geometry during the simulation so that prime parameter is just called sliding rate which controls the speed of sliding it can actually be scaled by attributes at simulation time so this is different than most of the attribute scaling that we've seen so far in Belem constraint in this case sort of the whole point of sliding is that the points that are involved in the constrain are going to change over time so we actually need to be able to look up those attribute values at simulation time so there's some extra information that's stored on the constraint primitives that allows us to do this and allow some pretty interesting effects that way there's two different methods for sliding the point belong target geometry basically at each time step we need to figure out and sort of the next best candidate location on the target geometry so the easiest and quickest but simplest is just to find the next closest point and that's fast but it can skip over gaps so if we've got concavities in your geometry or some place where two pieces of geometry meet like where the arm might meet the the body of a character it can sometimes skip over gaps because the next closest point is on sort of non connected target geometry and I'll show you the temple of that and the other method is what's called traverse polygons which actually walks outwards from the current sliding position to the next one along the connected polygons and it's slower but since its using connectivity it does a better job of not making jumps over gaps and again I'll show you an example of that it is worth noting that if you're using tangent stiffness that it actually the sliding constraints can sometimes fight against them when they're when you're operating under gravity or where the sliding direction is as a result of gravity and where the sliding direction is also tangent to the collision on geometry which happens a lot so I'll show you an example of that and you can also of course create these dynamically and give something like sliding collisions so if you've seen the advanced realm workflows masterclass we looked at how to do sort of sticky collisions where objects would collide with geometry and get temporary attached constraints that would break and then over time they were to rejoin as the object sort of stickily slabs rolled down the occlusion object this is different where you want to just create sliding constraint when the object collides with the target geometry and then just have it slide down that collision geometry so we'll look an example of that also now let's look at this file that has a bunch of examples of sliding attach and stitch constraints and let's go through each one of these examples and just sort of see how you set up the sliding in the first place and also how its represented on the stitch and attach constraint primitives themselves because it can be pretty interesting and also useful for debugging or if you ever want to create some of these constraint types yourself manually not through velum constraints then it's useful to know what attributes are involved so this is a simple example where you've just got two lines both set up as strings and we are stitching the bottom one to the top thankfully at play we'll see it to sort of slides along the the top string so these are stitch constraints these are the stitching to polyline constraints that we were talking about that are new and eighteen and if we actually look at what's being created here so here's the velum constraints that's creating the stitch and if we look at the attributes we've got the rest length which is the length of these initial distance constraints here and then we also got these rest vector values that represent the UVs within within each line segment and these are actually what are going to be updated as it slides along the sliding rate here tells it how fast to slide so if we turn this off right here that actually goes away and if we hit play then it just doesn't move so there's just a standard stitch constraint so really the only difference is that attribute which tells of how fast or how quickly to try to move the movies target points along the target geometry so if we actually look at so this is looking at the velum the constraint geometry coming out of the film constraints off if we actually look at the constraint geometry as it comes out of the solver itself so this is what the looking what the solver is doing with these constraints and hit play we'll see that the first component of this rest vector cuz it's only at one dimensional thing this is the u along each polyline here the U of the UV but because it's one-dimensional we only need one of them and it's what gets updated as it slides along so these are all changing because it's sliding these along the polyline but the other thing that's changing if you notice this points array here is the point numbers that are involved in each constraint there's normally an internal attribute that you don't really need to save or look at or anything like that but it can be useful for debugging if we turn on our point numbers we can see that like this bottom constraint here corresponds to point number 32 and it's constrained to the line segment between 8 and 9 and as it slides now it's gonna change it now corresponds to the line segment between 7 and 8 and so both of these are being updated so now it's between is 32 and 5 and 6 it's between this line segment so that's what the solver is doing is internally is updating the line segments it's a ch2 and also this view value and the fact that the points are changing just telling you that actually the topology of the constraints is actually changing the this particular constraint the points that are involved in it are changing as it moves between these line segments and if you remember if you watch the advanced development workflow class you'll realize that means that we need to basically read graph color repartition the constraints before we send them to the GPU because the technology is changing so that's just something to be aware of if you see your simulation graph coloring a lot and you're wondering why and you've got sliding enable or sliding between pieces of belem geometry this is why because it's polities changing and there's unfortunately just sort of a necessary cost with doing this kind of operation so if we create a sliding scale attribute on the target geometry so that's what we're doing here is we're just using creating a basically a fall-off here so we're basically going from this is all one to zero over here so this is an attribute on the target geometry and then when we set up our stitch we can say let's scale by attribute number it's gonna use that sliding scale attribute and it's going to for a promotion method is going to use target so all that means is it's going to use the attribute values that are on this target geometry and not try to blend in any of these at all not like an average for instance would try to we these zero values so this just avoids having to set that attribute on both pieces of geometry if you just wanna set on the target which is generally for sliding probably the most useful then you can just set up here so now if we hit play all right to play on the actual with this all visible it will slide freely into that section where it has life skills zero and then it'll actually get stuck this one down here will get stuck in this one can still sort of slide around so if we look at what's being written out to those attribute primitives it's actually saving not only the sliding rate but it's actually keeping track of this attribute name here this sliding scale and the actually promotion mode and the reason for that is normally when you do it like a scale by attribute in the constraint operation here and then when it's creating the constraint it looks at those attribute values scale the stiffness or sliding rate or whatever and then ignores it from then on out so it doesn't look at the values of the geometry anymore it just sets those values at the time to constraint creation but because for sliding you're constantly changing the points that are involved in the constraints as we did we just talked about you need to be able to look up those values at simulation time so it actually has to save the name of the attribute and save the promotion method as well so this is basically a way of having it dynamically update based on these of these values in the end in the target geometry so this is also here just a quick demo of sliding along a polyline so again we just got the same similar line here but the target now is actually external geometry that we've created just this very finely subdivided line that is not being simulated this is just sort of static geometry that we're attaching to so here the same thing we just sort of set the sliding rib on the attach to geometry constraint and when we hit play it'll just slide along here so this is the this string down here this is the val and geometry and this is external geometry is just sort of sliding along and you can do the same thing with attributes and stuff too ah fastest slides so for things like a curtain that needs to move along a curtain rod or something like that these types of constraints along polylines are really useful sliding constraints along polylines and we could this is all needed any 18th so now this is an example of a couple of tetrahedral soft bodies being stitched together and these are using both of these are using this tetrahedral stretch constraint type that is new and 18 and that we're gonna be talking a lot about in just a second but so if we look at this set of there's a few things going on here so we're constraining from the points on this piece of geometry here is being constrained to this piece of geometry that's being stitched to it and then there's some pins of the photographer if we hit play the other thing we've done repainted that sliding scale on here so instead of doing it like I said drop off we've actually used this this gives me this after being paint here just to paint sort of a low sliding speed here and and a1 sliding rate here so that's kind of what you're seeing here is that the we play it back the stitches move kind of slowly along here but then very very quickly down this side and that's why this constrained object kind of tilts as it goes downs because it's going slower on the right-hand side and faster on the left-hand side and then you can see that the location of the stitches is kind of moving along the target geometry sliding along the target geometry and so we've got this gap here and we've actually got the velum solver this so we're going on we're on the Advanced tab under motion I've got the sliding method here we said that the closest point so where it's actually doing a pretty good job of not jumping this gap here and the reason for that is because this sliding rate is painted so low that it basically are projecting along these these constraints to figure out where the next location should be and because it's a fairly slow sliding rate it's maybe only projecting maybe down this far kind of this you know not too far down the actual strain and so when it tries to find the closest point it's actually going back up to this top piece of geometry which means it's doing a pretty good job here so it's so we might be normally worried that it would just kind of jump this gap which would you look kind of strange if we're if we're really attracting the target properly but it's staying the right position because it's a slow sliding rate so a lot of times you can use this closest point if you don't have any concave geometry clearly we do have some in this case or you're using a pretty slow sliding rate if however we go back to the stitch and let's just turn off the scaling altogether and we'll see that it goes now equally fast and then it actually does skip that gap so we're not getting that rotation anymore of the constraints all going at the same speed and then because it's sliding in a very fast rate once these constraints get down here they're sort of projecting back very close to these points the original points the constrained point and they're skipping down they're jumping this gap down to this lower level here which you know depending on the look you're going for the effectors rolling for may or may not be acceptable so this is where this or situations like this is where this traverse polygons method can come in handy because in a case like this it will actually make sure that it doesn't skip that gap what it's gonna be doing is traversing all of these triangles here on the surface looking for a way to get closer to the constrained point as it slides because it can't because everywhere it has to go is farther away it won't ever jump down to this gap so you'll actually get it staying sort of where it should have been at in terms of connectivity it's a bit slower especially at high grads we're actually looking at some some methods for speeding that up maybe optimized just for triangles so I guess my general recommendation is start out with closest points which is a default if you start seeing some jumping between gaps that you don't like try try this traverse polygon setting instead and then the other sort of important thing to realize about this setting is that when we do this solid conform here on this is on the target geometry this could come tree here we're doing this add surface triangles we're leading that checked on and that's so that we have a set of triangles on top of the tetrahedra that make out this soft body and the reason for that is that the target of a stitch constrained like we talked about before can be a polyline a triangle or a quad but it can't be a tetrahedron it needs to be one of those first three types of primitives so we actually are just keeping a bunch of surface triangles here as well which don't really cost that much we don't have any constraints on them they just exist as primitives basically and then when we create those stitch constraints the target group is the surface triangles so it is actually being constrained to the triangles themselves so finally this is another one we're gonna look at the the effect of tangent strength and tangent stiffness that we dive sorry tangent stiffness that we talked about before so here we've got external geometries that we're using and attach to geometry constraint so we're just attaching this this again tetrahedral soft body to this external object and it's painted again so everywhere it's red it's gonna slide quickly and everywhere that it's blue it's gonna slide slowly so we again get this kind of leaning or rotating because we've got slow areas here and fast areas here and so it slides down and by the time it gets to the bottom it'll essentially stop so actually let me show you one thing really quickly so if I'm sliding along and I actually want to just stop it completely the fastest or the easiest way to do that is use the velum constraint property and there's now a sliding rate property within that and we just apply it to the attached group and here we're just saying okay if it's after frame $0.20 the sliding rate to zero and setting a sliding rate to zero this effectively stops all sliding so in this case it'll slide for twenty frames maybe easier from this side and then just stop altogether so again and then so if we look at these attach constraints they have got a painting stiffness set so for now let's turn off our scale by attribute so we're gonna let these that let this slide as fast as it can and uniformly and so it's a slides down we notice that it gets to the bottom of the object hidden Brown say frame 40 so around frame 40 or so it's kind of down to the bottom of the the target object here now if we go and turn off our painted stiffness and hit play we'll see that it actually slides much faster it reaches the bottom you know more than twice as fast like around frame 18 and the reason for that is that the sliding and the tangent and the constraints all are done at separate times within the solver so if you've got the tangent stiffness on these constraints here no wonder we talked about earlier are sort of trying to lift their constrained object up where at the same time the sliding is trying to let it go down essentially let it go down according to gravity whereas the tangent stiffness is trying to keep it up so they're basically fighting each other so that's why it's slower because you've got the sliding going on and the constraint itself happening which is trying to keep it up and they're just they're in complete disagreement so it still works but it just means that that you have to be a little careful about adjusting like you're sliding radio here at 0.75 so you could get it a little faster by going all the way up to one also decreasing this tangent stiffness will make a difference over you decrease it so that it's fairly light you'll see that it goes faster again because it's actually the conduciveness is low enough that now it's actually letting the object fall some so that's another option is just decreasing the tangent stiffness so in any event it will work you just need to be a little bit careful about um about how you balance these two forces or these two constraints and sliding together and then finally this is just a quick example to show that this stitching between pieces of bail and geometry works across sort of different primitive types and across the welds so again we've got two pieces of elam geometry this one starts as triangles turns into quads and then is welded across two strings and this constrained a piece of geometry slides across all of them so this is just showing them that not only can the points that are involved in the stitch constraints change the number of points vault change and so this is again the topology is changing so we're having to update the graph coloring and reading repartition but it just is showing that it's capable of doing that and then if you do something so this actually even means that the things like diamond like breaking and stuff work so if we go to that the weld so these are the welds that are holding these strings onto the bottom of this cloth and we go and turn on breaking the constraint a cloth can actually slide down the target cloth cross over the welds and then at some point there as they get towards the bottom they'll actually create enough stress that it'll it'll break the welds and you can get sort of you know that's a fracture intersect so anyway this is the sliding most of the examples I'm gonna show you some quick example of using the sliding constraints but in a in a dynamic setting so where you're creating the mat simulation cotton so we'll look at another file to do that and very quickly I just wanted to demonstrate using these sliding features in a dynamic constraint situation so this is a file that's very similar to one that was in the advanced bellum workflow master class I referenced earlier and in fact if we look at that version this is what comes out of that version and what we're doing here is actually using non sliding constraints but making them breakable so we get these kind of sticky collisions so these constraints keep sort of breaking and reforming as the object sort of slides down or the Oratory is kind of bounces down the wall and then there's also some some glue constraints between the the objects themselves which we're not showing in this new set up but you can see this is basically kind of a sticky collision sort of look kind of a stiction type look but it's the same idea of dynamically creating the constraints whenever they get close to the collision object so what we're doing here is a similar setup but we've created some sliding some noisy sliding scale attribute again on our target grid our collision grid and if we play actually and so I'm just kind of merging all these the visualizations and the grid and all these things together at the bottom so we can see them all at once so you've seen that the attached constraint you created dynamically but then they just slide and they're again picking up the sliding scale from the target geometry here and sliding along and so depending on its past without the visualization so you can sort of see like this object starts out fast and then it slows down the sliding is it kind of gets to this blue section which is the low sky of sliding scale and then like whether this object gets to the red part again or the high sliding scale it's worse pizza so just kind of a different look a different type of sliding collision and the setup for it is very simple the own constraints dot here and the the type is attached to geometry it's creating the constraints each frame and it's doing it only within the max distance of point one here so you can see them being created dynamically here and we actually have the compress and stiffness set to zero so they can get it as close to the wall as they want to they just can't get farther away than their initial rest length and then we've turned on the sliding rate and set it to one with a scale by attribute of that sliding scale which is on the the target geometry so it's just how you just the way you would set it up as I saw if you were doing just a an initial or static set up at the beginning that simulation just doing this in a dynamic way so in every other way it's quite similar to to that previous example although you'll notice breaking is off so once we create these constraints we're actually not we're not breaking them we're just letting them stay throughout the duration of the simulation and then we do have as usual this keep unique with an output group set here so all that means is a given point once it gets an attached constraint on it it won't get anymore due to this stop it'll it'll be limited to just one constraint for a point so if you're interested in another file it's along with that again spell and workflow you can get it from that master class but this is a very similar setup using dynamic constraints just in this case with with sliding attached constraints finally I'd like to talk about the new triangle and tetrahedral stretch constraints in 1818 and these are as rigid as possible constraints or a wrap constraints that's a new type of constraint that ignores the rotations on like a triangle a tetrahedron while amazing any stretch and shear and that ends up causing elastic behavior so basically behavior that will try to move the triangle or tetrahedron back to its original shape so this is a new constraint that's actually on the shape of the entire element the entire triangle or Tet versus just adding Springs along the edges and so that means previously to Houdini 18 if we took a triangle mesh or a tetrahedral mesh there with the result of solid conform or something like that the only way we could constrain that shape or those elements to retain their shape is just to put Springs along the edges of each triangle or tetrahedron or distance constraints so this works okay until you get into extreme deformation so extreme compression or stretching and then it just starts to become very obvious that the only constraints are along the edges not on the entire shape and we'll see some examples for that so for these to work they need to encode the original rest shape of the element and so for tetes that's in a three by three rest matrix attribute that you'll see on these constraints or for triangles a two by two rest vector attribute this is particularly useful for organic material and anything that needs to naturally stretch or compress it just gives much smoother behavior then when we would just use the edge springs that we had use in in previous versions all the new tetrahedral soft body shelf tools and network tools now use tetrahedral stretch as their constraint type just because it really does work better it's also an option to use these types of constraints for cloth so for cloth you can use either distance along edges which is the previous approach or you can use the triangle stretch constraints and it turns out that at very high resolutions even though the triangle stretch constraints are a bit more expensive they actually converge a little bit faster in terms of just the number of iterations you need so it can actually be effective to use these and you get a little bit just again when the cloth does stretch it just does in a bit smoother way and again what we'll see some examples and finally this these types of constraints work quite well with plasticity which again is the idea that a soft body might deform to a new shape it might get squished by a collision object say and it'll actually move to where it's it's current shape it'll keep that shape it'll keep that sort of squish to shape and that's this generally referred to as plastic flow and so it just turns out that again doing plastic deformation of the entire shape rather than just the springs along the edges just generally works better and gives a bit more stable and smoother plastic deformation so we're gonna jump into edenia and see how this works so now let's look at how these constraints work within the context of Houdini and I'm going to start off by showing an incredibly simple example where it's creating a single tetrahedron here and we're applying these new types of constraints so this is the tetrahedral stretch constraint which is the one that's one of the new Arab constraints it's new and Houdini 18 and then in our solver we have turned off gravity and we've turned off collisions so they're just attached just kind of floating in space and if we hit play not surprisingly nothing happens so we're setting up the constraint here and if we look at what's coming out of there you can see there's this there's a single constraint so there's one constraint per tetrahedron and it's got this rest matrix attribute here which basically is what's encoding the shape of this tetrahedron and then after that were at least we have this transform in here where we can change the shape of the or rotate or translate Thea chattri hedron's so if we if we move it then of course again nothing really happens if we rotate it again because as I was describing to constrain we were essentially ignoring any rotations we only want to worry about about stretch and shear so again nothing happens if we finally actually scale it and hit play then we start to see that it's it's actually doing something it's trying to restore its original shape so I actually get rid of the translations rotations just so it's a little easier to see so this is essentially a it's like sort of a shake spring so it's a spring that kind of wants it to go back to its original shape and a couple of interesting things here we can do things like turn the damn thing up until it'll restore its shape much slower or we can make it a much much stiffer it's sort of shake spring so it'll go back to its original shape very quickly so this is this is kind of the the main function of the constraint is just to restore the show the original tetrahedron the other thing we can look at this kind of interesting is if we are looking at this tetrahedron we can look at its measured area this is action intrinsic so if we go these intrinsic there's a bunch of different things we can look at it's where I'm sorry not very majeure volume we're looking at the measured volume of this tetrahedron so if we look at that it starts out it's about point zero zero zero five and now we've we transformed it to starts so it's the volume is higher than that and if we hit play we can watch the volume of the tetrahedron you notice it's it goes much smaller than the original volume down to zero zero two or even one and then back higher again so this is not maintaining volume it's trying to restore the shape of the tetrahedron but it's not restoring the volume of the tetrahedron and in some cases that's fine usually for organic materials you want the shape to be kind of not that stiff kind of squishy but you want it to retain its volumes so as the object compresses that might bulge out around the Middle's for instance or if you're if you're pulling it apart it's gonna collapse in in the middle so there's this option here to preserve volume here and what this does is essentially apply an additional constraint of an top of the arab constraint that is a tetrahedral volume constraint and we have that kind of constraint to actually try to hear this tetrahedral volume and we use it in the pass along with the spring edges to create soft bodies but now it's built into this constraint so that it won't get play you'll actually see that now these these top points are going up to allow the except tetrahedron to preserve point so if we look at the measured volume during the sinned it's gonna go back to around that's original value and then stay there so this is again just generally even want that on for any sort of organic object once things if for example you're doing something very stiff I'm actually looking example that you may not care as much about preserving bowing because it's not in deforming much in the first place and so then just to compare to our distance long edges so this is what we did before and so now we've actually if we look at the constraints we've actually got some sorry we've got a bunch of them we've got one for each edge so they've got one two three four or five six so we've got six four one one constraint for each edge so you would think that maybe the tetrahedron one is much faster because there's only one constraint versus six and that's sort of true in that you can actually get away with fewer iterations because there's a constraint on the entire shape that's actually usually stiffer than creating these Springs but the spring constraint is so incredibly simple at the distance constraint relative to the complexity of the of the a wrap constraint it's a little bit of a loss but you should definitely still be using the era of constraint verb for soft bodies and then another thing that's kind of interesting is if we invert this so you can see it is inverted because we're now looking the backs of these polygons that's why they turn this dark gray if we go back to our tetrahedra stretch but it will actually restore itself because it essentially understands conversions and it will work to onion vert itself even if preserve arguments off whereas if we do the distance long edges all it's doing is restoring the length of these edges so it doesn't know anything about the tetrahedron it doesn't know that it's inverted so there's nothing that is in the shape part of the constraint that's trying to keep it keep it from inverting which as you start to have again extreme compressions or expansion like stretching it just starts to good can really start to become an issue so let's look at a couple of examples of that so here is just a a solid box that we've turned into a bunch of tetrahedra with solid conform and and the target animation of this we're just going to just scale it for basically these are just going to stretch this we've got some pins on each side here so if we go down to the sovereign's again I think we have gravity here but probably not collisions and we're doing the section itself for second so we're doing just the springs along edges here the distance along edges that's what this constraint is and we hit start so we can see here that this is kind of the problem we've got all of these edges that are kind of inverting and the kind of falling in on themselves we have collisions turned off here so there's nothing stopping self collisions from happening and it's just kind of this ugly mess because the constraints don't know anything about the shape of the tetrahedra all it's trying to do is keep these little Springs along the way through it working and then it just can't do enough and can't do it smoothly enough to get a good result here things get better if we turn on that tetra heat of volume extract constraint that I was describing so there's definitely better it's still pretty noisy just for the same reason you've got these these edges which are trying to constrain the shape and just adding a lot of noise in there just because the edges are some will get extremely stretched and some Lola will not and so it gets just kind of very clumpy and so the other way of doing this is with the tetrad you'll stretch and so we'll start off and preserve volume off and if we hit play you'll see we actually get this very smooth stretching because all it's doing is stretching along the length of these these tetrahedra and it's just expanding the shape of it and so there's some elastic force here that's what's getting sort of you can see it kind of restoring stuff looks like a rubber band kind of strong tight but you notice that there's no compression along the middle as this object is stretched out so there's what's called sometimes the Poisson effect so it's the idea that as you stretch something out it should sort of squeeze together in the middle and as you compress it together and it should stretch out or or bulge out and that's because we have no volume preservation on so if we turn that on then you'll see we get that that sort of collapse or stretching and squeezing in in the middle here and so if we want to see this subdivided which could actually be kind of a good way to look at this as organic material again and just as an aside if you want to subdivide something you need to do this convert tetes if you want to subdivide a bunch of tetrahedra because something body won't work on the tetrahedra but if you do convert that's what it'll do is just convert everything to this back to the surface triangles so that's what we're seeing here so just the surface triangles which we can then subdivide and so you can see this looks like a pretty good organic material in here and you can see that the same effect on triangles so here we've got a kind of similar setup we've got a just a small patch here and again the target animation is just to UM stretch it out and if we just do distance along edges which is how by cloth works for instance is by just putting a distance constraint on each one of these edges of the triangles and saal baad and we'll see we get looks I'm sorry I'm doing the this is the distance long edge so you see it's kind of a mess it kind of collapses in the middle and these edges all kind of fall in on themselves and it just really doesn't look very good and you get some converted triangles and things are just too ugly if we switch to the triangle stretch so that's what this is this triangle stretch here you'll see we get is nice smooth stretching out of each triangle because again it's constraining the entire shape now in this case we don't have a prisoner of volume in this case it would be preserved area and that's mostly because it's difficult to keep track of whether a triangle is inverted or not so you don't get that effect of it squeezing in in the middle there for a lot of organic material that needs to stretch out over like skin or something like that that needs to stretch over a collision object it's generally not much of a problem but it's just something to be aware of and you won't get that effect if you're just if you're looking for it just like stretching of an individual patch like this and then finally this is a set up of just sort of high-res cloth draping over a two mal'chik here and I've already probably already cached casket out it's not something that fast and so this is we've actually there's a stretch type here now when you use the the cloth constraint type and it's just whether you want to use distance long edges or triangle stretch so this is the triangle stretch constraint and one thing you'll also notice that if you've done some draping and vellum this is actually settling down really quickly which is good there's also this new velocity damping and Bedini 18 which is a pretty improved force approach to to just scaling down velocity and but it's quite effective in getting rid of just sort of noise that something like sometimes you might see some sort of bouncing in here so you can either accept this or even even just animate it up if you want things to slow down so the difference between this and using the distance long edges I've got some flip books here so this is what we're looking at this is the this is the triangle stretch the the distance long edges and you can see they're just there's a little extra everything's kind of move to the right here with with the distance long edges just cuz there's a little more stretching not a lot but a little bit and if we actually look at this so this is visualizing the area of the change in area of each triangle over the time of the simulation so there's a bit of stretching obviously both of them but it's kind of noise if there's light these kind of splotchy stuff and that basically just means that the edges are getting stretched sort of inconsistently and so the stretching that does occur it doesn't look particularly good and so there's still some stretching obviously in the in the triangle stretch constraint but it's just much smoother because we're again constraining the entire shape to the triangle so it ends up just looking a lot smoother in the simulation so the only downside well one of the downsides to the to the triangle stretch is that all of these actually they're going here and so but there's some anisotropic settings for cloth and those basically go away if you use triangle stretch because what they're basically doing is scaling the stiffness of the edges that correspond to or go against the direction of the UVs and we don't have support for that in the Triangle stretch constraint so if you have any sort of and using any of that to reward with settings then you need to stick with a distance long edges otherwise the triangle stretch can be interesting as you move to high-res cloth so that's the basics of how these constraints work and I wanted to show them show how they work now in the end the shelf tools now I'm going to go through how you might use these type constraints particularly the tetrahedral stretch constraint within the context of the Houdini shelf tools so comes being put down a squad geometry here and make it a little bit smaller and go to the velum tool shelf tool and choose tetrahedral soft body and so this is gonna set up not only the simulation but also a deformation networks of something that takes the original model and turns it into tetrahedra and then point deforms the original model so you can see here now we're in the doc network and we they don't have enough resolution here so we're gonna go back to look at this setup and so what it does it takes the that geometry it Polly reduces it and then rematches it and then solid conforms it let's turn off the material for a second and this is just not high enough resolution so and this you don't necessarily need to probably reduce it but it's just sort of a convenient way to dial in resolution the Remus is the one that really makes a big difference here we're going to be easing a uniform edge length you can use adaptive with this you just need to be kind of careful about all these sort of bits around here that can cause self collisions even with the calculating uniform thickness or even to calculate varying it can still cause some problems so if you're using adaptivity on the rematch i would recommend not using too much of it yeah the bit more uniform your your tetrahedra can be it's just generally better but so once we have a better looking in terms of resolution mesh we can so what's happening here is the original and the original geometry is being fed into the point deform and then we're feeding both the non simulated abreast geometry here and then the result of the simulation as well so it's going to it deform this but we don't have any collisions yet so let's let's add a ground plane and go back to our squab materials again to play so what will happen is just the simulation is the objects falling down obviously it's kind of squishing like a like a nice soft body and then we're deforming the original mesh to to match that so this is a pretty if you've ever done any sort of soft body FIM stuff vellum tetrahedral soft body previous versions this is a pretty common workflow so you could do the same thing by using the network tool here going configure two tetrahedral soft body and that puts down both the solid conform and the tetrahedral stretch so it's sort of these this part of it and then you could go to like a vellum solvers here whoops sighs do the same thing and her face up and oops put up a rematch and you basically get the same setup so either way it doesn't necessarily matter Google this work from here so in this case we'd be using this the result of this and we'd want to turn on our ground plane and do it down we're doing septate we're just doing it all now within the network you could do it either way it's totally fun whichever way you're more comfortable working so one thing that is nice about these tetrahedral stretch constraints especially when you're using in the soft bodies they're fairly efficient so you can easily use a few more iteration I mean a few fewer iterations if we wanted to make this a little stiffer I could go get convicted here just so it doesn't it just has a little bit less compression and bounces up just a little bit holds its shape a little bit better and let's we can do something like let's um add some pins here so we're going to change this to pin to target and select just a few points at the top okay so now just sort of pinned the head of the of the squab up here so we get some sort of slightly different behavior and again you can see the difference like if I go and you can see that as the head I guess that's the head of the Squa stretches it sort of it has that narrows here as so can preserve all you basically and so if we go turn that off you'll see that now it's a stretch it's and it doesn't preserve volume so it actually doesn't look too bad otherwise just there's a soft body if you're looking hard you might notice that so and it's an it is a little faster a little less expensive to turn off for surviving so it's really kind of just up to you whether which look you're going for the other selection here use linear model is a different way of solving the constraints basically it let me linearizes the constraints it doesn't look as good when you're doing sort of very soft constraints that want a stretch were to form a lot but if you do something like I want a you basically say I want an extremely stiff tetrahedral soft body then actually turning this on is a pretty good idea because it will converge faster for high stiffness so you can see now we get very little stretching our deformation of the object relative to what we were doing before and in fact we can we're say fleeting preserve volume off here because they like the head part of it isn't really deforming it all realize is really stretching so the fact that it doesn't preserve volume is not all that noticeable because this shape constraint is so strong in the first place and then you really want to make this stiffer though you might do something like increase the substeps or something like that okay so if we see it's just it's a lot it's much much stiffer here and it's not quite a rigid body because you still got some sort of flapping in the tail and stuff and then the tentacles but it's just a lot stiffer so just depending on which look when you're going for it sort of determines whether or not you'll use this lay your model if you're going for organic material usually you want it off it's just if you're if you want something much different for that so anyway this is a really quick overview of how you would use this set up within the context of Houdini and the shelf tools I want to show a quick example of using the tetrahedral stretch constraints with plasticity and Houdini 18 just together they work particularly well it's a real simple example where we've just got a soft body torus falling down the collision object and then on the ground so nothing much going on here but for visualizing stretched distance and in this context what stress distance means it's basically how much has that each tetrahedron deviated from its original rest shape and so can actually turn on plasticity on these constraints and have it work on the stretch constraints this tetrahedral stretch constraint and we want to have this threshold there and this isn't the percentage of change it's just an overall change as well as compared to like what we're visualizing here our rate says we want to deform fairly quickly so basically the rest shape we should we wanted to form torques at the current shape quite quickly and we want the constraints to get harder as they do that or a stiffer as they it does they do that so these like something like clay where as you sort of compress it and you squish it it sort of gets stiffer in that new configuration so if we turn that on and we're gonna actually also switch to visualizing plastic flow so that's just a just just a measure of how much plastic deformation has actually happened and let's look at the constraints here so if we sort this by plastic flow we can actually see that as the deformations happening so as the plastic flow is changing the rest matrix is changing that basically means the shape that each tetrahedron represents is changing the rest length is staying the same that actually encodes the volume of the tetrahedron so we're preserving the volume and that's what the preserve volume constraint is looking at and the students increasing and that's because of that hardening setting so you end up getting and you can see as it end up getting something that looks like I'd be clay or something like that where each other the shape of it changes it retains its volume and it gets stiffer along the part that has been plastically deformed and so I've just I've cached on that just has a has a lot more objects in it you can see because they're coming squishing each other I had to increase the substeps a lot to get better collisions but you see if there's a longer plastic flow here you get some pretty extreme deformations with things saying pretty much nice and stable I also did the same thing but with preserve volume turned off just to see it and you'll see that they actually kind of when they get squished they they don't preserve volume so they actually get a fair bit smaller if you just compare like sort of the size of these sets of objects these are obviously much bigger because they do sort of volume they sort of expanded out squished a little bit and wandered from the collisions versus versus these ones so anyway that's just a quick example of plasticity when using the tetrahedral stretch constraint I wanted to show another quick example of using these a rep constraints to get some nice organic looking behavior so here we've just got a box that we've rematch and made to fairly high resolution tetrahedral solid here and then we have the tetrahedral stretch constraints not very stiff at all and then we're also when we do the solid conformer creating that surface triangles group so we're keeping triangles on all of these tetrahedra their own that are on the surface and we're applying a triangle stretch constraint to that so this is a bit like having sort of a big organic mass inside with some sort of membrane like skin or something on the outside that can that's pretty stretchy so pretty low stiffness and then we're actually adding been stiffness across all those triangles so this is this bend across triangles is the same constraint that's used in cloth but here we're just applying it to the outer triangles and then we're pinning pinning the ends up here so if we watch the results of that and again obviously this precast but you can see it's a nice wrinkling behavior here just from those from those outer stretch can those outer triangle stretch constraints that are kind of acting like that stretchable membrane and how much wrinkling you get is actually controlled a lot mostly by this this Bend strength here and then if you want you can do things like do that thing same thing we did before where we converted back to tetes and subdivide really good point deforms and you know just a few different ways to do it actually the point deforming money would be quicker but sort of some interesting looks here and so just a couple of movie there are flip books here this is with no bends stiffness at all so you see a very wrinkly kind of behavior here there's lots of lots of wrinkles showing up sort of all across the body and not even just where it's where it's bending so much and then this is with sort of a medium Bend stiffness and you see they're mostly the wrinkles are mostly relegated to just this kind of high bending area here anyway so and obviously all these files are going to be fluted with this with this masterclass but there's kind of an interesting little example of using the two different air route constraints I want to go in a little more technical detail about the tetrahedral a Arab constraints and not because you necessarily need to know any of this it's I just think it's kind of interesting and in particular it shows some output from the solver that we can use to do some kind of stupid Houdini tricks that lead to some interesting emergent behavior on soft bodies which I'll show a couple of examples of so as I described the these Arab constraints encode the rest shape of the tetrahedron and while we're solving we can combine it with the current shape of the tetrahedron and we form something called a deformation gradient that we can call F and all that is is a mapping from the rest space the deform space we want to find the rotational part of that and so all that means if all the tetrahedron has done is rotate then there's no there's nothing to do there's no elastic forces so we want to find the best rotation from the rest state tetrahedron to the current state tetrahedron and there's a couple of ways of doing that there's something called polar decomposition index but the solver actually does that internally then the constraint solver does it and it actually stores that current rotation as a quaternion in the rest vector attribute and we're going to use that in this demo to do some interesting tricks some interesting behavior once we have that mapping that F mapping and the rotation which is an are we to subtract one from the other and minimize that so that's just a way of saying disregard all the rotations and minimize what's left over which is the stretch and this year again don't necessarily need to know that but the interesting part here is this that we've got that rotation at any point in solve we've got a rotation for the for the tetrahedron there's no volume preservation here without that additional volume constraint as we talked about and this model in general is not really that accurate a description of elastic behavior it's not as accurate as something like the neo-hookean which is in the Houdini 18 Fe M solver but it can be solved with XPD D it's a simple enough model that it can be solved with xpv D and as you've seen you can get some really nice organic behavior even with this simpler model so that's why we've implemented it in vellum if you need super accurate elastic behavior then you need you probably need to look at something like the FIM solver but for a large subset of the problems you can get some pretty good results with vellum and these types of constraints so now I'm going to show a couple of examples of using that rotation that are that we figured out from each tetrahedron to get some kind of kind of fun behavior now I wanted to show that demo of using that rotational part of the a wrap constraints to drive some interesting behavior on a tetrahedral soft body and so this is a demo that I've that's called the box of snakes which is probably going to become obvious why but all we're doing is creating a bunch of little tetrahedral boxes and we're creating this material W attribute and if you've used the fiber thing the tetrahedral fiber constraints at all you'll know that's just a vector in rest space that's pointing in kind of the main direction of the tetrahedron it could be anything you want but in this case we're just doing it along the body of the of this kind of box here and so if we if we visualize that here you can see it's just pointing along here and we're gonna ultimately create a whole bunch of these so we're gonna want to bypass that and you can see in each case the in breasts face the material W is pointing along the snake and the one thing you need to be careful about here by the way is make sure you set this to vector so that when these copies are rotating things they will actually rotate the vectors if you leave this as float they won't get rotated so you need to make sure that if you're copying use workflow to always use a vector there so then we basically are just creating heads for them actually let's for the moment let's let's bypass these I'm only working with one and create the tetrahedral stretch constraint and then go into the velum solver so a very straightforward setup and then the only interesting thing we're doing here is in the velum solver so that's just the velum solver so we've got this Papa blend so this is a regular pop wind there's a couple of interesting things here though as of Houdini 18 there's down this inputs tab so it used to be that it could be kind of difficult to go grab different inputs from within a pop which is mostly useful if you're using the expression so if you want to write a little bit of it in Beck's code to have give yourself sort of a custom wind force and you needed to look at other pieces of geometry than just the particles to calculate that it was could be kind of difficult prior to Houdini 18 so now we have this input step so you can actually bind other pieces of data or stops or any sort of thing to Tecate to get that data to calculate from so in this case we're just grabbing the constraint geometry so this is the constraints primitives that during the solve so we'll be able to look out the interesting values from that and actually look at what that is so developme and again this if you see the advanced spelling workflow master classes i go over that in some great detail there so this is the constraint geometry and these are the primitives so these a wrap there's a there's some stuff on the front and on the back of it but there's a wrap here so these the area of constraints so what we're doing is we are basically we want to create a wind vector along this object pointing in basically always pointing along the direction of the snake of this box and we want to do that no matter what direction it's pointing so whatever direction this snake and these tetrahedra have oriented themselves to we want to always be moving along this direction so even if it curls up into a like a loop we want it to always be moving this way and to do that we can actually use that rotation that's been extracted by the solver for each one of these tetrahedra so each one these tetrahedra is gonna have its own orientation and so what we can do is this is what this code does I'm gonna just describe it really quickly and you can look at the example later but essentially it's grabbing all of the point primitives for the current point from that constraint geometry so it's basically saying give me all the constraints that are gonna be working on this particular point and I'm gonna go through all of them and look for and this is a function that's in this pbd constraints file that's included with Houdini and just say is it a tetrahedral area of constraint and if so then I want to look I want to look at that and use it so once we all we're doing is getting that quaternion dressed vector that I described from it and then we're creating a local velocity direction using that material W so we're rotating the material W into the current space and then we're making that the wind direction and so it's probably easier if we visualize this so if we visualize the result of doing that and here we're just working we we created that so we did this set point attribute so we created this little local v direction which is the rotated material love Mary case if we view that as we simulate that's what we're seeing here these vectors that are there being rotating you can't really tell until it hits the wall here but once it is the ball and starts kind of wiggling around you can see that those that wind is always getting re oriented to move along the direction of the body of the snake so that's why you get this kind of weird interesting you know curling back and forth paper because it's trying to always push forward and it's fighting against these collisions and that kind of gets more interesting if we have more of these as we do this we'll get a bunch of different and you can see again that they all start out or aligned along the direction of the of the snake and even this guy that's sort of curling up again the we're using that rotation of the that the solver is figuring out for the tetrahedron to rotate into a local wind space so we end up with this kind of cool interesting behavior and so and I've saved out having heated up a few more of these this so this is why I pick up the box of snakes because that's what it kind of looks like see if you're always kind of interesting behavior coming out and it's a very you know but the code looks a little bit complicated with there's very little of it and there's it's actually we're not adding any noise here we're not adding any randomness at all all we're doing is telling each snake and each part of the snake move forward is as you can well Don's fast as you can up to the speed of the wind basically and we get all this kind of interesting behavior from that I'm going to show this really quickly again you don't really need to know this but this is basically doing the same thing but actually combining the matrices that we talked about in Beck's code and then using that polar decomposition to figure out the same thing it's more complicated it's slower and you already have it from this returning so it's probably not worth doing but I was wanting to include that code if anybody was particularly interested in how it work this sort of combination of the rest matrix and the current matrix of what's going on in the solver but again you don't shouldn't really have to worry about that so one more example of that is just the same idea but we're gonna let's say we do it with instead of that box we're gonna do it with just sort of a subdivided box as a collision object and then we're gonna do one more thing which is we're gonna basically do the exact same thing but we're gonna add and I may make attached constraint so once the snakes fall down on the object we're adding these dynamic attachments and then they are basically able to sort of crawl under the underside of this object as well as just across the top of it which again is just kind of kind of cool interesting behavior and so if we look at the cashed out version of that yet one that just has sort of the tail is just his tail gets stuck and he kind of tries feverishly to get off but they can't and these guys kind of cruise around and interact with each other and slide across the surface of this object which is just kind of again just kind of a fun look so this is exactly the same just going into the solver this is exactly the same pop wind that we looked at for and then we're just adding a dynamic attach constraint for the first 50 frames like we were like we were talking about previously and the dynamic attached and then just to show a slightly more professional version of this we've got this you've got this something that one of our internal TVs did which is saying the same kind of idea of been using it for just a single line sort of tentacle object depend this has actually got some suppressed geometry that's just kind of doing this kind of contraction expansion thing kind of looking like a worm or a tentacle or something and then the setup here it actually uses the velum rest blend to bring that rest shape into the simulation it again has some sliding based on the noise it's kind of moving along here if we go back and look at this so this is where the sliding is happening where the contraction is happening so again you just get really interesting emergent behavior from a relatively simple setup anyway that is all I had to show for this masterclass I hope you've enjoyed and learned some interesting things that you can do in element Houdini 18 thank you very much
Info
Channel: Houdini
Views: 23,368
Rating: 4.9790025 out of 5
Keywords: vfx, visual effects, visual effects software, vfx software, cg, cg software, siggraph asi
Id: zPQZ8KJTjzo
Channel Id: undefined
Length: 94min 39sec (5679 seconds)
Published: Tue Feb 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.