My first week in Houdini

   973   0   0
User Avatar
Member
7 posts
Joined: March 2017
Offline
Hi everyone ,long term lurker but first time poster. I am a property surveyor in the real world with a hobbyist interest in 3d, particularly in architectural modelling. I have over 10 years hobbyist experience in traditional polygon modelling , most time spent in 3dsmax but also a reasonable working knowledge of Substance Designer / Painter and Zbrush without being an expert in any of these. I also have some rudimentary programming knowledge having tangled with various scripting languages over the years. I thought I would document my first experiences with this wonderful software to perhaps encourage other new users and perhaps raise a smile from the more experienced.

First things first. For 3 long years Houdini did not play well with my system. I have a 4 year old PC with a GEforce970 and 32MB RAM but it used to crash seconds after start up with the dreaded segmentation error. After each Houdini version was released I would hopefully load it up only to be met with the same issue. Trawled around here for a bit and read that this was maybe caused by a conflict with a sound driver but somehow I did not really see the connection steadfastly believing it to be a graphics card issue. It was indeed a sound card driver issue, not with the core soundriver but with the enhanced sound software loaded on startup by my Maximus Hero III motherboard software. Simply disabling this on start up cured the issue immediately. Imagine the joy of being finally able to start to play around with the software after 3 years sitting on the sidelines. Note to self: technical people do sometimes know what they are talking about

So by now am I well aware of the procedural nature of Houdini and of its powerful potential but need to finally learn how to use it. So I watched a few beginner tutorials, got familiar with the interface/ navigation and followed by rote the step by step fence making tutorial to get some practical knowledge of actually making something functional. This taught the principle of looking for relationships between elements of the model that can be turned into procedural steps. Everyone learns differently but for me it is important to make something practical even at an early stage to maintain motivation. I watch several more tutorials but balance this with playing around. After about 6 hours , some of the core ideas are sinking in and I feel ready to try a simple first project of my own… All the advice is to keep it simple at first and not be too ambitious, and this is sound advice. So I decide to make a procedural arched window generator, after all how hard can that be … I have modeled loads of these over the years in the traditional way and it is getting old, it would be nice to take it procedural.

So the project is defined. Make an arched window generator of any desired shape. Most windows are symmetrical by nature so I decide I will model half and mirror as I would do in 3dsmax. I further decide I will attempt to model it in splines and then wrap the mesh around it . I later learn this is called the “Curve Up” approach.

So I start with the closest I could find to a spline ,which is a simple vertical line at the origin. I take a look at the settings for the LINE node and hey ho, a polygon line option???? How can you have a polygon line , seems like a contradiction at first. Also a Nurbs/ Bezier option. I re -read the documentation to refresh my learning on the hierarchy of Houdini elements and decide to use a polygon line to start. I want to control the geometry of the final model so realize I can turn the “No of points” and “line length” into exposed parameters for user input. I learned how to do this in the fence tutorial so now I have a straight vertical line where the user can control the length and number of points in the line.

OK, so the straight line needs to bend if it is to turn into an arch. Is there a node for this??? , a press of TAB and a quick search reveals a BEND node. This must be it so I plop it down ,connect it to the LINE node and take a look at the settings. Wow ,this is one powerful node. A few minutes playing around with the settings makes me realize that I can control the amount of Bend , where the bend starts on the line and the amount of the line affected by the bend. Basically these are the 3 parameters needed to create any shape of curve. I immediately expose these as parameters to the user, clamping the bend amount to no more than 90 degrees as it does make sense for half the arch to go beyond this. I test it out and sure enough I can make any desired half curve with these parameters. This is so easy I think to myself and in about 5 mins I have the core of my entire model done.

So I now have half my arch. I need to mirror it around the apex point? So I search for a Mirror node, connect it to the bend node and take a look at the available settings. Hmm …first problem, since the user can control the curve, I need to always be able to find the x co-ordinate of the apex point which could be anywhere along positive x depending upon user input. I turn on point markers and see that Houdini numbers the points from 0 at the origin to N at the top of the curve. So I need the x co-ordinate of the highest point number in the line, and this will always hold regardless of how many points the user puts in the line. I instinctively feel Houdini can do this but I have no clue how. Cue a documentation trawl and several more videos on how to get the x position of a given point. So I learn about the POINT vex snippet command, look up the required syntax and parameters, and insert the code snippet into the Distance box of the Mirror node using the system variable points-1 to make sure it always references the highest point number which will always be at the apex of the curve. The code snippet I write by following the docs is horrendously long ,doesn't fit in the tiny box provided and does not read very intuitively. I am thinking there must be a better way but hey it works!!!! Now the arch is mirrored dynamically around the apex where ever the user decides to put it.

