Houdini Railroads - Part 1: Basic Parameters & Attributes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi and welcome to this first part of our Houdini railroad series in this series start with creating some attributes over our curves and then create a basic parameter interface so you can play around with what we've created so without further ado let's dive into Houdini in Houdini we're going to start off with some curves but first we have to create a geometry now in our geometry node I'm going to create my first curve and I'm just going to set some basic points and this will create our initial line right now that is a line of 50 units or 50 meters I want to test my to auto mode for curves so I'm going to create another curve and I'm going to create more points that we can actually switch let's see what we're doing on different curves I'm just going to create some random numbers you can see we have a different setup we have a line or occur goes both up and D y-axis those in the x-value I mean this Akbari so we can check our curves then I want to easily switch between them so most convenient thing is just placing a switch then what I'm gonna create a null node and an output node and how point node is really convenient because they will always put something out when you put it into the second and as you know we do Chi we use our own format of colors and shapes or nodes so I'm going to set the shapes and colors to the corresponding format then there's no I'm gonna call this money in her and for now I'm just gonna call this out all right we don't need to visualize note what I'm gonna do is I'm gonna create a subnet and this supplement is going to be eventually it's going to be our final HDA so we're just gonna call this train track gently and I'm jumping in as we can see we have three notes that we don't really use we color them dark grey so when I look out on any other nodes looks like there's no input there it's just my own way of saying okay these are not connected at all all right so the first thing that I actually want to do is I want to create some attributes create a subnets [Music] place that right after in cooker and color this dark green coldest initial tributes I'm going to copy this input curve download these gray again paste my inker here then a hit L so everything nicely gets displayed turn up to colors because we don't really need that first thing I'm going to do is I'm going to create a attribute delete and relearn why I'm doing this is because in programs like unreal or other programs where we can use our Houdini digital assets or HD ace that sometimes we can pretty annoying attributes that can mess up whatever we have and I want to create all those on my own so I actually have control over them that's the first thing we do then I'm going to create a resample node that's a first resample node then you're going to create a second tree sample node and I'm gonna set this secondary central node to about one unit length put this one to subdivision curse so what we get right now is look at our lines and let's switch to second line you can see our points turned on at the moment I dive in here every sample we get a lot of small points then I resent what again and then we get these points so now what I could do is using the first three samples treat polygons ass I can change the flow using this very small segment length we can actually create more points a better curve and here I can change what type of curve it is and then after we've done that I resample it again but using subdivision curves again so we get a nice smooth shape and that's exactly what we want for railroads next thing I'm going to do is I'm going to create the pulley frame using our poly crane we're going to set our tangents to be enormous basically what that does is it creates a normal alarm occur and that is very convenient for placing assets on our curve so turn on my points normals and zoom in to zoom in quite a bit can I see it you you it's not showing at this point chest is enormous so now you can see very small we have normals pointing from our thanks so if I was not to do that we don't have any normals here then using the photo frame it actually points to the next point which is very convenient alright so after that all we have to do is are creating our up attribute and that's to make sure that we always have our objects facing up while we're making curse so you don't get any unnecessary banking or whatever just create up to remember that it's a vector instead of growth we want vector we want to have it coming up so one in the Y value now finally I'm creating a another node or it could actually create a how could note as well here I set this to her own standard color and I'm gonna call this out since this is still on a curve is an initial curve all right focus a little bit so we have our initial attributes and that's good you guys from there on we can actually start creating some cool stuff so let's start off and create another subnet and I'm gonna call this we're gonna color this light green so I know just containing our geometry coma college experience again the same thing we're diving in coding the last two three input notes gray so you don't have anything there the second thing I'm going to do is I'm going to create a control node so another node and I'm gonna call this control color this nice bright color change the shape to a circle now we have our control node and the first thing that I want to do is in this parameter interface I actually want to create folder make these ones invisible because we don't really need them this is gonna be our curve settings now I have this mess simple so if I were to set this to say taps usually the default to get a nice tab if I said it do it simple it will disappear BAM the reason why it's disappearing is because there's nothing in it the first thing we want to do about our curves we actually want to say okay so it's nice that we have these two resamples the first thing I want to be able is to select this we'll get an error we try to drag this one in like we usually do since it's outside of our subnet which makes sense so what we're going to do is we're going to recreate this I'll go to the ordered menu put it in there we're just going to go to type for now type all we are going to go into our channels I basically always want to have it at the subdivision which is the second include 2 so 0 1 2 1 and then we're just going to recreate with its ass so 0 is going to be our straight I just I'm just going to type in straight and the second one or number one number one it's going to be subdivided and our last one is going to be interpolating apply now if we go back out we go back out I check our control note you have a nice note you can see pressing control middle mouse button we go to our default settings which is neatly subdivided now all we have to do is copy this parameter go into our attributes literary sample paste the address of reference cross this one down and if we look at our control node which is right here you can change this I'm looking at our curve you can easily see setting this you still have a nice division of about one unit going straight and you have that subdivision curve types so really nice okay so I'm gonna add this one in here and we're going to start off with our rails so again the first thing that I want to do when I'm creating my initial rails here so I want to create our input curve node based on here it L so we can organize layout all right so we got our curve what I want to do is I want to create a line set the direction to one then I want to sweep this line using sweep then what I want to do is I'm going to make sure that our lines in the middle because we usually want to generate from the middle I'm gonna grab my length and paste that relative reference in here and we'll give this a negative value then I'm couldn't divide it by 2 or multiply by 0.5 it's multiplications are faster we get nice flow in here that's pretty nice gives us a view what the sneakers would look like but for now we're creating the rules I'm gonna group whatever it is that we have right now and just for the sake making everything clear just gonna call this group track with all right so you have our group it's nice then I'm gonna use the add node I'm going to say polygons group skip every endpoint I'll show you why right now it's going to go over the point point point point point skip we get a nice line along the curves now it's important that no time if I'm leaving to change say time on the points here they're missing them so just to make sure that doesn't happen I'm gonna say base guys difference there as well so the same value but for now to is fine and then using a blast load and the book that we created which is this group just gonna hit ctrl-c ctrl-v the moment i hooked it up together a nice output the cool thing is by using this line right now just by changing the length you can actually change the width of our tracks and that's pretty much what we need but just up in one set of tracks is not really that cool you're gonna create some preset so our first line here and for now just to show that we can actually change set this one to 0.5 here I'm gonna set it to 1 on this one I'm gonna set to 1.5 crates which are linear if you do some research to tracks you can see that we have a lot of different gauges engaged is basically the width between the two tracks so now I'm gonna go view this one I can actually change those very easily so let's add that to a train track control node again per meter interface and create another folder then this simple one this is going to be our shrink settings or let's actually call it real settings because the whole thing is called a train track that's multiple things and we want to just create settings for reals fine okay and again we actually want to have another ordered menu in this menu I'm going to create some presets so this is going to be our rail gauge let's just call it gauge channels usually there's three or four main gauge checks we're gonna go from first value which is narrow the second one it's medium and the last one you would say large what's actually called standard all right so hit apply now we have a nice thing for this as well I'm going to send to one medium usually the track that's nice and in between and why we actually want to be able to control those different values so what I'm going to do is I'm going to create a float keep that one right here in our flow channel name parameters and I'm gonna call this narrow page and I'm going to use to keep duplicitous change narrow standard and medium hit apply now you have three values doing a little bit of research we can see we have a lot of different values and usually the gauge types are based on a country so it depends on mostly on the region it's an example in Russian where should they have different gauges as across Europe and the states they have different sets again and then in Asia they have different sets again for now we're just gonna use these values and narrow gauge I'm just gonna say that our values are going up to say 1,000 so 600 to 1000 narrow gauge range it's going to be 600 to 1000 we could actually set on a narrow gauge to gauge and then just say millimeters I'm just going to do that for all of them look the values because I don't want to go over them just want to be able to switch between them and the same goes for the other ones but I lock all of them we're going to look again at my values I'm seeing 1067 1435 and then for the last one standard gauge okay so I did that now all we have to do is set our default values you hitting except now you can see we can actually change our gauges but I think that we're still missing second activity here it's coming copy do another let me back into it rails in our curse so this first one length pasted relative reference and of course it's now is going to be way too big so we're gonna multiply this 0.001 that actually gives us our value in meters so can do the same thing just copy this one a second line instead of an arrow in the medium the last one or standard alright just gonna hit tell so we get our nice layout here now you can see when you go up look at our rails using our control node I set it to narrow kitchen use this site so it's a medium well it's not working you know why we did nothing I'll do this parameter yet into our switch node now it's working so again control change this size finally standard to change this size but I don't want to have these three gauges here I'm going to go back to our turn the interface this one is called rail gauge copy this in our gauge with just going to say hide one curly brackets type the name of our parameter you can say if it's not equal to a first value is going to be zero and then we're going to close curly brackets so what this does is it hides it when it's not zero which is convenient because we have multiple colors except for medium energy the same bit since this is our second inputs call it one multiply and then our final one either when it's number two or third input unless you see now narrow one shows up medium second one shows up standard last one shows up alright well that basically does it for initial curve of our or rail so we're gonna continue but you actually know that we might be able to use these curves later on so when you create another no no I'm gonna call this out check lines and using our conventional coloring and say this is not the output node of our system still pointing it down okay well the next thing is that what we actually want to do is we actually want to create a nice shape that we can sweep along or occur you get a curve and I'm gonna go in art let's say front viewport and zoom in really small a very small unit I'm also gonna create a box just like I get it sense of feeling of the size and let's say how big would a real track be for now I'm gonna go with 20 centimeters tall by 15 centimeters wide okay so now when I'm looking at our box here make sure you're gonna say move this up a little bit so we actually have a nice zero point here okay now I'm gonna grab my curve enter you can actually draw I'm just quickly gonna draw this by hand just the general straight I'm really not paying too much attention to what I'm doing actually so don't worry about into symmetrical art that I'm creating all right we do need our box and then we have our very beautiful shape of what would be the cut ruler side view of the track all right okay sweet note this is gonna be a cross-section in our back bone and now I go back turn off our points until normals are sweet and saying are how to skin we get our beautiful curve I already creates quite a nice shape but what will be cooler is if you were to do a castle just in front of the sweep and we remove our inclined points now what is dust by look at our initial curve points again so you can see it a little bit better there now all set to the value of one which is fine but if we actually want to remove our inclined points up this value a bit we can see that on straight pieces it doesn't create as many points and for our real that's perfectly fine because it will create less polygons without actually affecting the shape too much which is super convenient as you can see still gets generated quite nicely still open on the ends so we're going to do is just create a poly cap which is a poly fill it up we have our ends now that thing that I don't really like about doing it like this is that we do the whole thing in one go and I'd rather create a for loop so we're going to say for each primitive and I'm just going to put this up here so it's going to go in here then you can see when we do a single pass we actually get our single real the cool thing about it is that because our curves are not entirely bent the same way this facet will go over each curve separately and then sweep it separately and it's a lot more convenient for us we're going to hit elegan so we get our nice layout you turn this off from single blasts of meat virginal iterations all right next thing I'm gonna do is I'm going to color our stuff so we actually can do some color coding and for now I'm just going to color this one very bright red you can immediately see that the color that we've given it's not really close funny when I read it has a bluish hue basically shows that our normals are wrong or another way that everything is pointing inwards so you just place the reverse and then place our normal mode you get our nice red color perfect we're going to create a group node and this is actually going to be our output node as well so we know there are settings color and shape and I'm gonna call this out rails don't actually want to call it good - so we're just gonna call it the rails all right getting elegant now we have our nice set up right here perfect so obviously the second thing that we need to create our sleepers and I'm gonna do it again I'm gonna create a subnet and color it green cuz we have geometry in it I'm just gonna call this C neighbors again I'm diving in following these that are gray and this is just a format that we're using of course you don't have to use that it's gonna copy this one again place that in there l got a nice layout and then here I'm going resample the reason why I am recent when this is because I actually want to set the distance between each sleeper and I'm going to go for supplication close the distance that we have now it's not locked up yet so hook it up in there so this is our initial curve our nice points in a recent bone this is way too much so if you actually do some research obviously you have different types of sleepers we're gonna come to that a little bit later for now we're going to focus on the first one and that's a wooden sleeper and in our wooden sleepers distance between each sleeper usually is a set distance that's actually 90 centimeters so we can very easily resample this now we have our sleeper points so just be very convenient there oh yeah I hope to do is create a box I'm just going to create a box but you could use your custom sleeper in here so you could have say an art is created in Maya whatever with all the nice textures and everything unique just import that here then I'm gonna say copy the points I can instantly that's easier now and a lot faster and as you see it's completely messed up the reason why is very simple you have an exact this one yeah the average size of a wooden sleeper actually have some pretty big sleepers it's about two and a half meters 2.6 actually they're not that tall about 15 centimeters and then again 25 centimeters weight so you can see these are pretty big we actually wanted to say that this value whatever this one is taste relative just kind of divide it so whenever we look at it it's nicely on the floor however if we look at our train tracks right now and we were to merge them you look at it doesn't really look too cool now does it that's because there are not on top of each other so what we can do is we can go in our rails and we could have our curve that's a transform before the sweep it's important that you vary transformations before you sweep and then in this value you can actually go through the bounding box so they're gonna say bounding box we're going to look outside of this net and we know it's our box right now I'm gonna set it to my box then I want to have the maximum value the Y max closing it and now it's giving us a zero value once giving us an error what is the error it's a bad no reference so apparently I made a mistake bounding box sleeper box size my D max so what we can also do just to make sure copy this parameter okay I'm really stupid sorry for that we actually want the value of the entire box you don't need it's why size flexpays and you can see it moves it nicely up that's when you will team up with expressions as you can see now places it nicely on there and turn off my points and I really start to get a really nice curve and if you go out there and you grab our switch focus on this one you can see it works on both curves cool next up let's create some parameters so we know that like I said before we have different types of sleepers and in just a tutorial I'm just going to give you too much good right I'm just gonna copy this one and I'm gonna make it a little bit smaller 2.5 length and width is going to be 18 as well okay so we have our wooden sleepers here and I'm actually going to create some concrete sleepers and if you don't know the difference you can search online this is the basic wooden sleeper that I found online and then here we have an example of all three different types of sleepers that I could easily find online so you can see we have concrete sleepers some steel sleepers and with wooden sleepers wooden sleepers are generally pretty far away from each other compared to our concrete sleepers so the distance between our concrete sleeper is actually what makes it so different so that means we need another reasonable mode in general the resample size practice right in here for concrete sleepers is about 65 centimetres set that here then again copy your points and instead of this one this box instead of this resembles this resample so placing a switch note we can easily change between our concrete Supercenter wooden sleepers and going to color them again clerk and for now I'm just going to turn off I can instance such next week lower them a little bit better I'm gonna give them a bright color as well it's a bright orange yellow kind of color and another group note which is going to be our output node in colas sleepers I usually name the groups that I knew all in capitals just feels easier and what up there we got it we're going back to our control notes change our pin another interface create an another folder gonna call it secret settings apply create another ordered menu I really like these see using a lot it's like being there's a matter of using force which knowledge understand it's easy to give you input value right so these are going to be our types so sleeper type et crater menu wooden one values can be concrete that we could even say okay eventually if I want to go on I want to create a steel except copy grammar cleaner sleepers switch now paste relative reference and now look here zoom in a little bit you see we missing our normals now you can see easily you can switch between our gauge types we can choose our different types of sleepers that all looks good and the next part of our tutorial is going to be our ballast so I'm going to create another subnet and you don't necessarily have to create subnets you could also just create like these codes on there they're called Network boxes but I just find it convenient to have something that looks like a really small system just for my own overview okay so let's call this ballast and we made you get error because oh my god no not everything is in there doesn't matter alright so again okay no no call this in curve look it up call it shaper alright let's create some ballast first thing I'm going to do is I'm going to create another facet node and remove the inclined points as I don't really want to go over all these day details too much I'm just going to copy this parameter so I only have to change it in one node all right perfect and what I'm going to do is I'm going to create a grid I'm going to turn this on right now you can see not really going to gonna create a sweep so you can actually see what's going on alright let's say in our outfit you wanna skin unclosed and there we go really messed up so what we're gonna do in the grid gonna set the rows and columns to one plane I'm gonna set it to XY okay now for the sizing it's kind of important that we get it fairly right I'm going to say three meters wide three meters light and we only want very small going up about ten centimeters right now we need to give the feel that comes out from the ground but it doesn't really need to be that yeah okay then for our general reference again gonna say general reference break it and then we're gonna have our size Y value and we're going to multiply it again by 0.5 well did I make a mistake yes you're gonna break it there we go okay so now we got stuck here nicely on the floor I'm going to do is I'm going to transform the points 0 and 1 point so gonna happen 0.8 right now you'll see later why go causing it to surface the points nothing works okay I'm gonna create a larger transform and that's gonna be to entry and end points this is gonna be our with not sit it's also cool done all right and this is going to be our height create a polyfill screamer endcaps normal in color and then of course our outputs which is out ballasts well you actually want this to be at our normal and you can see nice blue color in our ballast it looks like it's upside-down but that's because I'm going to create some parameters for this just look at this one from our control load here and create another hole here again simple and we're going to call this art balance settings I want to be able to choose if we actually won ballast anyway because if you look at a lot of reference she sometimes seed especially with concrete sleepers there's not always balanced you're like having an urban region it's placed on top of big concrete bridges usually there's no balance I actually want to have a double I can say okay do we actually want to have ballast or not for now I'm just gonna call this 1200 as well then the second thing I want is I want to have to float their art ballast with and our Venice high it apply as well okay now what I'm gonna do is I don't really like this interface setting so it can lose this horizontally join the next parameter just nice because it puts there but this looks really bad then I can just turn off the label all right now I can turn this off along along these wants to work as well I'm gonna do in here so I'm not gonna say hide like we did before just gonna say disabled when ballast underscore toggle equals zero so when it's zero we have it disabled now when you click this actually show up which is really cool all right let's turn this on we actually want spell us now have some parameters that we can use for our height I'm going to set this one to zero point ten zero point one and our weight is going to be one as well that's our default value and now if I copy this parameter but we now have a list go to this transference that we have so the person will be coming close are you I'm just going to say add whatever we have here and that gives us a nice slow we go back to the control now copy hi I'm just going to say that we translate these ones based on the preference who all have to do is just hi no it's going to give us our sleepers and everything else to go through in our sleepers we have our box can actually say translate the translate of transform we're going to use our Y translate just kind of move this up again we're using the bounding box you can see it moves up nicely pistons are the box as well and then the only thing we still have to do sound real and the rails now Center in our transform to the sleepers so again transform just transform one is ok alright so now we have turn of point numbers very nice color-coded rails you can easily switch to any integer that we have the cool thing is say that I were to use another transform a scale and see the curve scales is really big for now and all the stuff nicely updates so get very low amount of polygons on your straight pieces all the way then it of course get a lot more detail you can go up and down the rail still looks perfectly straight well that does it for this episode of this series I hope you enjoyed it and if you want to support us go to our patreon see what we got for you thanks and for now this was da kine bye bye
Info
Channel: Dokai Tutorials
Views: 3,142
Rating: 4.9238095 out of 5
Keywords: Dokai, Sidefx, Houdiniengine, Unreal, Houdini, HDA, solver, HDAcreation, assetcreation
Id: J7KZ-CMTILk
Channel Id: undefined
Length: 39min 14sec (2354 seconds)
Published: Fri Sep 13 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.