Houdini Tutorial: Breaking Glue with Forces

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi folks today I wanted to cover something relatively straightforward but that's actually pretty useful in a lot of workflows but isn't necessarily built into Houdini and that's the ability to break glue constraints with something other than impacts so by default when you're doing rigidbody simulations and you're using glue the only way to break glue is when something smacks into it but often what we want to do is break our sort of do our destruction using other forces in particular arbitrary force it's quite literally so maybe we have an explosive force we have a metal ball force we have a curve we wanted to sort of draw things we have a suction force we have fluid forces we have all sorts of sort of things that we want to be able to apply and use in our destruction but by default glue doesn't pay attention to any of those things so I just want to do a relatively quick relatively straightforward tutorial today to cover one way that you can sort of port over arbitrary forces and use them to break your glue so that you can still get all the nice fast benefits of glue instead of something like soft constraints which you could use instead but are really computationally expensive so we want to be able to keep glue but still get more arbitrary and more sort of good control over how we break it okay let's get started I'm going to drop down jicama tree node and I'll just call this force break and we'll dive inside and the first thing that we're gonna want to do is give ourselves something to break some interesting geometry to work with so I'm just gonna build a very basic sort of I hesitate to call it a building but something building esque so it's gonna have sort of walls and floors and that'll be pretty much all we'll deal with so let's just give this kind of an interesting shape here maybe something like this this is roughly sort of a building kind of a shape maybe we can make it a little bit a little bit wider a little bit taller resting on the ground that looks pretty good to me now to turn this into sort of a shell I'm going to you do a few boolean operations here I'm gonna grab a bound first I like doing this because if you just transform the box you need to worry about the pivot and especially for doing things like buildings I want sort of shells all around every edge but actually not at the bottom and since I'm doing a boolean I want it to sort of overlap at the bottom so you'll see what I mean but the boundbox can be really nice for boxes at least because you have all these independent padding's so what I want to do is just give negative padding's or all of these and so that's gonna pull it in from each of these edges by the same amount but actually want to give it a bit of a positive padding on the bottom just to sort of punch it out through the bottom so I kind of like this set up because you can do that pretty easily and then at that point we just do able you can subtract and we get ourselves a little shell so that's great that's a good start let's just put some floors in here again I'm gonna do this in a really sort of straightforward way I'm gonna start with grid let's just make sure it's big enough on every side that's totally fine I'm going to poly extrude this by that same sort of offset by point one we'll do that and I'm gonna make sure to output the back I want that to be solid so without that it's not and then we'll just do a copy transform to give ourselves a variety of different floors so I'm not sure quite how high these should be let's say it went up by one that's maybe a bit too much let's try it one seven five and then we can sort of bump these up till we're filling that a little bit more maybe I'm just sort of trying to dial this in so it's got a a relatively evenly spaced arrangement that looks pretty good to me so now I'm just gonna take this bound again and I'm gonna do a boolean intersect with all of these and that will give me my floors and they'll be nice to him sort of set inside here so if I just heard all this to stuff together here we get what we can very generously call a building so let's just call this building quote unquote and this is just to get myself kind of an interesting shape to work with I like to have interior cavities when I'm doing destruction to just destroy sort of a solid block you rarely get very interesting sort of looks from that okay so with this in place let's go ahead and just fracture this so I'm gonna take I'll just take my original box here you do an ISO offset give it a little more resolution to get some fog here and my display is already up to its old tricks so let's see there we go and let's just scatter a good number of pieces let's do something like 1500 this will be a relatively sort of lightweight fracture but it'll be enough to see what we're working with here now because I have multiple pieces here in this geometry this isn't just one chunk you can just do a for my fracture on this kind of compound geometry but I find often it'll give you trouble so I prefer to just go for each piece in here so we have several different pieces we have each of the floors and then we have that shell and we'll just do the fracture for all of those or for each of them I should say so for each of those we'll distractor based on the same points so we'll have the overall same sort of fracturing going on we'll just do all of them and one thing to note here this for no fracture it doesn't know about the previous one so it's just gonna start at p0 every time for each individual piece so we're gonna have multiple sort of connected piece zeros so we just want to rename this stuff so I'll drop a connectivity node I'll put that on primitives and just drop the Primmer angle and say that our name will use esperan tuff should be named percent T for an integer and we'll just grab that class attribute so now if we looked say here and we see names here is sort of 1028 unique names if we look here we see okay it's actually 1698 and so those were just some of those duplicate pieces so now that's taken care of so this is our base backyard geometry and on the geometry side all we really need to do here now is just assemble this we don't want to create a name attribute we already have one we will create that geometry so there we get our sixteen or seventeen hundred pax pieces and the last thing I want to do is just sort of make the lowest ones inactive so I'll do that with a group I'll call this group anchor and I'm going to do this should be on points and I'm gonna go keep in bounding regions I'll just get the gizmo here and really what I want I want to make sure I got sort of all the way front and back and then I just want the handful of pieces nearest to the ground this is just to make sure it doesn't sort of fall over if anything starts to influence it so all these pieces will be stuck to the ground and that should be just fine with that group in place I'll just do an attribute create here this attribute will be called active it's on points it should be an integer and the default also is one but the value for this group I just made anchor will be zero so that means most of the pieces all the ones not in this group are going to be active they'll simulate and then just this set that we selected here is gonna get the value of zero so it won't be active so there's our geometry now for our constraints for two reasons we need to process this a little bit more we can't just take this output we could have taken it for each piece but then the pieces wouldn't be glued together so ultimately we can't really use those constraints so we have to go back to the old-fashioned version so we'll just do a connect to base pieces and I'm gonna do with Jason from surface points and right now it's got a max connections of one that's not really enough each of these individual pieces is going to be next to a whole bunch of other pieces see if I can get my display to behave again there we go um of these pieces gonna be next to a whole bunch of other pieces we want them all sort of nicely connected together this isn't so bad but I do want to sort of pop that up let's say at least four maybe even six or so and that should be fine that still just gives us you know fourteen thousand so that won't be very heavy and that make sure everything is sort of nicely attached together now at this point we could just give it a constraining and isn't really necessary for glue but I'm gonna do it here anyway I'm gonna say the constraint type is all this is whether or not it constrains rotation as well as position or just position and for glue that's sort of not it doesn't apply the reason I like to put this in here is just as sort of a reminder to myself to always basically worry about this because every other constraint this is actually relevant so glue is kind of the exception where you don't really care about setting this but I like to set it just to keep it in mind and also if I happen to change the constraint type in some sort of stop solver or some other portion there this is already taken care of so you don't actually need this right here but I'm gonna keep it that reminds me we are gonna want our breast length here so I'm just gonna put that on there and the last thing we might want to do is just say let's set our strength and I'm just gonna set it to one for now so that we can set it up inside the network and let's just go ahead and call this con four constraints now I'm gonna want to change this network a little bit make a little bit more interesting right now there's no chunking everything is gonna be sort of equal strength but just to get us started let's sort of throw that in there so now we can set up our top network it's gonna be a very sort of straightforward our media network I'm going to get a ground plane I'm gonna get some gravity gravity gravity I'm gonna alt drag these two to get a merge I'm going to turn off the display of the ground plane because I never want to see it drop a rigidbody solver it's great Network a packed object and a glute constraint okay so for our constraints we'll just point to that Conell for our geometry we'll just point to our geometry null and for our glute constraint will say our constraint is look now if we were to run this right now it shouldn't really do anything it's only acting under gravity and that won't be enough to sort of give it any kind of change so it'll just sit here if we were to throw anything in here right now the strength is reasonably high actually I probably would hold together so this is a reasonable place to start for us actually now what I want to sort of show you here is that if we were to throw some kind of a force on here let's just grab a pop force and we'll just stick that in the post and we'll say let's give it a good a good gust in the x-direction and a little bit of noise there if I were to add this force if I run this and we look at the geometry here you can see that sure enough it is creating this force attribute it is applying this it's putting this on the points and they are experiencing fairly strong forces you know these forces are a lot stronger than gravity even and our strongest forces up here at like 88 now part of this actually is where do we have this ignore mass ironically when you check ignore mass what it does is incorporate mass into it so a force of 10 units I assume these are Newtons a force of 10 units on two objects is going to sort of change its gonna give different accelerations if they have different masses what ignore of mass does is says well let's take into account their mass and we'll basically multiply the force to sort of make it equivalent so a heavy object should accelerate as much as a light object is what this is saying so ironically if you check ignore mass what it's going to do is incorporate the mass into the force so that's why we're seeing these forces so if I take the noise out of here you'll see that the force and if we go over let's just look at these two things force and mass you'll see that the force is 10 times so that's our sort of unit base force 10 times the mass so when the mass is 1.5 the force becomes 15 so if we go to that maximum I was sort of in the neighborhood of 80 that's because that thing was our heaviest chunk here so first of all when we're dealing with sort of trying to use force to disrupt these pieces we actually want to make sure that we're not ignoring mass and in that case the force just becomes the force so it doesn't take into account the mass we're gonna take into account mass when we're actually seeing what it ought to do so I like to keep this in sort of its standard units so that we can then take care of mass on our own okay so the main thing that's important here though if even if we crank this up to sort of a ludicrous value it's not going to do anything so glue is really nice it's a really good constraint because it makes things nice and cheap because what glue lets you do is say well as long as these items are attached together I could treat them all as a single rigid piece and that makes these constraints really powerful because they're really cheap the solver can basically simplify its calculations quite a lot now the problem is it can't really respond to differential forces on its individual pieces what glue constraints respond to are impacts so when something gets hit that impact basically has a quantity and that impact is distributed to nearby links based on this propagation liberation and propagation rate and it decays based on this half-life so if it gets hit a whole bunch by light taps this may build up enough especially if you increase this half-life this is how many seconds it takes for that sort of impact value to decay but basically all it responds to is stuff hitting it it responds to collisions it doesn't know about force I doesn't know about wind it doesn't know about any of those things so glue can only really be broken by default by force now you might think okay well we could just do this with like our new bullet soft constraints so if I just say this is glue now pipe that in here instead this will obviously be plenty if I just go to server 10 you'll see now it's gonna simulate slowly but it is actually responding and so you could do this this whole approach with soft constraints the problem is soft constraints are a lot more expensive it's actually looking at each individual constraint between each point on each time step and it doesn't matter if they're still attached they can still move independently which gives them different strains and all of this gets a lot more complex so if you want your sort of destruction to respond to things like forces arbitrary forces you could go sort of a soft constraint route and you could basically just make it more more stiff until it seems basically like a glue constraint but that's gonna get really expensive you don't really want to do that so instead what we want to do is keep our old-fashioned glue constraints our nice cheap glue constraints but somehow pay attention to force so instead of only breaking based on impacts we also want it to break based on these forces and it turns out that's not such a difficult thing to do basically what we're gonna do is we're gonna take this whole glue concept of impacts we're going to include our half-life our propagation iterations we're gonna sort of incorporate all of that stuff and instead of looking at impacts we're actually going to look at displacement due to forces so predictably we're gonna use a soft solver here I'm just gonna plug this right in here and the first thing we want to do is sort of bring over these forces so again if we play forward here we get force on these points we want to bring that into our network here so to do that I'm just going to actually import the geometry from this same top network so that's from this network the RVD object and I just want to grab that geometry so there it is and sure enough if we scroll over and look at force there's our force so we've got those values so now we want to copy this over onto our constraints I'm just gonna do attribute angle here oops and the first thing we want to do is line them up so at the beginning on the berries first step this should have you know sixteen or seventeen hundred points this has seventeen hundred points they're ranging from PC arrow to peace whatever so you should think well maybe we can just use PT num but if we're gonna start breaking these constraints that means some of these points are actually going to disappear we're gonna change the ordering so after our first time step kind of all bets are off so we need to match this explicitly so we'll grab our magic point using by natural bail and we want to find the match from that stream one it's going to be a point attribute and it's the attribute called name and we want to match it to the name that's on these points so these points on the primitives for our constraints well this thing is clearly confused because the stuff should not be on those constraints and it probably isn't let's just go back to our constraints sure enough there shouldn't be much of anything there let's just go in here again well it seems very confused about what it's showing me that's okay here we go okay so these constraints have a name attribute and this stuff on the geometry has that same name attribute on the plane so we just want to match those so we're gonna compare those and that'll give us the matching point from this stream then we're just gonna say our force is just the force from that stream from the matching point and I want to bring over the mass as well we could just do this mass transfer on the very very first step and in fact just for the sake of argument let's let's do that we'll just find this matching point pull that in here and actually we're just gonna say yeah well we could do this no I'm not gonna do this it's just not worth it it's gonna have to do this conditional every time anyway and then yeah the expensive part honestly is this match the rest of it is just read calls so we're not really gaining anything the idea is that mass is never gonna change force is going to change so we don't really need to read mass every time but it's not really costing us anything the overhead is on finding this but this matching point so this extra little read here is not really going to break the back so now on our constraint points we have our force value and our mass value and you'll see that forces zero here that's just because we're on this very first frame and this top solver is being executed before this is I'm not sure if we put this on the pre-salt if that would come through no yeah this is one of those funny things about the constraints being in their own network this is why you could do the attachment internal constraints to objects which we could do in this case and then we could have a little bit more control over when this gets executed but basically after the first frame everything is gonna be fine anyway so if I step forward now we have a force we come in here and why is it not showing up and none of these values are correct either okay what's going on there we go okay I don't know what it was doing but okay frame two so we have our force and showing through it's the same for every one of them and we have the mass now from the eval use what I really want is the acceleration so everybody knows F equals MA so forces mass times acceleration so if we want to go acceleration we want to divide our force by our mass so we're just gonna take our force and we're gonna divide it by our mass this is basically telling us for a unit time how far is this piece expected to move based on the force is experiencing and that means we can get I'm gonna say prj pose for projected position which is just going to be the current position which actually here's another problem yeah I want this to work even if these pieces are moving so if I have sort of a separated chunk that's moved away so it's already broken off but there's internal constraints I still want those to be affected by fields so I can't rely on this static rest position of the points that are stored in the constraints so we do need to write read one more value here we need to read that position well that's just gonna get us the updated position of each of these points it's in our projected position is might be that position plus this acceleration and now in fact we don't need to store all these attributes we don't really need any of this stuff all we want is this projective position that's actually the only thing we really care about so there we go but necessary stuff here let's get rid of all of that great so now we have a projective position so each of these points again it's not really updating rights if we move forward there we go we get this projected position of where it would expect these points to end up based on the force that they're experienced so now what we want to do is calculate something like strain so this give me the equivalent of the impact that gets built up so when you have a collision when something strikes the object in bullet it gets that little sort of collision force that impact value and that's the value that ultimately gets compared against some threshold against strength to determine whether or not the bond should break so we want to do something similar with our are sort of force effects and the basic idea is that if two connected points let's say we're looking at these two points if these two points are experiencing the same force then they're projective positions are going to be the same distance apart as they were at wrestling so if they're both just moving say a little bit in this direction then they'll be the same distance apart afterwards that they were before there's no strain on that link if two nearby points are of two connected points are experiencing different forces say this one is being pulled up and this one is being pulled down then the distance between them is gonna get a lot longer than it was at the rest position and that's kind of a strain so the amount that these forces even though they're not actually moving we've calculated their projected new positions based on the force we want to say how much longer is that than they're resting and that's gonna be like our strain value and we're gonna compare that against some threshold to determine when we should break this so now that we already have these projected positions this is actually quite simple all we need to do is grab our two points so now we're running over primitives here so we need to get those point attributes so we're gonna get this for our current primitive for zero and we'll do the same thing for point one and I just want those two productive position values doctor PR j PR j for protected that's gonna be point 0 prj can set up a variable we'll call this maybe for strain and this is just going to be the distance between these two positions our projected position 0 and 1 so how far apart will they be if we were to apply the forces that are on them and we're just gonna divide that by press length now you could subtract here I'm doing a ratio and basically I only really care if it's larger so if it's larger than 1 so I'm not gonna worry about compression you could have those as sort of independent values you could also if you did this as a subtraction you would have sort of an absolute stretch away which is also pretty common so this is pretty arbitrary what I will say if you are setting up your constraints and they're gonna switch to say hard constraints or soft constraints then probably you've collapsed your points and unique to them and so your rest length is actually going to be 0 so make sure if you do go to that kind of the model that you sort of change this probably a subtraction in that case would make the most sense oh how far away in absolute terms is it here I do want it to be a ratio because if points are already pretty far apart so if they have sort of a long constraint between them then that sort of difference you know those forces could kind of pull them apart more in proportion or I guess when when they're close together I should say those forces are gonna pull on them harder than if they were farther apart and I want to be able to sort of respect that so I like using this this ratio here okay so now that we have this force train all we need to do is compare that against some threshold we want them to say if force strain is greater than some threshold and we'll remove its points as well that'll only remove these points if they're not included in another probe so basically once we've removed all the points they're related to one of these things it's going to I'll talk about this in a second but it's gonna get rid of those points at that point so everything disappeared here that's because our threshold by default is zero so the strain is certainly greater than zero or at least it's equal to zero so let's just bring this up to some real value and now everything comes back here so at this point and we can just drop say an output here just to be safe at this point hypothetically we've got this set up and it should maybe work but what we should see it's upset because it cooked sort of while we were inside there um what we should see here though actually is that nothing really will happen so if we step forward here we have a couple of pieces that did come loose and that's a little bit surprising I am kind of curious about those pieces because all of them are experiencing the same force and that's right I guess if it's a much lighter piece than it should be accelerate more so yeah what we're doing is we're losing light pieces that are attached to very heavy pieces so even with a totally uniform force like we're applying here you should start to get some effects here that you wouldn't get by default but it's not really giving us a lot so if we really want to see some impacts here what we want to do is make sure that our force is actually variable it should be different it should be say pulling different things apart if we're just looking at like a straight push ultimately that's never going to do very much and if you really wanted it to come away I suppose what you would say is that these inactive pieces are experiencing zero force and so if we were to just throw down a popper angle here and say our group should be well let's just say if I had active zero then our force should also be and if we do this we're basically sort of reflecting the fact that these bottom pieces can never move this is basically all that should happen for a uniform force it should just break off hopefully at the top and it doesn't seem like it's doing that because maybe the strain is just not high enough let's take a look at that geometry let's just go over to our constraint network our network our geometry and get those out of here and there we go yeah so we're getting some strain here and actually if we just come out here and look at this more straightforwardly I'm going to quickly split these out and just bear with me for a moment I just want to link these up I have a good reason for this I promise to to basically what I want to do here merge it's gonna be here and I want to just drag this over so I'm just gonna grab this and throw that right into there and this will do the whole path for me including this weird sort of : and all these like you know it's a long path I didn't want to write that good chances I'd make mistakes it's easier to just do this split I don't need these pains anymore that's really all I wanted it for but now we should be able to take a look at our constraints and really I want to visualize that for strain and so what we can see is we are getting sort of good strain along the bottom and we have already sort of broken a lot of those chunks down there but maybe it's just a little bit too strong so let's just let's just change our threshold here let's just drop it down to maybe half that and now we should see yeah it's gonna snap pretty much all along the bottom here and if we take a look it's just gonna snap straight off of those pieces yeah now this was strictly for sort of demonstration value I just wanted to sort of point out that if all you're doing is a totally uniform force you shouldn't really see very much and physically you shouldn't really see very much because all the different pieces are experiencing the same thing there's not much strain between them so really all that would happen if this stuff was locked to the ground is that it wouldn't be able to move but the stuff above it would so you would just snap it off like a hinge but that's not terribly interesting so all of that is to say what we want to do if we want to see anything interesting is get a little bit of variation in here then we can do this with a bit of noise so I'm actually just going to give ourselves a good chunk of noise and maybe scale down that force up there as well size one is probably pretty reasonable that's kind of this scale maybe actually I'll bump that up that'll give us some sort of nice oscillations and now what we should see is this whole thing will probably come apart so a lot more pieces are coming apart their whole chunks are sort of pulling out and we're starting to see a lot of these pieces are breaking so if we let this run we'll see we're basically losing sort of all these pieces they're kind of just falling out as they start to detach and basically it's just gonna be lighter and lighter pieces are gonna be sort of pulled apart and if we were to sort of bump this up a little bit more so if we took our so the noise amplitude up even higher we should see the whole thing pretty much just rupture apart and you can sort of see it's following a little bit of those shapes there and with noise we don't even need this base force necessarily so we don't need any particular directions we could just put this all in to noise and it's basically in a push and pull this structure in different directions and just tear it apart okay so we're getting somewhere here but this is pretty boring we're getting it to respond to the noise but we're not really getting any sort of terribly interesting things going on here and there's a couple things I wanted to to improve this first of all let's talk about the constraints and so this actually is completely sort of independent of this sort of force breaking we're doing this is the type of thing you want to do for any of your destruction sins but we want to get a little bit of sort of chunking in here so right now every one of our constraints has exactly the same strength it's not going to do anything very interesting at all if you use the RVD material fracture and even just setting it down without giving it anything to fracture it takes it a second to sort of get itself in there you can give it multiple levels you can basically do hierarchical fractures and under the constraint tabs you can even have sort of level multipliers and what this will do is basically say constraints the strongest constraints or rather the weakest constraints will have this value and for each level that you go up they'll get stronger and stronger so basically large pieces will come apart sooner than smaller pieces I don't often like using this it's got a lot of nice features but I find it really slow and also a little bit opaque so it determines exactly how it wants things to work and we can do something very similar on our own here so what I want to do is take this same offset we used up here so maybe I'll actually pull that over here leave this over for that fracture what I want to do is basically just define some points littering me to the Centers of clusters at various different levels and we can do this with just a few extra scatters so let's do maybe three levels so I'm just gonna grab three scatters here and the idea is this scatter is gonna define my pieces my most coarse pieces and so we don't want anywhere near this money I want relatively few maybe something as low as sort of 16 maybe even let's drop even lower let's say like 12 I want 12 chunks I actually don't want them relaxed I want them to have a little bit more or variance maybe I'll give it sort of one one iteration of relaxation so I want these sort of something like that at my next level up what I want to say as well there's 12 main chunks each of those chunks how many sort of medium chunks do I want to split into and in general I like sort of three that'll give me some variants it'll be anywhere probably from two to sort of four in there so I would take this and multiply it by three so let's just say 36 at that level I'm not gonna relax it I'm gonna change the seed it's not really necessary because it's a different number but that's okay and then for my next level we're gonna sort of split even more and we'll say you know 36 times 3 that's somewhere around let's just do 120 so we'll bulk it up a little bit higher and again we're not gonna relax nuts and we'll change this seat a little bit so this is gonna give us three levels of clustering here and yeah so let's start with that and the way that I want to handle this I think I actually want these yeah I want to flip them around so I'm gonna go from coarse to fine and what I'm gonna do so just bear with me for a minute here this first one is gonna seem like a whole lot of extra stuff that seems totally unnecessary but I'm gonna do it for a good reason and actually the first one doesn't need to run there we go here we go what I want to do is basically say for each of these points that the medium level which coarse chunk are they apart of and then I'll say for the finer level which of these medium chunks is apart and that will include the information about which course chunk it is and the way I want to set this up is so that if I want to add a level all I really need to do is just copy one node and sort of just pipe it into the chain here in principle you could do this with a loop but you get a bit more control by being able to set each individual level and you're probably not gonna want to go much past four or sort of five levels so it's not it's not too cumbersome so what do we want to do here well first I want to figure out what is the closest point here so I'll say NPT for near point we just want the nearest point from that stream to our current position now I'm gonna define a little array here call it cluster and I'm going to set it to size one just one element and then I'm going to set its first elements to that in the air point and then I'm just gonna say I want this attribute value to be on my height so once I've done this if we look at our points here you should see each of them has or the one element array and it has values ranging from yeah they don't sort nicely when they're in an array but basically it has ranges values up to 11 and they should go down to 0 somewhere it's possible none of them were the closest point to point 0 let's just take a look at these some point numbers point 0 was up there and these points are all around here yeah sure enough all of these points are gonna be closer to some of these so that just happened by chance we're basically only getting 11 major chumps and that's that's fine I don't really mind that now at this stage it doesn't really matter that this is an array I should also know you can get a raise of any of these attributes with the normal at declaration by just putting the square brackets after it so I square brackets at tells me this is an attribute type of an integer array so at the first level we're basically just generating this sort of single leveled array when we move to our second level though what I actually want to do here is instead of defining this cluster here I'm going to grab it to say I will defend it here but I'm gonna grab it from this near point equal cluster have that near point so at the secondary level what I'm saying is well for these fine resolution points what's the nearest medium one grab its cluster array which is gonna tell me right now what the coarsest value was we're gonna resize it to make it one bigger so it's current length plus one and then we're gonna add that near point to the last position so instead of int is zero we'll put it in whatever the last position is and so now our first entry is the index for the courses chunk and our second entry is the index for the medium chunk and the idea with these sort of hierarchical constraints is you can then go through and say if they have different clusters in the first number then that's the weakest possible type of link those are links between large-scale clusters if they have the same value so if they're both 9 for example then both of these fine scale points are within the same large cluster and then we look at the medium one if the medium one is different so these two for example so they have the same large cluster but they have different medium clusters that means they should break sort of in an intermediate level if they have the same large structure and the same medium structure then they should be sort of the strongest links and so we sort of move kind of down the chain in this way and the nice thing here is that after we set up this first node where we make the cluster in the first place these two nodes you can copy them basically as many times as you like so maybe actually instead of three levels we want four levels so we'll describe these two values and we just taint it on through and say at this scale let's get even more points in here as our base let's say 400 and now we have three different values and so what we then finally do is go down to our actual constraint network here let me move some of these things and we just want to ask for each of these points so natural blur that's not what I wanted I want an attribute angle for each of these actual points let's just go ahead and get that information from our clusters and so we'll use that same code to begin with and now what we can do is go through and ask on each of our primitives we're gonna get us two points so each point now on this primitive has this sort of array that tells it sort of what was its coarsest it's medium it's medium fine it's fine chunk we basically got all these different levels of chunks and what we can do for each primitive is figure out well what's the sort of highest level we get to before they're different and that's gonna tell us the strength that this attribute should be so if that's our goal what we're gonna want to do is get those two cluster arrays so this should be familiar by now we just want to get our two points so here are our two points and we just want to get those cluster values let's say let's go to zero it's gonna be point zero cluster PT zero and we'll do the same thing for our cluster as well and we're getting at some level value so I'll call this strand lvl for strength level and by default I'm gonna set this to the length of one of these clusters that's gonna be the highest value we're allowed to have that's basically saying it's the same in each individual thing most of the time that's not gonna be the strength we're gonna use though we're gonna calculate that here so we're going to go through these arrays so we're gonna iterate oops not int this should be a for loop so for each element in these clusters and they should have the same length they're always gonna have the same length so we don't have to worry about that we can just check against cluster zero or cluster 1 for each of these we basically just want to say if the level of cluster 0 is not equal the Isle of cluster 1 so if they're different this is what we really want to isolate here we're just gonna say then our strenght level is I and we want to break we want to stop searching so because these are ordered from courses chunk to fineness chunk we basically step through this array and if they don't match with the course of strunk the course is to chunk though so if they don't match here then this is our weakest possible one so it'll get a value of 0 because would be the first one they check and that'll go to index 1 and it'll compare these it'll only do that if it hasn't already broken out and if these are different then we'll get a value of 1 and so as we go up basically if you hit the end and you've never reached this condition then it just defaults to this which is the strongest possible level hopefully then just assign that to our primitive now we'll have all of these values that should be ranging from four all the way down to zero and if we visualize these put this on primitives I knew a ramp from attribute the attribute is strenght level and it goes from zero to four here you can see our course chunks so you can see basically the boundaries between those are in black here if we go up a level you'll see the boundaries between our next level of chunks and our next level of chunks and our next level of chunks until we wrap our sort of strongest chunks are all that's left here in white so you can see that that works pretty nicely we get this nice sort of really big chunks fading into smaller and smaller chunks now this value itself this strenght level is not going to change anything what we want to do now is basically drive our actual strength so we could do this on glue as well if we wanted to but for now I'm just gonna sort of put it oh actually I will I'll put it on both glue and on our sort of break threshold so what we would do now is take that strength value and use it to modify our strength here and we want it to be relatively weak when it's between big chunks and very strong when it's between these sort of like within the very finest chunks so I'm gonna set this up with a sort of complicated expression but it's nice and generalizable so I'm gonna say min strength and I'll call this we'll give this a parameter here so this will be our minimum strength and so I want to set our strength I'll get a couple more parameters in here but basically I want to speed it minimum strength times yeah I want to sort of explain this before I write the whole expression basically what I would do is something like like this which is basically saying well let's take our minimum strength and then we're gonna multiply it by two to the power of whatever our strength level is so if our strength level of zero this is just multiplied by 1/2 to the power of 0 or anything to the power of 0 is 1 so this would just be the minimum strength and then if it was level one that we multiplied by two if it was level site two we've multiplied by 4 and so on and so forth so if we change this value if we make it you know one point one let me set up a minimum strength here that's not zero say 10 then you see our strength ranges sort of not all that high if I put two here you'll see that it keeps doubling so it starts as 10 and goes up to 160 if I put 10 for example we would get powers of 10 so this is the general way that this works what I want to do actually here though is instead of just specifying a single value I often find when I'm doing these sort of hierarchical constraints I want the first few levels to be closely spaced and then I want them to even get stronger and stronger after that so what I'm gonna do here is basically I'm gonna replace this value with something a little bit more tunable so I'm gonna do a fit o 1 and we're gonna see where we're getting that range from but then we'll go to a couple more floats here let's say I'm in bass and Mac space this isn't gonna be happy because I haven't put something in the front part here and then for this I'm actually gonna put a ramp and I'm gonna say all this strand base ramp and I'm gonna pass it basically scaled strength level we're gonna pass in strenght level we know it ranges from zero to four we could proceed realize this but I'm not worried about that and we're just gonna move it into the value zero one okay so like I said big ugly expression what on earth are we doing here the idea is as we range from zero to four from our weakest to our strongest constraints we're gonna be scaling this multiplier the the base that we are sort of putting into our exponential we're going to sort of ramp that so if we went from say two to ten what this is saying is that when we're sort of near zero when we're at our weak values like 0 and 1 we're gonna be going sort of up in powers of 2 more or less as we get towards our sort of strongest constraints then we're actually going to be increasing those as powers of 10 and you know you can control this ramp however you like you could keep it as sort of 2 up until you could make it like a step so at a certain point they're doubling below and then they're sort of tenfold above so if I just set our initial as 1 we scroll through here we start at one and then we go to two and then to four and then all of a sudden instead we're jumping up to a thousand so now we're going up in powers of ten all the way at the end there and if we made this sort of a smoother ramp then we would see we start at one and then we go up to four because I guess by the time we're at this value here we're already up a little bit and 36 512 basically they're getting larger and larger as they get stronger and stronger so if you don't understand this it's not a big deal you can just basically replace this with a single base that you're interested in this works just as well and honestly you're not often gonna notice this difference but I do like to do this because I like the bigger chunks to come apart easily and then I want these sort of farther out chunks to come apart much more sort of it should get harder and harder okay so we can set this up and we can set this up for strength and so for strength let's just go back in here now and set this to one so we're setting it up entirely outside so over here for strength minimum strength of one is gonna be way way too too weak and in fact strength is gonna be for impact so I want this stuff to be pretty strong and so let's do something like this so we're gonna have a minimum strength of at least 100 and it's gonna go up to about a million for those really tough pieces so this stuff is not gonna come apart strictly through impacts and we might want to tweak that but that's just fine for me for now what we really care about is actually setting up our break thresholds for those forces so let's just go ahead and grab all this stuff and we'll duplicate it down here if it can let me get to a new line there we go we're gonna need to rename all this stuff so this will be I'll say men let's put an F in there for strength put enough here that strength base ramp base and then I'm gonna call this for strength so now you should get a whole new set of variables down here there we go and in general we'll need to dial this in so I'll just sort of set up some numbers here and we'll see how nicely it works I'm gonna say as a minimum strength maybe like 8 and we'll let it sort of grow slowly up to yeah in general because these are ratios and they're gonna be getting pulled apart pretty quickly we don't need really high values like we have for for our glue strength we want these to be relatively lower so we'll see how this works this might be alright and so now the last thing we want to do is go back into our SAP solver and actually respect those values so instead of comparing against this threshold now each of these constraints has an actual value for strength and that's what we want to compare against so we can get rid of this thing a little more and delete spirit parameter okay so with that all in place we should get slightly more interesting behavior now we're gonna be sort of still just driving my noise so let's just see what happens here okay so if we look at our sort of force strain and our force strength we can see that you know the strain is getting pretty high we are definitely if we look at just these and we visualize our force strain again I get a color off of here and this just hasn't updated there we go we're definitely losing a lot of chunks in here actually you can see that it is breaking apart so we've lost basically all the connections between those intermediate ones but we haven't quite lost enough for this to change unless it just hasn't been updating yeah so these are still maybe a little bit too strong so that's easy enough to change let's maybe just drop our minimum and our multipliers there and we're having a couple pieces coming off and here we go so we are actually starting to see it's coming apart a little bit so this is still a little bit too strong but we are starting to see these pieces coming apart so probably if we just amped up the this this noise just a little bit more even more let's just make it crazy and here we go it's really starting to sort of come apart at these seams because we're just giving it sort of noise it's kind of being jostled back and forth a little bit so it's not quite tumbling just yet but we are seeing these nice things where we're getting these bigger pieces coming off and these littler pieces and you can see that all these major cracks are developing along sort of the boundaries of those major chunks that we've defined and you know these aren't very interesting shapes because we didn't give very much resolution to this we didn't do any kind of edge nose or edge detail so this is a very trivial fracture but it's showing a general workflow for getting these nice these nice clusters here and so if we actually give it a little bit of direction as well we should really see it kind of come apart and finally at around sort of 240 we're actually starting to see it really push through and you know this means we probably want to just fix my display here this means we would probably want to tweak these values that was a little bit of a slow burn to get to this stage here but if we let that sort of keep growing a little bit farther what it is showing that I really like is that this builds so this isn't like an impact where it just sort of hits at one point we're really kind of feeling it sort of growing this pressure and we actually aren't building up this force but what we are doing is successively sort of breaking pieces and allowing this stuff to move more and more and the more that it can start to move apart the more it's being subjected to different forces the more we're actually starting to get some impacts between pieces and so this sort of strain on the overall structure really does start to build up over time and now that it's snapped there we should be able to see that it'll really just come straight down here and that's what I really like to see here if I get rid of these guides I don't really need to see that we're getting these kind of nice pieces so again even though this is a really trivial fracture that we did or really trivial geometry we're starting to get pieces that still have like bits of the floor on them we're getting these really nice big chunks that are coming apart and when that whole top level comes off it's really coming mostly as one piece and it starts to sort of fracture along those lines and you can see how just by getting these sort of basic clusters you can get some relatively interesting dynamics and shapes here okay so there's a couple more things I want to do here but we're basically done at this point you can see that it works we're getting sort of a force and all we have to do is pipe some kind of a force into this terminal as long as it exists on each of these points this general workflow will function but the other thing that I want to do is make this a little bit more like actual glue constraints because we have these sort of properties here we have half-life and propagation iterations and basically what happens with these two things is that strain or impact whatever the forces that's gonna break this constraint it gets calculated every frame and then it decays and so basically you calculate new strain you add it to the old value and then you decay over time and this means you can have multiple small impacts build up into a large value as long as they happen back-to-back fast enough that they don't decay faster then they'll sort of build up and break it that way so you can have one very large focal impact or you can have a bunch of really closely spaced smaller impacts and that decay is regulated by half-life this is in seconds and so this is how many seconds does it take for the value that's accumulated to reach one half of its current value so 0.1 is relatively rapid decay will see with force it's often nice to bump this up even farther but the other thing we're gonna want to implement is this propagation iterations and what this does is basically spreads spreads the force through the constraint network and so if you get an impact on one particular point propagation iterations if it's at 1 that's basically all that will happen but if you bring this up higher and if you're using glue in general I recommend using this but basically if you get an impact in one spot that force will spread out it'll sort of blur into the whole network and this gives kind of a smoother appearance and behavior so what we want to do is set up these values for our network so let's just go ahead and make a couple parameters here I'm gonna give them a new folder right at the top here and we're just gonna drop two values in here and the first one will be our path life and the second one will be our propagation iteration I'm going to set our half light to something like point two and let's just say propagation iterations of for now we'll dive in and we want to sort of take care of these two things so first we'll deal with the K and we'll do that before we do anything else we'll do that in a primitive wrangle I'll call this decay and basically what we want to do is get this value this fourth string value is what we want to decay so first we need to know how much time is a lot since last step I find the the built-in timing I find this sort of unreliable in part because if you have sort of different solvers working at different rates you can't necessarily depend on this being being correct in context usually it's right but just for the sake of being absolutely sure I'm gonna do it a little bit differently I'm just gonna say elapsed is our current time minus another variable that we'll have which is called last time and then after we do whatever we do for decay pull this out our last time to our current time so this just lets me know that okay every time I pass through here I'm gonna figure out how much time has passed since my last sort of step I'll take care of that myself we can call this a sort of more memory heavy version because we do have to store this extra variable but ultimately in the context of a bullet network one floating-point attribute not really a big deal we've got plenty of others that we've out of here already so with elapsed all we want to do is Lately multiply our current for strain by 1/2 raised to the power of elapsed divided by our half-life so this is basically saying how much of our half-life has transpired and we want to do sort of 1/2 times that so basically if the entire half-life had elapsed this experiment would be 1 that means this would evaluate to 1/2 that we were to multiply our current strain by 1/2 when this is less than half-life this value gets smaller or sort of it gets larger actually and so we're not decaying this by nearly as much per step but after elapsed has reached then we'll have done that amount so basically this is just what lets us sort of no matter what time is elapsed we figure out how much we should decay our strain by so that after a period of half-life if nothing else had happened it would decay to 1/2 of its original value so for a half-life we just want to grab that parameter we set up so that was up here I'll just copy that parameter I'm going to paste it in here so it doesn't break anything pull it back out and we'll just put that right in there so that takes care of decay so basically before we do anything else we're just gonna decay this fourth string that means at this point what we actually want to do is add it and so instead of sort of just resetting it every time we won't actually add it we want to let it sort of build up over time this is gonna mean that we want to change our strength probably because the more that we let this build up even if these forces aren't changing then as long as sort of our time step isn't decaying it fully they're going to sort of keep getting stronger and stronger so we're probably gonna want to tweak our strengths but it does mean that will allow it to sort of build up and over time be able to accumulate now the other thing we want to do is that propagation in duration and I'm gonna do this and are really sort of straightforward way I'm gonna do it for each number I don't even need this metadata here and the number of iterations we want to do is going to be this value pace that in here so four times we're gonna do something what do we want to do well basically we want to blur these values and there's a lot of different ways we can do this I'm just gonna do it with to attribute profiles so first I'm gonna take this value or strange and I'm gonna promote it from primitive to point so that's going to for each point now is gonna get a value that's the average of the four strains on all the primitives that it's associated with and then I'm just gonna promote that back on to primitives for straight make sure that's the right name it's always called for strain that should go at the end so basically each time we go through we're pretty much just averaging we're gonna average it onto the points and then average it back on to the primitives and the overall effect will be that each pass we basically spread out that force that sort of strain across the network and then once we've done all of that at the very end although great constraints here so this is our propagation durations there's our break this is our we'll say a better acceleration and we'll call this update straight there we go so now if we just go back and look at our network here fix our display again there we go now as we step through okay everything is gone basically immediately so as I said it's gonna need to be a little bit stronger here so let's just set our base strength in fact I'm gonna set it quite high because I just want to show you what's going on here first so that's pretty high are we visualizing anything no here we go so we have a little bit of force there already this is going sort of way way too strong still so this strain I think because this wind is really strong if you're just relying on instantaneous strain snapping these things then you need really strong forces once you start letting the force accumulate especially with sort of a long half-life and a lot of blurring iterations you really don't need these strong values anymore so especially this noise amplitude that's way more than we need let's just bring all this stuff down so now we can start to see that it's really sort of fading in over time oops it's really kind of going very slowly for some reason okay so I crashed my Houdini and the reason is relatively clear here on this propagation iteration what I did was merge each iteration and basically that meant every time we went through we just blurred at once and then we basically at the end we're gonna get four times as many constraints as we started with and then the second time we passed through this we're gonna do that again and so we very rapidly ended up with thousands thousands of constraints before I sort of exited it on step seven I was using about twenty eight gigs of RAM so yeah make sure to set this to feedback iteration each iteration so that's just gonna say once we finish this and go to our next pass we're just gonna take the output and pump that back in so yeah that's pretty important so feedback each iteration okay so this should behave a little bit better now update and it's possible some of those strength changes I made well we'll see how many are even still here did I change any of this okay we're back at our original values now the display is already messed up area and you want to see before strength okay so now what we should see as we step through okay they're much too weak and we determined that before so let's just do those things again so again we have just way too much of all of this stuff I'm gonna bring this stuff way down and I'm going to bump up these strengths so now as we step through we're again breaking pretty early our strain on here it's coming up pretty quick but you can start to see that it's sort of smoothly kind of blurring and wrapping up in here so if we make this a bit stronger again and actually let's just make this very strong so it shouldn't break what we should see yeah now you can see the general idea here these values are sort of bumping off and this is gonna sort of autoscale the range so let me just clamp this to something let's give it a min and a max let's go from something low like 10 up to say 500 300 that should be fine so what you can see is very quickly we get these these hotspots but they also really blur and spread through the network so you can see that blurring there now once we give this a sort of a scale to work with you can see that's really spreading through across each of those iterations and that's what's gonna let this sort of start to break a little bit more smoothly now this is ramping up really really quickly basically we're going from nothing and it a few frames of this blurring we're getting all the way up into the sort of huge values so I'm gonna want to scale this down a little bit and what I'll do is basically get our strength more in that range and so actually if our strengths are ranging from a thousand this might not be so bad if our sort of force is getting up into sort of those levels it's to see what this is looking like so we are losing primitives but apparently we're not doing it fast enough for much of anything to happen although this is getting pretty close you can see a lot of this stuff is gone already I'm gonna let it do it automatically again so if we let this run a little bit farther possibly we've sort of tapped out the strength of that noise a bit let's give it a little bit more local local variation there and there we go over time that's sort of starting to build up and so if we dial in some of these values we've reached sort of a plateau so if we let it decay a little bit more slowly give it some extra iterations here we should really start to see it coming apart sooner it looks like potentially what's happening is that this force is just not pushing these pieces hard enough to actually knock them over although it is starting to bend a little bit we're getting a lot of sort of resistance there I might even bump this up a little bit higher just really let it start to break through there and I'm gonna take this back down this down a little bit I do want it to come apart I don't want it to be just the largest chunks that sort of defeats the purpose with that hierarchy so that's looking better nice so now what we get is that we get this sort of gradual buildup of this string so we let it continue to keep adding into there and spreading through the network so we get a more overall collapse whereas before we would get sort of these localised individual pieces now we're getting that sort of strain spread out throughout the network and maybe this is a little bit too much you know there's a lot of dialing in to get the look that you want obviously you could see them for my many mistakes I probably should have just tuned in some values earlier and pretended I got them first shot but you can see the sort of general workflow for how you can tweak some of those stuff and figure out sort of how to get the look that you want okay so to close off I just want to show you that basically you can put anything you like in over here so here I just used a basic pop force but let's do something a little bit more interesting let's give it a little bit of a curve for us just to show that you can really sort of respond to some more interesting effects I'm gonna get rid of that pop force and I'm gonna grow up in a pop curve force and what we're gonna do with this is we're gonna feed it in a curve and we'll be able to tune a few different values there so let's just jump out here and make ourselves a curve I'm gonna template my geometry and I'm gonna do a draw curve I want to draw this I'm gonna project it onto the ground initially that X I go to my top view and we'll just use this and let's say how do I want this to work maybe I want it to kind of come no I don't do that I'm gonna get it to sort of come through here and then back through and this kind of a direction that should do I'm gonna resample this and I'm gonna make sure I have my curfew on here and I might transform this to give it a bit of a different position I maybe want it to loop like right around the building sort of like this okay and right now this is all just lying flat on the ground but I grab that curve you for a reason because what we can do is just say attribute wrangle and we're gonna say P dot y is fit a one ramp we'll call this our a we're gonna pass it curve you and then we'll just get bin Heights and our max up if we create these and we just give ourselves some values here let me just template that again you know one with zero is probably fine our maximum we can start to scale up we definitely want that higher like four maybe even go up to five or so really get it sort of looping around I kind of like this so it's gonna come in curve around and really sort of pull off some of these other parts of the building here that's looking pretty good I think I kind of want to smooth this thing maybe I'll do that after I've given it its height that's a little better okay so that's good enough for a shape we don't really need to labor this too much right now I'm gonna call this my horse curve and we'll go back into DAPs and we're just gonna pipe that in here so we'll point to there with our sup turn off our point visualizer and this is sort of what this pop force is gonna do so right now the radius is really really wide here so I'm gonna change that onto this max influence radius one is gonna be starting to pull a lot of that I might even want less than that let's really just bring it way down I kind of want it to be really isolated to these parts where it's overlapping so that's looking pretty good now what we want the force to do we have a few different variables in pop curve force so follow scale is basically how much is it gonna go along this curve suction scale is how much is it gonna be drawn towards the middle of the curve and orbit scale is how much is it gonna sort of rotate around here so let's maybe get sort of a bit of all of those things but the main thing I want is to follow scale I wanted to sort of get pulled and drawn up in this direction so let's bring that up to maybe something like four and I'm gonna leave these values the same there's no velocity on these points but I'm gonna turn this off anyway what this is saying is if there are any points on this curve that have velocity so if our curve here had V values then those would get sort of passed along and they would be inherited onto the points that are influenced by it so I don't actually want that we're using this directly to produce force now with that in mind with this value treat his wind ticked off that actually means it's not going to treat it as force what its gonna do is instead of setting instead of setting a force value so actually if we just play through a couple frames here you'll see nothing that's gonna happen and that's because it's not setting force so there's nothing here none of these get anything what it's setting is target B and this is basically saying how fast do I want it to be so that's how wind works so if you were wondering what's the difference between wind and forest wind sets target velocity which is what the points try to match and then air resistance is what creates sort of drag forces set the force property so we want this to be a force thing so if we uncheck that now we get forces here and we own take ignore mass so that we get sort of uniform forces so now if we turn this on we should start to see we might have to dial in these strengths a little bit more yeah that's not gonna be quite enough take a look at this we are seeing we're getting this strain and we're getting it breaking exclusively in these spots here it's just not quite doing enough yet for us to see anything so let's go ahead and dial some of these up let's say bring this to six maybe one point five even two will give it a nice sort of twist not sure what sort of scale that's supposed to be on it doesn't actually visualize any of that curve so and we're just starting to see some pieces coming off here so this is spreading a little bit too slowly it's not sort of giving us enough yet so let's just keep boosting this gonna be a little bit gentle about it I might let ooh that's really high that's life and I drop that down again but I'm gonna get more iteration so I'm gonna blur it farther and we're gonna amp up that force and we're just gonna keep dialing this until it does something that we like and definitely too slow here let's just double all of these and maybe let it influence a little bit farther actually so let me just see this shaping that's radius a long length okay so this is the fall off from curve okay so what we can actually do is sort of set ourselves a little bit of a scale here and so we can give ourselves a wider radius but basically taper off the influence as we get towards the outside I think that should be good that will influence more points which will help this to drag more so it's definitely breaking a lot of these pieces it's just not quite drawing them along yet some of this could be actually that our glue is too strong I'm gonna maybe drop this down a fair amount I know we made it really strong outside let me just sort of notch that down because part of what we might want is that once these pieces start to break they can sort of jostle their neighboring pieces and cause some actually impact brakes as well here we're starting to see this stuff getting pulled through okay so that's starting to work one other thing I want to do here to get this to really show this this field effect is I'm actually gonna turn off gravity for now and we're gonna put it back in but we'll put it back in in a slightly different way but I just want to show you we should get some better effects here because the force is gonna really push this stuff a little bit more strongly so right away we're seeing some of that stuff is getting pulled off more cleanly we're still not seeing what I like to down here so let me just let's just keep ramping this stuff up I'm not really seeing well I'll keep a little orbit part of the problem here is that the force is actually it shouldn't be the force should be pushing it out of the building there a little bit so we might just need to give it a little bit more time here you can see these pieces are really struggling to sort of break free I'm going to take a look at strength again what did I do yeah these are gonna be truly extraordinary levels let's just go to ten there is our weakest then put this back to one that should be okay I am gonna give it some propagation iterations as well and I'm going to pull up this half-life a little bit further this is looking this is starting to look good what I really like about this actually is this slow build so little pieces come off and then you see it starts to break it starts to sort of weaken as more and more of these pieces are coming off and I think there we go we're starting to get it from here I think once this pulls away we might start to see a little bit more movement here we're gonna get a little bit less resistance from these pieces try to jostle I think we're almost there I'm going to pull this radius out a little bit farther again and let's just really amp this again there we go there we go now we're finally getting those pieces coming out that's really really wanted to see I wanted to see that full sort of wrap around there okay so this could obviously be tweaked a little bit more but this is enough for just still the very last thing that I want to do which is to bring gravity back in I really like that it when you turn it off you get a lot more of this sort of lift you get these things actually sort of following this sort of force field and that's a lot more interesting to me I really like to sort of see that I might even turn suction way on so it really sort of pulls into that area but the problem here of course is that it then it doesn't respect gravity and so I feel like as a sort of oh that's looking real good now I just need more suction apparently um the problem here of course is once it escapes this field then it just sort of drifts out into the ether so what I want to do is basically apply gravity to any of the pieces that aren't being sort of affected by this force because obviously this force is almost like this would be like a sci-fi or a magical effect or something it's not really governed by the laws of physics in the normal way there's nothing we can really think of that would produce this kind of a shear on a building so it's a very sort of specialized kind of approach so it makes sense to maybe turn gravity off in that sense it's like it's a force field or a traction beam that's sort of overriding gravity but as soon as it's out of the influence of that we do want gravity that to then take effect in a normal way so what I want to do for that is just a real quick pop Wrangell and what I want to say is I want a conditional with two things first if it's moving so if the velocity is greater than zero so I don't want to really apply gravity necessarily to stuff that's not moving at all I don't want to worry about that too much I want to leave that sort of for this force no matter what so if it's moving and the force that we just calculated here if that force is less than some very small value oops and we needed to use our length again so if those two things are true if it's moving but it's basically outside of the influence of this sort of pop curve force then we're just gonna say our force is equal to gravity so zero so now we're gonna set our force initially based on this this pop curve but then we'll say if our piece is moving but it's not in the influence of there then we'll just use gravity instead and here by just setting force to be gravity that's basically identical to what we would do with that gravity force down there so now as these pieces come apart you'll see once they leave they seem to be just floating up into the sky all right clearly that is not working yet of course of course of course Len is how many elements are in an array so you know three is greater than zero so this will always evaluate to true three is never going to be less than point zero five this will always evaluate to false because I'm not asking about the length of the vector that would be the function length so Len is how long is it array how many elements are in it length is the length of a vector so there you go stupid mistakes we all make up well I certainly do okay now it comes through and yeah so it is working now you can see there being sort of ejected with really high velocity so they're actually kind of getting thrown out they're pretty far um but they are coming down and hitting the ground afterwards that's pretty good so what I might also do in this case it's maybe as soon as they leave that field we can even sort of damp them a little bit so let's just give it a little bit of drag and we'll give them a little bit of angular drag as well and there we go so if we come back out here so we're just seeing this geometry it's a couple things I I liked in the end there so that sort of twists apart and we're getting that kind of buckling there I like this sort of motion we're getting that that twist here so that's kind of fun the other thing I really liked at the end yeah as it fell down this piece here you can see it sort of falls into that stream it gets carried along and then ripped apart by those forces so that's really fun so overall this is kind of the general approach and it's really not so difficult we're basically what we're doing is we're saying well what does glue do on its own it accumulates these impulse values and it actually has an attribute impulse once they start to hit each other we should be able to see actually if we just go out here sorry not impulse impact so this isn't something that we produced at all if you've done the dynamic fracturing tutorial we'll have talked about that there but this is a value that dops is producing for glue and basically how glue works is when this value is higher than strength then it breaks so all we're doing is we're saying well let's make our own value that we treat that way and what we did was we basically figured out given the forces acting on these pieces if they're getting pulled apart then their projected positions are gonna be farther apart than they are at rest and we basically take the ratio between where we expect them to be and where they are and we accumulate that value instead and that allows us to get this sort of nice movement coming through here so this is a pretty straightforward workflow but it gives these nice effects and it lets you do things it gives you all the advantages of glue which is to say it's really nice and fast it's really nice and efficient but you can still break it with forces and you could use a pyro sort of velocity field you could use that to drive your forces basically anything on this input that puts a force attribute on your points can be used for this effect and if you don't want the force to actually act on it if you just want a field to be breaking it but if you want some other thing to drive how it moves and its dynamics in that case all you would really want is to have some other property because this doesn't need to be forced all we're doing with force here is we're using it to calculate acceleration the solver itself respects this variable force so if we put force on here we can do let's just say wrangle we can just set any force we like we can just sort of set it straight in here we could go negative 50 I guess this is gonna have no noise on it let's just say random that's fine just just something to show if you put force on it it will respect that for us we don't need to use force here though so what we could do is take this whole curve thing we've got here let's just put this curve force back in here I'm gonna put a new pop Wrangell I'm gonna say my force equals that force value and then we'll reset force to know and now we can go in here and instead of using force we'll just bring in that my force variable and now this curve field will still break everything but it won't in fact you have no forces acting at all so let's just put gravity back in here for now now it's not gonna get drawn along the curve but it's still gonna use that force to break it so if we play this now you're starting to see these breaks it's really starting to fracture because of that force but it's not gonna be drawn along there at all the only force it's experiencing is gravity now this is part of why it's not really going anywhere it's just waiting until it can fall out and there you have it those chunks are sort of falling out so I just want to tell a straight that you don't need to use 'literally force basically anything that produces a vector that can be treated as force that can be thought of as force it could be used in here if you want it to also be affected by that force and I think that's probably usually the more typical sort of workflow then it just makes sense to keep force just let it be named force just use that force as it exists gravity again and just bring it in and everything is sort of unified and so whatever you pipe in here as the force is going to sort of respect for both breaking and movement in the solver but if you do want it to just influence the breaking and not the moving then just use your own variable there instead of the sort of built-in force variable so that's pretty much all I wanted to cover today it's a relatively straightforward workflow but I think it's one that can be pretty useful we often want to use glue because it's so nice and cheap it has really good properties but the problem with glue is it only really pays any attention to impacts so if you wanted to pay attention to something else well you have to build that in yourself and this is just a way that I've approached that for things like fields and the nice thing about this is it can respect sort of any arbitrary field any arbitrary force as long as you produce that force attribute or some other similar vector attribute then you can get it to sort of behave just as you expect and it's pretty easy to implement things like the half-life decay and the propagation iterations and that overall just gives it a really nice sort of tunable effect as always let me know if you've enjoyed this and especially if you sort of end up using this for anything or if you have any sort of suggestions or questions or comments love to hear all of those I'm gonna be a little bit a wall for awhile I'm actually moving internationally in just a couple of weeks so I'm gonna be without my workstation and pretty much disconnected for a little while let's stay tuned I've got more stuff coming and if you have anything that you're sort of looking to see please do let me know and as always thank you very much and goodbye you
Info
Channel: Diffuse FX
Views: 17,120
Rating: 4.989233 out of 5
Keywords: houdini, vfx, tutorial, DOPs, RBD
Id: fzRJcGFuPXU
Channel Id: undefined
Length: 94min 39sec (5679 seconds)
Published: Mon Jun 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.