Now for the base of the window which needs to be a straight line connecting to two base points of the arch. Believe it or not I actually struggled with this thinking I had to extend the first line which led me looking at adding points to an existing line. Basically I was looking in vain for a 3dsmax style connect option. This was a bit over my head. Then I realized all I needed to do was create another LINE node , I could keep it separate and “merge” it or connect it later. The length of the base line is always going to be twice the x distance to to apex, so I copy the long winded code from the Mirror node referred to above into the Distance parameter of the 2nd LINE node and multiply by 2 and this also works as expected. I now have a closed set of lines forming the outline of the window. I also copy the number of points exposed parameter of the initial line to the 2nd line so that the user controls both. This is however overkill for a straight line. It puts too many points along the base to be useful and would bloat the poly count of the final model unnecessarily. Thinking ahead ,I know I will need N number of vertical bars to form the inside frame of the window, so I create a user parameter and set it to the number of bars , then for the number of points in the base line ,I divide the line length by the number of bars to create an appropriate number of points for the base LINE Node.

Fed up with looking at lines, I decide i want to try turning the 2d arch shape into a 3d polygon mesh to represent the outer frame. I first try the POLYEXTRUDE node but this yeilds a mess of geometry, particularly at the corners which I cannot resolve by playing with the settings. So then I stumble upon the POLYEXPAND2D node and give that a try, and yes this is exactly what I need. I can scale the shape outwards just like 3smax and this becomes the front face of the outer frame of the arch. I expose this extrusion amount as a parameter so the user can control the width of the outside frame. I then attach a POLYEXTRUDE node and expose the amount of this extrusion to the user to allow control over the thickness of the outer frame. On a roll at this point, I then connect a BEVEL node and allow the user to control the bevel. The 3d model of the outer frame is complete.

Now for the inner frame. I could go for a number of styles , and I understand Houdini will even allow me to make interchangeable variants, but for now I decide will go for a bit of a Gothic tracery look for the inner frame, typical of a basic medieval window with intersecting curves all driven by the original master curve.

So I go back up the chain to my original LINE node. I need to transpose and copy this in X n times as set by the user input , then mirror all the created copies to create the typical interlocking Gothic tracery pattern. The resulting pattern will extend outside the frame and the excess lines will need to be trimmed back. Just like in traditional modeling ,I think it pays to have a small plan and break this down into steps. The transpose amount will be the total base line length which I can reference from the base line node divided by the number of bars which can be referenced from the earlier created user input parameter. But how to do this in Houdini? Ok, so I figure there must be a copy option and I find a couple of COPY nodes. I go for the COPY & TRANSFORM option. After a bit of experimentation I work out that the COPY node keeps the original when I make copies. I don't particularly want this , I do not need another copy on top the starting location of the curve. I learn about the BLAST Node and use this to remove the first copy but this seems rather clunky. I then have a light bulb moment and realize that if I simply transpose the curve once ,then copy it n-1 times,it will yeild the same result but retain all the copies without the need for blasting. So I plug the original curve node into a TRANSPOSE NODE , copy the tranform amount (length of base /number of bars) into the x coordinate parameter box of the node, then plug the result into a COPY node and setting various options to make N-1 copies and a commulative x transform. So far so good, the pattern is spot on but the created lines extend outside of the frame which is obviously wrong.

Working out how to trim the excess of the inner frames procedurally was a real challenge for a newbie . The sweet ride so far hit the rocks hard and I was stumped. So I have n number of curves which intersect the outer frame shape in n places, and I need to trim these curves so they do not go through but terminate at the intersection point. I tried a lot of approaches , including trying write a set of nested loops in VEX in an attribute wrangle node using my rudimentary programming knowledge which was an epic fail. I knew it had to be possible, but all the various attempts led me to explore lots of new nodes in an applied learning environment, ie intensive learning to solve a specific problem which in my opinion is a very effective way to learn Houdini provided you have the required resilience. I learned so much from trying to solve this problem. Eventually after literally 3 days of trying ,I got it working. I put the set of copied curves into a for each loop set to loop through primatives, iterating through each copy in turn. For each copy of the curve ,I did an INTERSECTION analysis with the outer frame to find the intersection point, merged this with the curve in such a way that the intersection point has a point number of 0 after the merge. Then I did an ATTRIBUTE WRANGLE set to loop on points filled with a couple of lines of the very simplest VEX code you will ever see to delete all the points in each curve with a y position higher than that of the intersection point. This worked but left a small gap between the last surviving point in each curve and the intersection point. I then used a 2nd Attribute wrangle node this time set to run in Detail mode, which moved the now highest surviving point number in the shortened curve to the position of the intersection point. I then did FUSE to eliminate the double point created.

Once the inner frame was complete,I merged the shape and put it through a SWEEP Node fed by a circle to turn the entire inner frame shape into a 3d mesh , exposing a few more parameters to control the shape of the inner frame.

For those of you still reading this, it shows what can be done in this amazing software with only 1 week of experience and a bit of determination. End File attached for anyone interested. Any suggestions for further improvements gratefully accepted.

Attachments:
Arch.hipnc (317.8 KB)

  • Quick Links