Procedural Modelling | Houdini Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
good evening everybody welcome to uh this evening it's uh escape studios webinar with me mark speevick i'm the head of 3d and course leader here at escape studios and i'm going to take you through um tonight particularly looking at um houdini and um procedural modeling whatever that kind of means these days i mean procedural modeling um really is um an approach to modeling rather than um as a framework i mean the framework in houdini is procedural that's what we mean by procedural modeling everything you do in houdini essentially is procedural but it's a whole way of thinking um what we try to do is work in a non-destructive way so when i talk about procedural modeling what i think of is um a set of procedures or jobs that you'll do to get your end result so you're probably thinking well i can do that in my or in other software the difference is in my and other software what you do is fairly destructive if you model something you sculpt it you pull things around you've got an end result if you need to make a variation you have to do that again from the beginning it's kind of a destructive workflow there are ways you can speed that up and use my history to sort of you know finesse stuff but ultimately you'd still got to do some hand work in there that's unique and um you'll have to repeat that again if you need to make variations whereas with a system like houdini you can work that way if you want but when we say procedural modeling what we're meaning is we're actually going to build a tool we're going to build a machine that will make a model for us so we design a system that will build the geometry for us the advantage of that is once you've got that system you can generate lots of variations very fast with it um you'll see what i mean from today's example so the example i'm going to talk about today is say for example um you want to draw a track you want to make a track for a game um but at this stage we know that we want to track we want some barriers going along the side of the track and some posts the track might go up in the air so we want to see some post to the ground but we don't know the design of the track it could be a figure eight it could be a loop it could be a you know much more of a squiggly shape or we might have 50 levels in this game and we want 50 different tracks so if you're going to model those in maya it would take a while you could you know there are techniques you could use to speed you up um but in houdini we're going to build a system that basically you just plug a curve in and it generates a uv track for you at the end so hopefully i'm gonna i'm gonna demonstrate that by building it and hopefully you'll get a better idea on how you would approach a problem like that in houdini and how you can turn that into a useful tool and obviously there's a big demand for lots of assets these days and people that can design the tools to make those assets and that's where sort of this idea of procedural modeling comes from so we'll look at a simple example today so i'm just going to share my screen with you here so hopefully now you'll be able to see my houdini session there now you will notice on the zoom interface there's a q a button and a chat button um it's much better if you type stuff in the q a button because it's more likely that i'll see that and be able to answer it and i'll try and leave a couple of minutes to answer um stuff at the end about the courses and things um so we do teach houdini on the course for an accredited trainer and uh asset building and procedural modeling is a small part of that obviously we teach all the effects and everything else but um houdini is a very sort of the the leading software for making these kind of assets and tools and it's being adopted more and more in games and vfx all the time so it's a really really interesting thing to have a look at so like i said before um the demand is that we want to build a track we don't know the shape of it but what we'll do is we'll use curves as a foundation for that so the idea is we can generate lots of curves and then the track will build the geometry for us complete with uvs so the first thing i'm going to want to do is create a curve so i'm going to create a geometry node in houdini and um let's call this track maker so i'm going to assume people understand a bit about houdini this is not a sort of an entry level this kind of mid-level um webinar so you should understand houdini and sort of about the nodes and things like that this is more of an approach on how you would model something rather than working destructively we're going to try and work on a very general case so the first thing i'm going to do is i want to put a curve in there so i'm going to want to look from the top view here so i'm going to hit the space 2 to come to the top view and we'll just make a curve node and with my curve node let's just zoom out a little i'm going to draw sort of an interesting shape for the track here let's turn that into a nurbs and let's close it maybe that's a bit too interesting let's make it a bit more organic there we go something like this so i've got a track that um might have a bit of a shape like that that kind of thing it's quite arbitrary it doesn't really matter too much just pull that out a bit more let's get rid of that one pull that one across just to make that a bit more rounded something like this cool so um that could be anything ideally and like i said before i'm thinking of a tool i'm going to make a tool that's going to be useful so i'm going to make a couple of null nodes so that i know that between here um this is where the tool would operate so i'm going to call this curve in i like to give these nodes a a color i like green in and red for out so i'll just make a pop another null at the end here and we'll call this um track out so i have that at the end there let's just make sure it's an underscore and i like to make these red it's up to you don't need to use colors so our whole system is going to go between these two points really and uh let me just save to make sure that um just in case it crashes because computers do that kind of thing funny enough so we've got our curve in and our system we're going to build so the first thing i want to do is um build the actual track element itself the road part of it once i've got that i can then build off the barriers because i know where the road is once i've got the barriers i can build in posts um at one point as well but the track is the foundation of everything so i'm going to look at some of the uh techniques that we can use to do that with so if i turn on here this is point display there's not many points here and what houdini does best it just deals with points and attributes so what we really want to do is use those points to uh to out of advantage and one of the cool things we can do in houdini is copy geometry two points and there's a few nodes for doing that there's a copy to points node but there's also a sweepstop the sweepstop will allow us to sweep one curve along the points of another but we need a nice amount of points so what i'm going to do is add what's called a resample node let's pop that in here and you'll see instantly this resamples the curve and gives me um so all the points that i want there nice bunch of points going all the way around now i don't like using this method uh by curve length i like specifying a particular number of segments um now let me just hide this it's not displaying correctly let me just um change the scene view there we go that's what we should be seeing so you'll see the resamples re-sampled it to 10 segments if i increase those i can get the fidelity back up again so um let's leave it at this kind of a number here something like 50 that might be good now if i am building a tool later on which we must consider the user might want to control the resolution of the track they might want a low-res version or a high-res version so this slider is something they want to use so what i like to do is when i'm designing these things i like to give them a color that knows the color of where the parameters that i want to change the tool from so this is to remind me which nodes i can control stuff from so here we've got sort of a resolution for that we'll build this into a tool in a moment when i have a few more of those so i said i'm going to sweep something along each one of these points and you can see they're going to be evenly spread now so we need a cross section to do that with so i'm going to start i'm going to start with a line let's have a look at this little line here and we need to make sure this is going to copy correctly and it's going to copy from the origin and what i want to do is actually copy the center of copy this to the main curve here using the center of the cur of the line here so i'm going to lay it down on the x-axis by changing the direction to one zero zero because what houdini does it copies it with the z facing forwards so this will be basically 90 degrees to the curve so i've put it along the x-axis and if i just move the origin back then we can see it's centered and you'll see this is minus a half it's minus half the length now the user might want to actually change the length if they do again this is not centered so i need half of this so that's what minus 0.31 now it's centered so one of the nice things about houdini is we can build a relationship between these numbers to automate this kind of behavior and we can do that by right-clicking here in length and copy this parameter and then in the origin we can paste the relative reference and this page is paste a what we call the channel command ch and this will allow us to refer to another parameter if i put my cursor over the word length you'll see it says parameter is called dist so this is referring to that distance parameter so you can get that quickly by right clicking copy parameter and then up here right click paste relative reference so we can multiply this by minus a half and that will offset it to the center now look the advantage of that is when i change the length it always stays centered so again my user can change the the width of the track and we know that it's going to copy correctly later on because we've uh fixed that behavior here so again i'm going to color this yellow because again the user will want to change that and then let's have a look at how that would work so we can use what's called the sweepstop to pull this together so we put the back burner bone in and the cross section and you'll see there we go it copies that curve from the center from the origin around the other bigger curve and that we can change the length which is basically the width of our track and here we can change the resolution and get a smoother or darker track now on the sweepstop it has another advantage here we can go to uvs and it will actually calculate the uvs for us so if you turn on compute uvs it's created them for us if we do space five we can see that in the uv editor here but we can also use a uv quick shade node to quickly preview how those uvs might look and there we go we can see that they're mapping on nicely around our shape for us they're following the curvature there so again if we increase the resolution see the uvs automatically generate for us so this is really handy and one of the nice things about houdini is these attributes so middle click you see we have this attribute for uv these get passed down the pipeline so everything we should do at least to this track will inherit that so what else can we do with this well let's go back to the line here excuse me let's turn on the points we might want to change the cross section here so let's have a look at that let's look have a look at how we might want to uh change the cross section so what i'm going to do is use another principle houdini called grouping so let's use a group by range node for this let's turn this on it highlights what it's selected it's selecting the primitive there is only one primitive this curve but i want to select points so let's change this to points and you'll see both points are highlighted uh yellow let's increase the resolution of this curve by adding a few more points let's add uh four points we've got two in the middle here now this group by range is selecting all the points that's why they're highlighted but i can actually tell it to not include the first point and not include the last point so it's only selecting the points in the middle here and again this is what we call procedural meaning that we can actually change the number of points and you see it's always making sure the end points are not selected so again you know we can quite freely change stuff and it's not going to affect our tool later on so let's call these uh this group here um we're going to call it let's call it the middle oh middle there we go so we've selected those middle points as a group if we middle click we can see that here middle two so the reason we use groups is if i pop a transform node in for example here in the transform node if i move it i move everything but my all nodes in houdini have this group section at the top so you can actually say we'll only move the objects that are in this group it's like a partitioning type thing so now it's only going to move the things inside that group so now it just moves those center points and it doesn't matter if i change the resolution those center points will always be in the group and they all get moved that amount so this is very handy we can now change the cross section of our track if we preview the track let me turn on the preview there there we go now we can see our cross section so if i just move the y we can just adjust that and you'll see it updates all the way through and we can further refine this a little bit so again the user might want to move that up and down so let's mark that yellow and then we want to do a poly bevel so with the poly bevel i can set this to points and that we can bevel the points a little bit which will create rounded corners for us so that we can get a bit more resolution on the track and make it with rounded corners we could change the divisions and add more resolution on those corners if we wanted something like this which just gives us a better cross-section well it just gives us some control so again the user might want to do that so i'll mark those three things like that let's just move this up a little bit so we can see that the tool begins at that point so again if we sweep that all the way through turn on the sweep node have a look at it when it's uvs you'll see the cross section is exactly how we'd like to model it so that's pretty much it for this uh track section let's put the track out there so another nice thing i like to do is put a net box around everything here and let's call this a track and we can give it a color it's a good idea to give them dark colors so you can see your nodes easily and we know that this bit's finished here our track section and we can pretty much plug in any curve we like and that should hopefully work so let's just work pop in a circle let's make sure this is on the zx plane make sure it's a um actually let's leave it as a nurbs and if i just plug that in now to this null you'll see that generates the track um for that oh look it's upside down so let's just reverse the curves direction there we go and now the track's the right way around we could put something in that to fix that if we wanted to but there you go the curve runs all around there and we can switch back to our own little track here now there's um one other thing we haven't considered if i actually select a point on this curve that i drew and i lift some points up hopefully we can see that at the minute let's lift those up what you'll see here is the track actually is not horizontal it twists it banks around the corner it's a nice effect but it's not quite what we want we want the this to be sort of parallel really and when we start to build the pavements and stuff you know they'll come off at these funny angles we want those to be parallel as well so i just want to fix that so what we can do is create what's called an up vector an up vector will tell us we'll tell this cross section here which way is up so it'll be parallel or rather it'll be perpendicular to that direction so we just want to create that up vector and we do that on the curve here that we're going to copy things our things to our the points that we're going to copy the cross sections to so what i'm going to do is create a point wrangle node to create this attribute have a look at the track while i do it and it's very easy it's um called up and it's a vector so we go v at up equals and we can set a vector by typing set and we just want 0 1 0 which faces up the y-axis now when i hit enter you'll see that the track flips slightly and you'll see now that it's parallel to the floor it's always parallel to the floor it's the bottom bit which is more realistic to a real track there so it's very easy to fix that when you're copying things to curves is to give them an up vector here in fact if we set this to instead of setting it manually here we can actually type in chv and call this up vector what this will do this will create a parameter that the user can then edit if we want to it's gone funny because we haven't got a value in there if i click this magic button though it'll make the parameter for me here and if i put one in the y we get back to where we were but the advantage of this is look if i change the up vector i can actually rotate this around the curve because that's the direction it's facing in so you can have it face along the x-axis there you go see it's trying to face along the x-axis but um here up obviously makes sense so up vectors are quite useful for doing that kind of thing so now we're quite good we can have the track going up in the air and coasting around that kind of business so the next thing i want to talk about is um generating sort of either pavements or barriers so what i like to do is break down my tools into these modular sections now before we do that let's actually turn this into an asset so to do that i'm going to create an output node an output node's similar to a null the only difference is whether or not this is visible whether or not you turn this blue eye on it always outputs this node so it means you don't have to remember to turn it on if you're making a tool which is quite useful because often i forget and that can change the behavior of a tool you'll see what i mean in a moment so the tool belongs between these parts here so i'm just going to select the all these nodes and to make a digital asset or a tool in my in houdini there's two steps the first one is here you've got to click on this cardboard box to make a subnet there we go and i like to give it the name of my asset now so we'll call it um so wb um hang on wb track asset two give it that name and um these inputs here are actually the name of this input here if i hold my cursor over that you'll see it says sub network input one that's actually what's here what we want to do we want this to be the curve in so if i put my oh don't worry about that one if i put my cursor over here now look you see it says curve in so it gives the user a hint of what to do now to turn this into an asset we right click and do create digital asset this will be the name of the asset wb track asset 2. and it opens up this window and it's here that we can create these parameters for our asset you'll notice there's no sliders or anything so we're going to make sliders for those tools so the first thing i want to do is make a section for track here so we can use a folder and we'll call this track there we go and if i go up here you'll see that the folder becomes a tab so we want some of these parameters for our track tab so the first thing i'm going to do is give them this resolution here so we can right click and go um export parameter to type properties here and this will put the parameter for that so let's call this uh res that's the short bit you put for code and this is the uh what the user reads resolution so i'm going to drop that in this track folder if i hit apply and go up one you'll see it's now put this resolution in the folder and look i can actually control the resolution from here and you'll see inside this is now linked automatically that you need to do it through this interface when you're building your assets so here i could actually now build start to build up the buttons the important settings from here at the higher level so the at this level so only the only user can access the bits that are important next thing i want to do is give them the width of this line here so we can actually hold down alt middle click on the parameter we want and you'll see it jumps across to this window for us so we'll call this uh the width because this is the width of the track let's hit apply so again if i go up one i can test that there's the width here so we can see yep that controls the width let's go back inside and promote some more so here i'm just going to promote this y translate so we'll call this um once we call this let's call this depth so then the user can pull that up and down the depth and then on the bevel here um what we'll do is we'll give them this distance so if you look oh where's the bevel so if we do that we can kind of soften the edges um what else can we do with that we can do the divisions we'll leave the divisions down low and just let them control the distance here so we'll call this soften or something you give it back names if you want to soften soften there we go let's hit apply so if we come up one now we have all these parameters so that we can change the depth push that up and down we can soften it here we can change the width of the track and we can change the resolution of the track as well so we've promoted all those interesting parameters from inside here and given the user those controls so slowly we build up our little tool so again i'm going to make another null now we're going to talk about making the pavement all the barriers i'm going to call this barriers because i'm just going to go for barriers we can always build in extra behaviors later so call that barriers in so again i like to color these a green color so from the barriers um what i want to do is actually i'm going to build them off again by copying to points or sweeping and i'm going to want these sort of points at the edge here i don't want this in a geometry i want this outer curve and this outer curve so i can build geometry from those so when we can do that with a split node if you remember before on the cross section i selected the points in the center here that attribute has been carried through if i have a look on this information you'll see that these middle points have been carried through there's 932 now because they're all on this outer edge with a split node we can actually choose that group and if i invert the selection you'll see it's just kept the points that are in the that group which is this outer edge which is really handy because that's actually what i want to use to generate um the other bits that i need but i needed to generate some uh data on these so basically a direction on them and for that i need some geometry so what i want to do is actually turn these points back into curves and for that i'm going to use an add node so the add node is very very cool you can actually go to polygons by group and you'll see it joins everything up based on an attribute it's doing the point number so it's doing point zero to one to two to three which zigzags like this i don't want to do that actually but what i want to do is actually separate them into each separate curve now again if we go back to our cross section let's go all the way back to the cross section here still on the point numbers this is what we're uh copying through now remember i said the attributes get copied through the sweep and everything else what i want to do is give each point a unique attribute so when i copy them later on the whole line of points will have the same value and the ad can use that to join them up and if we look at the point numbers here they're fairly unique so i'm going to use that so i'm just going to create a point wrangle just after this and i'm going to steal this point number i'm going to use an attribute so let's do integer at id let's call it id it can be anything you want and then i pt num which is the current point number so if we come down to the sweep now here what we can do is visualize that point number should be able to click on id here that id there you go that visualize is now showing up in color let's um edit that visualizer so let's do this as a marker let's turn off the point number and you'll see each row has the number of the original point that made it this is 0 1 one two two because these came from the same point we beveled it and there's a three but they're all unique that's the important bit so if i go to my ad stop here i can say let's do this by an attribute and let's do it by the id attribute that's actually coming all the way through there's our id there's our id so yeah there's all zeros those are all ones and there's the add not doing its thing so yeah i don't know why that's not behaving itself i think that's not drawing properly to be fair so yeah if we click close we can close the shapes it's drawing that properly now and you'll see that we've got our two curves let me turn that visualizer off there we go you can see we've got our two curves going around the geometry here let's turn off the uh a bit so they follow around so what we don't want to do we don't want this closed so we can use an ends node to actually open it up into just the two curves that we want so we can set this to unroll with new points and you'll see now that we've got our two curves running around our geometry there which is exactly what we want and then what i'm going to do is i'm going to copy or use these as the foundation of the barriers by copying geometry to them and again we can change the cross the reason i'm doing it like this rather than extruding it is so we can change the cross section again using the same method we built for the track so um i'm just going to middle click we've got 468 points often this doesn't close properly we're kind of fusing a gap so i'm just going to create a fuse point just to make a fuse node to make sure we're merging any vertices that are on top of each other if i have a look now you see we've got four six six and before that we've got four six eight so we've merged two vertices so these are definitely closed now so i just wanted to make sure that that was happening so what i'm going to do now is create an assemble node this will create groups based on the separated geometry so if i turn on create groups and call these curve you'll see i now have two groups one for curve zero and one for curve one so i can separate these two curves out again using groups and then we'll use our split node to split that up so if you put one of the curves here that's what you'll get out one input and out the other out output you'll get the other curve or the other what's not in this group essentially so let's create a cross section for that so let's make a line again and uh remember how i said the line gets copied from the uh the origin here let's put that along the x again but this time i'm going to leave it with the point at the origin because i want it to copy out from the curve not from the center because my track goes in if you like the track would come down here and this would come out to make the pavement so again let's make that quite short and let's color that yellow because they might want to change the length of that and if we just pop in our sweep we can see what's going on let's pop that into this first input there you can see how our point is getting copied to our sweep there so that's not really uh working as we expect because it's um being rotated again we need the up angle so that up vector so if you remember i made this point wrangle up here let me just copy that one and we'll just paste it up here so it gets copied into both curves and there you can see that that's getting copied parallel to the floor again because we popped in our up vector so again we can create uvs for this pavement by turning on uvs in our sweepstop the advantage of using the sweepstop and if i just template the original track um where is it there it is so there's the original track let's just uh template the sweep we'll see that that's gone very very large for us let me just bring the length down now you'll see it's actually gone the wrong way it's going over our track that's not actually what we want let's just pop a transform node in and we can flip this 180 degrees over oops sorry now i want to flip the line here actually so we'll flip the line here 180 degrees so it goes around the other side there we go so now that's attaching on one side like i wanted the problem with doing that is reversed but here we can just simply reverse this cross-section so it's the right way round obviously i want to repeat this process on this other branch so let me just make a copy of this sweep and plug the other branch in now this other branch we don't need it flipped let me go let me just not have the transform going in there so that now we have both bits of track here pavement and we have the track in the middle and they're all joined off each other if i come back to the original curve which is all the way out here oh hang on we can't see everything let's just see if we can see everything together so what we can do is add a merge node we can just merge both these together so we'll see both tracks here and then what we can do is just bring this down there add another merge node with our track and let's just merge in this as well so now we can see everything together there we go you can see the track with the barriers if i click my curve you'll see again as we change this everything updates and it keeps that modeling as we want so this tool is quite getting much more robust now so a little thing i might want to do actually is turn these into actual barriers so again let's do a pulley extrude node and we can do this after we've merged them all together let's turn this back on so the extrude if we don't if we'd say individual elements we can inset them in a little bit to create these kind of uh little shapes like this and if i turn off the sides you'll see we get these little inset blocks so they can control the gap between them so again the user might want to control that so again with another pulley extrude we can take those little blocks and pull those up again this doesn't create the under geometry if you want that you can turn on output back there we go so we've created little boxes for those and we could do a poly bevel actually so they might want to create some softer edges on there so we're gonna do a little bevel there we go something like that and then we can do a uh a uv unwrap just to create some nice uvs on those and if we pop in a quick shade we can just quickly see what we've got let me pop that into this merge so we can see everything with the quick shade turned on there we go so the problem with the uv unwrap let me just color these yellow is that we're unwrapping we're projecting onto this whole shape i want to project on one cube at a time so we could quickly put in a for each loop in houdini so i'm going to do this for each connected piece so this will work out which pieces are connected to each other basically each individual block and then this will just do the uvs for each individual each individual block one at a time rather than the whole lot altogether so if i just change that now you'll see we loop through each one and we get much better uvs per cube in fact they're all the same so just need to map one of them so again we've um created our little barriers here and we've got lots of control for that so again we could just run this into a little net box call that barriers and then let's just give that a color and then let's promote some of these parameters so let's create another folder here let's call this barriers and let's promote some of these parameters so this would be a width of the barrier remember that was the line length and then here we have the inset um so we call this gaps so there's the gaps between the barriers and then uh this was the height let's call this the height and then this was the bevel so in fact we could add another folder in there and then put these inside that folder let's call this bevel that folder and then we've got the offset so if we go up one now we'll see that we have our barriers now look there's a tab inside for the bevel so again up here we can adjust the width of those we can adjust the gaps between them we can adjust the height of them we can adjust the distance of the bevel and the quality of the bevel with higher rounding or less rounding subdivisions it's a bit slow i don't want to do too many so there we go we've got lots of extra control at the top there so let's put our little null at the end so we know that we're finished with that and we'll call this um barriers out so and i like to give that that red color don't i cool so we've got those barriers so the last thing i want to do is create some posts that go to the floor here so what i'm going to do is come back up to this merge do you remember the merge this is where those original bits of track were i want this geometry for a certain for a particular reason so i'm going to pull out a null at this point again so i know that my next bit starts here so we'll call this um posts okay and i like to make that a green so again we're going to split that off into the two curves because we kept our groups that should be easy so we should have curve zero here and then curve one coming out the other output here and what i'm going to do is i'm going to create a poly frame node now there's a reason i want to do this which will come clear in a moment if i turn on the poly frame node it calculates the normals here which is just going straight up or based on the curvature of the geometry i don't don't want to do that what i want to do actually is uh calculate the tangents if i put an n here you'll see i'm calling the tangents the n tangent and what i'm trying to do is um basically the point on this outer edge again i want the outer edge points um i want that to be straight outwards let's set this to first edge and you'll see they're a little large if we tap d for the display here we can change down our guide length scale the normals right down so we can see those in there there we go what you can see is these points now are facing 90 degrees to the plane there the reason i did that is to put in a um peak stop if i do a peak stop here let's not recompute the normals and if we do that it pushes them in the direction of the normals and you'll see that can push it out or inwards so now i can move the posts 90 degrees to the track in and out so this gives me the sort of the depth or distance for the posts a bit you'll notice this is a negative number there let's do the poly frame for the other one so let's plug this into the other one here and you'll see this is on the wrong corner i need it on this outer edge so i'm going to do that as the by tangent here if i turn this on and call that n there we go you see that's on the edge that i want it to be now and this peak will actually be in a positive number because it goes in the direction of the normal so that that wants to be a positive number this one so what we can see is these two peaks actually want to be the same number just one negative so i'm going to let the user control the positive one so we'll copy this parameter and on the peak here we'll paste relative reference so now let me just template this one as well so if i just change this value you'll see that we radiate out the way that we want let me just merge those two together just make sure that's working so is that one working we got our original track there that one's there so that peak oh yeah sorry this wants to be times -1 so it's negative that's what i was forgetting to do so now that one will push outwards there we go let's turn that turn off the normals so if we adjust this uh peak here you'll see they push closer and further away from their original position so z was the original zero was the original position then we can just push those further out so i'm going to keep them in their groups what i want to do now is get rid of the end point now if we go back to our um cross section which was where was that that was here this line if we go back to this cross section of the barriers remember i'm copying this point to the original curve and this is the outer edge i want to keep this outer edge so i'm going to make a group for that just make sure that both of these nodes are connections are going in there we'll call this end and uh this is the uh a point oh don't have to press caps end i can't spell it there we go i want to make sure this is a point and what i'm going to do is oh so i want to group by range actually wrong one so group by range let's just pop that in there we go got our points we'll call this end because it's a single point here and we're going to not select the n1 so we're going to keep that one which we'll get rid of and then we'll keep those at the end so if we come back to here if i put this blast in and we choose that end point and we say delete non-selected so it'll keep the outer one you'll see it's kept the outer one for us on the track and again we can do this on the other one we look at our original um geometries there actually wanted it the other way around we want to keep the outer one there we go so we're keeping the outer one here and if i adjust the peak now you'll see that point can go in and out 90 degrees and this is what i'm going to copy my posts to so again i'm going to use the group by range again because i might not want all the posts everywhere so in this group by range i'm going to call this uh delete me and we'll set this again to points and you'll see it's selected every point but down here we can go select every say three of four so we're selecting every three or four leaving every fifth which is what we want to do we want to delete these yellow ones so that we could delete every two of three which again leave single one so there's a relationship here so i'm going to take this copy parameter paste relative reference here and then add one so we're always selecting uh two of three or three or four and i can increase that and it's the blue ones we're going to keep so i can filter down so again we give the user control of that so we can filter down uh the parameters that we want i want to do the same on the other branch now instead of doing the check expression we can also right click go to actions and create a reference copy this will create a copy of that node there we go but with all the everything connected for you look it's got all the expressions in there so they're identical so if i now um that's going to make our groups for us if we now create a blast node and i say uh delete me there you go you see we just keep the ones that we weren't in the group here so as i bring this number down we can have it all the way back to all of them or just filter them off but we've got them evenly spread which is what we want next thing i need to do is copy my tube to that so let's create a tube for our posts so guys that's a little on the large side so let's bring the radius scale down and the height down so again this might be something the user might want to do so let's create a polygon let's create some end caps and i'm actually going to light down the z-axis because it uses the z-axis again to copy and it will do it from the origin so what i want to do is offset it so this end zero on the zed so for that i can use a match size node so the match size uh you can do all sorts of repositioning here i'm going to move the z axis to the minimum of the bounding box there you go so you'll see this points off in the positive zed because that affects how it will copy when i use the copy to points node so i now use a copy to points node you'll see it copies them all the way that all the way down there um what we need to do is create a uh poly frame node i believe yep oh uh yeah a uh no that's right i want to set the z upwards let's do this on the y-axis and let's set this to no center and justify that to minimum there we go on the y-axis so this gets it sitting bolt upright on the y-axis so we build it on the y the match size offsets it to the y bounding box and then we copy that to our curve there and you'll see it's facing up 90 degrees as we go all the way around but we've got a couple of funny ones there so let's create an up vector again put that on our original curve because again the copy uses that so we'll say v at up equals set zero one zero there we go let's fix that a little bit there's my group by range oh let's plug our blast in there we go that fixes it forgot to wire the blast in so there we go so now we're just copying our points to there and we can adjust the height here we can give the user access to that so we've got the height of this so the last thing i want to do actually is i just want to grab these bottom points here so for that i'm going to use a another group node and again we'll grab these points we'll call this bottom so we'll turn on bounding regions and you see we get a bounding box so i'm going to shrink that right down so it's just around these bottom points here and then what we'll do is we'll add a transform node after the copy oh sorry not a transform node a wrangle node so in the wrangle node i can tell everything's at p dot y everything's positioned in y to be zero in other words all hit the ground and what you'll see is flattened all the points of those tubes to the ground but if i say just do it on that group of the bottom points here you'll see it just pulls the bottom points to the ground regardless of where the track is let's lift the track up a little bit let's go back up to our original up here so let's just pull the track off the ground a little as you'll see there it will then generate all the points to the floor for us there we go so now we've got our posts with a fixed height above so here i can adjust the height above but they always go to the ground to ground our thing in there so again let's make a null for this and call this posts let's color them red and what i like to do is create groups for these things so we can use that later on so we'll call this group posts and we'll just copy that group node paste one over here call this barriers well let's put that up there so barry is and then uh the last one for the track let's put this one up here and we'll call this track it's always good to have groups in houdini so this last little lot here if we just tidy those nodes up create a net box we'll call this uh posts give it a funky color just to make everything the same as before and again oh we want some uvs on our posts we'll do a uv unwrap just pop that on our single tube so that gets carried through all of them we can merge that in and that we can see with our quick shade there's all our posts and everything all building all as we want and again if we come up here and just change that curve you'll see everything is just generated it took me a little while to build the system but now i can just plug in a curve and i could plug in a circle and it's just going to build my track for me and i could plug in any kind of curve and make suddenly lots and lots of uv'd um tracks very very easily so last but not least let's just promote up these uh settings parameters here for the user so again let's make another folder let's drag that up to the root so it is not inside the others so let's call this posts so um here's the peaks we'll call this um offset so obviously the names can be whatever makes sense to you or your user so here we'll call this a post prune because we're kind of pruning the numbers off post prune um where other where we go there's the post settings so actually let's make a another folder for that and call this uh post settings make sure that's inside the other post group and then on the here we can give it the radius height and scale and we could promote other ones like the resolution if we wanted i'm not gonna do that for now um is there anything else that we needed here not really i think that was it and remember we're always out putting this output node so if i think that in there we'll see we're now outputting with the uvs so we'll leave that off for the minute leave the output out there so there we go so now i've built my uh tool so the useful thing is this has become what we call an asset so if i hit tab you'll see in assets there you'll see my tool appears and then i can plug in another version and i've got two kind of tracks if i just merge them together so we can see them at the same time so let's just pull that one over there oh that's not a merge node there we go and then i can just keep plugging in lots of different curves and i can generate lovely lots of uvd um geometry very very fast so now you know in the space of an hour i built a tool and then in the next 20 minutes i could generate you know 50 different tracks whereas if i was to try and do this in maya even with all the wonderful tools in there um it would take you a time to sort of obviously model all this by hand oops sorry ella i've just seen your question there what does the blast node do the blast node is the same as a delete node just with out half the buttons you blast away the geometry so it's a delete node without a lot of the settings to keep things simple so one last little demo i just want to show is once you've now built this tool you can use it in your other dccs for example something like maya here so that i could actually load that asset in maya there's the asset i just made here's some curves already drawn in maya and again look we can just set to selection and there's my track in maya and that we've got the settings here those tabs become these folders there's my posts and barriers and track and i can change the resolution can change the uh width went to the track we can change the depth remember that push the cross section down we've got the soften change the width for the barriers the gaps between them can make them higher and slower and at the same with uh maya same with houdini as in houdini look we can reload this another instance of that asset in and again if i load that in we got that wrong curve i actually want this other curve there we go set to selection there we go now we generate that around that other curve we can just pull things around and you'll see it just generates fine in maya too and this will work in unreal and 3ds max as as well so it's very very handy to build these tools and the foundation is that what we you know we call this procedural modeling and essentially what that is was building in all these behaviors you know linking the things that i needed to together here building things off other things so everything's indeed interdependent you saw using the ch expression and making copies of the same node all to make sure everything was um coming through the pipeline in this kind of procedural manner you know so you can literally just plug a curve in and the tool does everything else you just got a few sliders to change what you're doing and it's quite fun designing these systems it's obviously a little more effort than just modeling it so i would say if you were just modeling one track or even two it might not be worth building the system but if you know you've got a model 50 or 100 it's certainly worth building the system because then you can kind of automate it and let it go and then you can reuse this again and again or modify it as you can saw we could add lots of other features quite easily to the track other details you know we could build that into that tool and it really is that flexible and the fun is as you saw you can run it in other software very very easily like maya the other advantage uh what i did the reason i made those groups is look those groups come through in maya look there's my barriers group so if i just select the set members there we go i can shade and apply shaders now in maya to those geometries so let's um go back to uh face and let's assign a new material for example so it's easy you know you can access to do your shading in maya so there's all the barriers so here i can uh grab the track here so select set members let's make sure we're in face mode don't want to select the cvs there face mode and then here we're gonna do face mode as well just make sure we've got both bits of geometry so it makes the actual geometry here for you so um it's probably because we've got two instances of it there select set members so face face there we go so the sign a new material let's give it a different one yellow color there we go so we can apply different shaders to the parts because the groups came through from houdini here excellent so hopefully that's given you i did quote cover quite a lot in this uh in this demo um i did want to sort of show how fairly quick it is to sort of build a system uh that's not true actually it took me a while and a few problems to sort out when i built this system but you know it's quite easily done you always hit issues as you go along but you can see the structure there start with something basic like a curve i've got one system that builds the track another that builds the next bit something else that feeds off that so everything is linked to everything else and that's kind of what we mean by procedural modeling i think at least is building these sort of agnostic systems that you can just plug in you know whichever um you know cur type of curve you want and do the rest and you could build uh uh settings in here so the user could plug in their own geometry for the posts or their own geometry for these barriers rather than the tool creating it but that's up to your imagination really so hopefully that's given people an idea on um procedural modeling in houdini and how you can generate lots of variations of something quite complex very very fast once you build a system and that's what procedural modeling is you're building a system you're not actually building the geometry you're building a system to build the geometry a machine which when it's reused is incredibly powerful
Info
Channel: Escape Studios
Views: 1,472
Rating: 4.9200001 out of 5
Keywords: Escape Studios, Escape, studios, VFX, Visual Effects, CGI, Maya, Autodesk, Nuke, Foundry, I want to learn, tutorial, modelling, rendering, dynamics, texturing, animation, renderman, compositing, ncloth, motion graphics, design
Id: fdG0ZD8lDS4
Channel Id: undefined
Length: 56min 2sec (3362 seconds)
Published: Thu Apr 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.