Special Guest: Ben Watts - Shortest Path Growth

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone this has been what's foreign tag ma today I'm going to show you how to create some really easy growth inside of Houdini what we're going to do is create some start and end points calculate the shortest path between those and look at ways to manipulate the growth patterns that we get let's jump in and have a look okay so let's get ourselves a geometry node we'll put that down jump inside and get rid of the file and let's start with a font object so I'll put down a font and giving this and take my tutorial let's put the letter in then just move it up so it sits on the ground playing a bit just a bit more that looks good to me now we want to add a bit of thickness so let's put down a poly extrude em we check out put back we can add some vertex normals and just grab this distance and drag it out so we've got a bit of thickness very good okay so after this we're going to subdivide our geometry not with a regular subdivide we're going to use a divided node for this and we're gonna unsure convex polygons and turn on brick of polygons and just drag that down and we need to enable a wireframe so over the viewport here just hold down shift and press W so we can see our divisions and just drag that down until we've got a decent number of subdivisions just have a look at it and something like point zero four should work okay now what we want to do is make two groups one will be the start group for our growth points and the end group so we'll just do this manually and put down a group node and my groups are set up to use $1 OS in the group name and then of right-clicked and made that the current default value just so every time I put down a group and I type in a name here that actually becomes the group name you just want to be careful sometimes when you change these names you might need to bypass in an unbiased just to make it refresh so we've got a start group we want to set that to points and we will actually leave it at pattern let's just put point zero in there for now we click that we can see at point zero is right there on that front face let's control-c control-v that to copy it and let's just call this one end and let's just change the group operation to range and we'll say let's group every second point in this mesh then you get this range pattern that we see here okay that will work then we want to put down the find shortest path note so this is a note that does all the magic and this note actually does a lot of stuff if you have a look on the help card there's a lot of cool things that can do we're going to use it in a really simple way here as you'll see but it is worth looking into so let's just select the start points our start group and for the end points we'll get end of course and we want to change this mode under output paths to the third option down and it's from any start to each end as soon as we do that we can see from our start point we have a path calculated to each end point okay and it gives us this kind of cool shape it's not that interesting it's quite linear but we'll see how we can easily modify this to make it more organic and interesting and one thing to note here what we get here is this thing called a cost attribute it's just a point attribute and it's a bit off the screen here but it's basically just gives us a value which is almost you can think of it like a distance I suppose from the start point to the end point and it's really useful in terms of remapping things like thickness of polylines or whatever we might want to sweep along your curves another cool thing that it does is allows us to select a group of edges to avoid so this is obviously great if you want to account for obstacle objects and just have your path grow around those objects we'll take a look at this feature a little bit later so next up we'll put down a carve node okay and let's uncheck the first year check on the second one and we'll see I've already got some growth happening so as you can see it only takes a few to get up and running with this effect very simple and straightforward alright let's just put down a null so we can get rid of those blue guides so that's looking pretty good for a start let's just have a look at what else we can do to improve this so what we might want to do is have a look at ways we can change our topology since that's the thing that governs the way our paths grow it's all based on the edges of our mesh so let's have a look at that so let's go back up to the top here select a divide node and just move these guys up and let's just drop a remesh you know underneath the divide node ok we'll enable that and let's just give it quite a bit of detail we go back and sorry let's half see you know quite a cool-looking structure okay so let's have a look at a couple of other things we can do to enhance this effect before I get started on this so I'm just gonna make sure I've got my carb animated because it gets a bit annoying dragging it manually all the time so I just go to frame 1 set it to 0 I'll down alt and left click in the box here to set a keyframe come out to frame 100 and set that to 1 and set a keyframe so now I can just scrub makes life a bit easier so one thing I do want to talk about with this is the idea of having this grow in a volume which isn't really as easy as a usual method that we do with growth algorithms when we're using points and things like that well not that I've found anyway however there is a hacky way that I've figured out we could use for something like this a singular letter which is quite easy to work with there may be other ways to do this but bear in mind because this effect uses the actual edges of the geometry not the points you know we need to look at this in a different light by the way if anyone has any any better suggestions on how to do stuff like this I'd love to know but the are the the hack I came up with in this case was to just go underneath a tree mesh I'm going to put down a tetrahedral eyes node if you don't know what that does basically it fills the the object with polygons essentially all primitives so it doesn't have a hollow inside like a regular piece of geometry would and you can see the effect is quite nice we've got our growth going right through you can get quite slow as well so you've just got to watch out for that but I just thought I'd show it because it is a a neat little hack if you need to get this going in a volume or the appearance of going inside a volume rather quickly so we can scrub this and it still is relatively responsive looks good one thing you'll note we've just got a singular growth point here but we can easily change that to make it look a bit more interesting just come up to start and let's just type in some random numbers like five hundred twenty five hundred and we can see now we've got three growth points and it just makes the whole effect look a lot nicer another thing we can do is come down before our carve let's put down a smooth and you'll see it goes quite hairy looking and that's because remember we've got a ton of end points but just a couple of star points so we've got a lot of paths essentially overlapping and this could be something that you find useful however if you do want to sort of you know restrain that look a little bit what we could do before the smooth is just fuse some of these paths together like this and we get now one more of our original look back so it's just another thing you could do of course you could play with you know different values on the smooth and you'll get much different results these are all fun things to play with so now we're going to take a look at how we can add an avoid group to make our edges grow around obstacle objects so what we'll do is come up here and let's just put down any old piece of geometry will go sphere I'll just template that and we'll make the uniform scale maybe 0.02 well 0.2 it should be much better just move it up a bit in in Y like that and move it forward in Z we'll take a chunk out of our existing edges here okay then move these nodes down so we've got a space under the end group but down another group node then let's just name it avoid remembering that I have dollars OS up here in the group name so it'll take on that name I want to set this to points we'll uncheck this enable box here go to bounding check enable and we'll choose bounding object points only just note that I wouldn't normally use this mode is quite slow but this is just a very quick example usually I'd turn my bounding object into a volume if I had to use it and do it like that but there's no need in this case we'll plug a sphere into the second input of the avoid group okay and we'll select it and we can see we've got some points the problem is that our find shortest path node needs a primitive group well that's fine we can go up to edit convert and change this from points to primitives and choose $1 OS group so now we have a nice primitive group to use go down to find shortest path node on the end up here called service constraints just check edges to avoid and select our void group and then there you can see we have a nice piece cut out so if we go down to our null scrub through we can get a better angle on this might be hard to see but it is indeed cut out I'll just move it around a bit so we can get a better look at you okay scrub this and now we can see some of the edges making their way through will untempered that's pretty cool it's very simple and works quite well scene to create some obstacles for our paths so now we're going to add a width attribute to our curves so mantra can render them natively or we can visualize them with something like a poly wire or a sweep if you're going to use a sweep you'd want to use the P scale attribute instead but either way they'll work but let's just put down a point vibe and we're going to remap that cost attribute which was generated by the find shortest path node into a width in this case so let's just call our WAP width and select that and jump inside we need to bring in our cost attribute so we'll use a bind then we want to remap that with a ramp parameter so it spits out a 0 to 1 value we'll make a spline ramp float cut them all wrong for interpolation so it's smooth and we'll export that as with one thing I do want to do though is throw a multiplier in between here because we're going to be working with some pretty small numbers so we'll chuck down a multiplier we'll middle click and promote that parameter click on that little handle let's call this one with mult okay default you can be 0.01 and we'll jump out so we've got a we'll go to a twits malt let's just bump this one up a bit like that we'll put down a poly wire this maximum Joint Scout because it creates some really funky geometry and let's just plug it in and see what happens by default let's coded wire radius which is 0.1 and that's massive in this case so let's tell it to read our custom attribute called width so I'll put down an ad symbol and type in width that looks much better okay so we can see we've got our now thicker curves here and they're thinner here we can probably adjust this Co a little bit to dial it in let's go back and have a look made it along a bit more you say it's working well we've got down here and thin pieces here so again this is determined by the start and end points and where they're located and everything like that okay so now I'm just gonna show you a little tip on he would grow this stuff over say it's the letter that's sitting on the ground and you wanted it to cover the ground as well so let's just go back up here we'll zoom out a bit and we'll just turn off this tetrahedral eyes for a moment and we'll just activate this remesh turning our wires and let's just put down a grid we'll make it a size of 1 and 1 and 20 rows 20 columns that's fine I'll put a remesh under this grid as well so we can see how greedy are whoops that's remesh t' you just get rid of the tetrahedral eyes for now and let's just merge these guys together ok so when we do that we can look at our groups we can see we've still got you know start points on the end and now we've got points all over the ground and we've still got a sphere let's just get rid of the avoid group as well turn that off and let's have a look at our paths so we've merged out geometry however there's not growth on both pieces obviously and that's just because they're not connected so one little hack you can do here is under the merge we can just add a fuse and we can just dial it up a little bit until the two pieces of geometry have at least you know one or two points in common and when we do that come down to a null we can see that our points will you know start off where they were meant to and then they'll propagate down onto the ground see the patterns pretty interesting here it might be a bit too smooth so we could turn that off or just lower the the amount of iterations remember - if your piles ever get sort of ratty looking and jagged you can always reefs and them okay so just bear that in mind as well so this is just a cheap way to you know have this connect and grow across multiple surfaces you know the pattern is not fantastic at the moment and we could even maybe with the the end points instead of saying one of every two so one of every twentieth you know just for something different you could even go back up to the fuse you know add more connections and then you end up with something like this these are just ideas for you to play with but um you know it can be fun stuff sound off the smooth again so many ways to get different looks so there's that let's just disable this merge here for now go back to the end get one of every two and going back over something I mentioned right at the start how you know we know that the the curves grow along the edges of the topology okay so that's key and giving us the look that we're after so just play around with different ways to alter the topology for example we could get rid of the remesh here we could go V DB from polygons okay and add some resolution and convert V to be my trees getting a bit messy here make that polygons and you get somewhat of an even flow of Poly's here but if we move all this down you know you could put down something like a smooth or something like that add some iterations in come to our find shortest path and then all of a sudden sorry down to our I'll know Laura with and grow this and you probably want to smooth em for this one turn it off we get cool patterns like this so some of this stuff can look really interesting and look really different to what a regular growth algorithm would produce remember the one of the main differences between you know the the point based approach in a wrangle or whatever and the find shortest path is with find shortest paths we're always going to hit our target end points with an algorithm that can just start growing and just go wild and you can't really ever predict what it's going to do but you can somewhat but not you know a hundred percent where this is a targeted approach and just a different look something that we can you know manipulate in a number of ways that's it for another tutorial guys thanks so much for watching I hope you enjoyed it and I'll see you real soon
Info
Channel: Entagma
Views: 24,145
Rating: 4.9801979 out of 5
Keywords:
Id: WPkf0vakOO4
Channel Id: undefined
Length: 20min 34sec (1234 seconds)
Published: Thu Dec 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.