Houdini Basics - 6 Tips and Tricks when working with Houdini Digital Assets!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
how did guys indie pixel here and what I wanted to do in this video is run through some tips and tricks when working with HD a so we're gonna start out super basic and we're it's gonna learn how to create an HD a then I want to go and talk about top level HD a s vs. object level HD A's then we're gonna go and talk about embedding assets into our HD ace and how to add a little bit of Python to our HD so in this case when I hit this button it prints out hi indie pixel alright and then we're going to talk about dynamic UI so how we can switch our UIs right here pretty cool stuff and then finally we're going to talk about adding handles so when I hit enter on this keyboard I can move this box around cool so these are all some really good fundamental stuff if you are just getting started with Houdini digital assets or learning Houdini in general alright so let's move on to the tips alright so let's start at the very very beginning so what is an HD a well HD a stands for any digital asset and these HD A's allow us to basically contain you know our functions or our graphs alright so we can reuse them over and over again so starting at the beginning here how do we create an HD a so what I just did there so I went and hit tab on the keyboard over here in the network view and I typed in geometry alright and this is a basically a geometry container and this geometry container can have you know anything inside of it like a box or sphere or you know some complicated network that generates bridges or roads stuff like that alright so turn that into let's actually keep the box there so I'm going to grab it from my history down here to actually turn this into a digital asset let's go in and right click on it so I'm gonna say create digital asset and this brings up this create new digital asset from node now it's always a good idea to give this some sort of name so I'm gonna give it something like IP my box like so and we're going to then capitalize it and now you don't necessarily have to do this I just usually do it and then not you have an option here you can either save it to your Documents older alright so that way whenever you launch Houdini your HDS will be available to you or you can also go and save it into a project so currently I have a Houdini project that I created and inside of that I created an HD a folder so I'm gonna double click that and then just save my HDA into that folder alright so I'm going to hit accept and that accept again and you'll get this little pop-up here when you're using the Geo node to create an ad digital asset so all we need to do is to say destroy else pair parameters because we don't have any spare parameters currently and then what we do is we come into the type properties window here and we can go and modify the parameters or the UI for our HDA so it's up here in the parameters view so we can come over here and just hide all that because we don't need to see this stuff so I'm going to select invisible hit apply and accept and there we go we now have a bare-bones Houdini digital asset like that that's ready for custom UI alright so that's how we create digital assets let's move on to the next tip on how to work with HD ace ok so for the next tip I wanted to really cover a concept that I find that it's very confusing for people who are new to Houdini on working with Houdini digital assets making their own tools here inside of Houdini and that's the concept of a soft level HDA versus an object level HDA so what we've just created in the first tip was an object level HDA because we're creating it at this obj level alright so if I were to actually go and hit tab currently you'll notice that there's a digital assets option available right here and our IP my box HDA is available there alright if I were to actually dive inside of my HDA you'll notice that that tap menu is not available for us and that's because we're now in a soft level area ok and so that's what I really wanted to get across is you know we have an object level HDA and to create a top level HDA we'd come inside of our geometry node and create a subnet all right so let's get a subnetwork node ok and what we can do with this we'll call this my sphere okay and inside of that subnetwork will create a sphere there we go so now we add sphere let's turn it actually over to a polygon there we go and now what we can do is we can go and turn this guy on and we can just go and save this as a digital asset alright so we'll call this IP my sphere alrighty let's go and capitalize these guys like so and again I'm gonna save it into my project HD a folder I hit accept and accept and when I do that you'll notice that we actually didn't get the option to destroy spare parameters because these sub networks basically are just containers for other notes there's nothing on it but we can go and add our own UI to this stuff using this type properties window so with that we now have a stop level HDA and if I were to tap now remember I'm in inside of my box HD a currently we now have a digital assets option here in our tab menu and we can create more my spheres so use these SAP level HDS to create functions that live with inside of object level HD ace okay so that's that concept that I really wanted to get across let's move on to the next tip so let's talk about another feature about HD A's that's really useful that I find that people who are new to creating digital assets don't really know about now if we go up to the side effects documentation here you'll see this particular section here that is called referring to embedded asset files using op def all right some the Houdini 17:5 digital assets now what this does is it allows us to embed files inside of our HD a alright so let's walk through this process so I'm gonna double click my HD a that we have here and I need some geometry here that I can then import or embed into this particular asset so let's go and get the pig head because it's fun and very Houdini alright so I'm not going to drop down a rap geometry output node I'm gonna wire these two together because I'm gonna export this pig head out to just a file that exists on my hard drive all right so let's go select the rap geometry node and we're going to come up here and we are going to export it to the Geo folder in my Houdini project so I'm just gonna call this the test pig head and we're gonna save it out as a BGO file all right cool so now with that all set up I'm just gonna hit save to disk and now that particular geometry is stored on my hard drive and I can verify that by dropping down a file note hitting the display flag there and then just selecting the geometry so if I go to my project folder the geo folder and select that you file there and we can get rid of this stuff and we are good to go so now we have our loaded geometry now the problem with this is it's pointing to an absolute path here on my hard drive all right so if I middle mouse click this guy I can see the full path for that particular file now if I pass this particular HDA off to another co-worker or a friend or something like that I'm just sharing my HD ace they're not going to have that path so how do we get this geometry to go with the HD a basically that is why we are going to be using the embedded asset files using op def so we need to use this up def operation right here so let's talk about how to use that I'm going to get rid of this well actually let's keep the file node here because we're going to use this so let's go back up to our HD a I'm going to right-click on it and say type properties here and what we are interested in doing is going to the extra files tab over here this is where we can go in embed assets so there's a first step to embedding an asset into your HD a so go to the extra files tab and for the file name I'm gonna go and select my test pighead video file and with that all set up I'm gonna hit add file and now it is actually inside of my HD a now this will increase the size of your HD a but at least the geometry is there all right so I'm gonna hit apply and accept and then I'm gonna double click on my HD a to dive inside and let's come over here and get rid of this particular path so now we're not loading any geometry up so the way this works we're gonna type up def for operator definition we're going to do a colon and then dot dot question mark and the name of that file so it was test underscore peghead bgl and look at that we're now loading up the geometry that is embedded inside of our HD 8 so if I were to pass this off to anybody the geometry would go with it very cool stuff all right so let's move on to the next tip another really useful aspect to creating HD A's and honestly to make them really more advanced and more dynamic is to add Python to them so how do we go about adding Python to our HDS well there's one way where you could go and add a Python node all right so if we just type out Python you can add a Python node in there and write all your code in here as well that's really more for geometry processing and you know quite a lot of other things as well but what if I want to have a button up here on my HD A's user interface up here that triggers some sort of action inside of my network all right so let's go and take a look at this so I'm going to open that type properties window there and what we want to do is we want to go over to the scripts tab now and inside of this script tabs we want to add a new Python module so to do that we're going to come down to this event handler drop down and select the Python module all right so what this does is it sets up the Python module that's inside of this particular HDA and what we can do is we can write some Python all right so it's just write a really basic function in here so I'm gonna say def say something for the function name and then we're just gonna have this currently print out something like I don't know hi indie pixel yay all right it's our hello world Python function alright so now we've got that in place I need some way to trigger this so we can actually see the results of our function up here all right so to do that I'm gonna come back to the parameters tab and I'm gonna go and create a button there we go and I'm just gonna call this my button first for now there we go so let's go and call this press me for the label all right so now I need this button so if I hit apply now over here and you'll see that we have a button up here and it's not doing anything currently alright so if I press this what I want to do is I want to have it print out that function or run that function that we just coded up over here ok so to do that we need to come down to the callback script this is how we hook this button up to that function and I want to make sure that it's set to Python and now the code that we need to write inside of here is who dot PWD to access this current reference or this current instance of this particular operator or this HDA we're going to say HDA module so we can access the python module that we created over here so we're accessing this thing now and then the name of the function so we say say something and then parenthesis and with that we're all set and ready to go so let's hit apply and accept and hit press me and there we go look at that cool so that pops out open now if you wanted to not use the console let's go and close this you can always come down here and open up a new pane type and we are looking for the Python shell so now if I press this it goes to here instead of the console pretty cool all right so let's move on to the next tip when working with HDA is especially in teams you want to make your you eyes up here really dynamic that way you know as parameters are changing the UI is changing to accommodate you know whatever geometry is being displayed now there's quite a bit of things you can do with this parameters and one of the things I want to talk about is how do we make our UI a little bit more dynamic all right so let's go into our HDA here and I'm gonna set up a switch node here between our box and our sphere all right and this just basically allows me to switch between whether or not I want the box or I want the sphere all right so let's go and promote this toggle here to our HDA so I'm just going to right click on the little breadcrumbs up here and open up the type properties for that HDA and what I want to do is just drag and drop that slider there into my HDA and now that means that it's now available up here and is now overriding the switch node cool so I actually want to turn this to a toggle all right so let's go and change the type to a toggle and we'll just call this the which for the internal name and switch for the label alright so let's get hit apply and awesome so now what I want to do is I want to have this display the scale of the box when the switch is using the Box geometry so this particular slider right here and then I wanted to have it to display the scale for the sphere when the sphere is selected all right and I want those two sliders to be independent alright so let's go and make two folders here alright we're going to call this the Box parms or params there we go and I'll call this the sphere params like so awesome so I hit apply and accept and if I were to jump up and out to the obj level or object level you can see now I have two tabs up here alright and they contain both but basically what I want to do is I want to say well when we're on the box I can only see the box parameters and then when I'm on the sphere I can only see the sphere parameters all right so how do we set something up like that so let's pop open our type properties again and let's make a little more room here and I'm going to expose the uniform scale for the box and then I'm going to expose the uniform scale for this sphere there we go very cool and what I want to do is I want to create some sort of relationship between these two taps based on the value of this particular table right here so we can do is we can say and utilize the hide when a particular value like to switch for this toggle right here is true or false all right so to do that we can say well I'm gonna hide so we need the two curly brackets here so I'm gonna hide this particular tab when switch when you move the cursor there is equal to zero okay let's copy this and then I want to hide the sphere when it is equal to one and I think I actually had that mixed up there I want this one to hide one where zero and I want this guy to hide one over one there we go so it set up and let's take a look at this now so let's jump all the way up and out now you can see that I only have the sphere parameters available and when I turn this off I don't actually have the the box parameters and that's because I put it in the wrong spot my apologies there we go cool let's hit apply and accept there we go so now we have our box parameters so now we're creating a dynamic UI you can get really advanced with all this stuff so I highly recommend practicing that so let's move on to the next tip okay so for our final HDA tip I want to talk about handles so you might have noticed if you've been using Houdini for any length of time that if we drop down something like a poly extrude node over here for this particular box and we hit enter we get these handles over here all right so we can pull on these handles right here and then we need to escape to get rid of it right well we can actually build our own handles for this so in this case what I want to do is drop down a transform node and I want the ability to drive this transform I want to be able to mimic this operation so when I select the transform here and I hit enter I want to be able to pull up a gizmo like this so I can move the the box around all right and so I'm gonna keep that there and keep the switch highlighted or have the display flag on for that all right and what we can do is we can set up our own custom handles to drive that and so the first step in getting that to work is to put in a float vector 3 for this guy because we need the XY and Z and we'll call this the box pause and box pause for this all right I'm going to apply and then accept and then I just need to go and open that type properties window again and the reason is because that commits that new property to our HDA and so now we can actually access it inside of this handles tab so let's go to the handles tab here and let's go and create a new Transformer handle this is basically the same type of transform handle you get when you highlight the transform node and what we need to do is we need to come all the way down to the bottom here ok and we need to go and assign values for the TX the t y and the TZ all right so if actually come over to this transform node here and just highlight over this guy you can see that the parameters are T X T Y and T Z all right cool so if we go to T X we want to assign the box pause so we need to scroll all the way down to the bottom here so we want to get the box pause X for our TX we want the box pause Y for the the T Y alright and then for T Z we want the Box posi simple as that so now we've got our transformer handle hooked up to our box pause so let's hit apply and accept all we need to do now is pass let's turn this like a guy off there all we need to do now is pass this value so let's copy the parameter so this vector 3 right here down to our transform so let's just override the transform here with our box pause value so now when I go and hit enter on the HD a so I'm going to select the HD a over here then hit enter while in the scene view I get my own custom handle and I can now take this and move it around and if I were to switch you can see the handle stays there but we now have the sphere so I can switch back and we can move the box again pretty cool stuff alright so I'm gonna close that out there I hope those tips helped you guys out with HD ace those are some of the things that I have always you know wanted to share with people when they first start learning HD is because they're really powerful alright thanks so much really appreciate the sport
Info
Channel: Indie-Pixel
Views: 10,697
Rating: 4.9873419 out of 5
Keywords: Houdini, Houdini 17.5, Houdini Digital Assets, Procedural Modeling, Procedural System, HDA, Embedding Assets, HDA HAndles, HDA Dynamic UI, HDA Python
Id: SiT4r22BWY8
Channel Id: undefined
Length: 19min 21sec (1161 seconds)
Published: Wed Nov 20 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.