I have a few simple projects in mind that I will eventually start posting here, but during the last few days I've found myself exploring a bit of a tangent with Houdini.
I want to try animating things in Houdini using external controllers. Nothing like motion capture suits like Flock of Birds, or expensive data gloves or anything - just regular cheap gaming peripherals like the Logitech Extreme 3D Pro joystick I have sitting on my desk.
My first inclination was to understand how things like that worked in Houdini, so I immediately loaded the program and began exploring the interface and help files. I ended up in the CHOPs (Motion and Audio) section of the interface, but couldn't find anything with respect to Joysticks. I played around with the Mouse CHOP, and actually recorded some simple data with it. But I couldn't find anything related to Joysticks - so I assumed that there must be a lower level way of doing this.
I found the PipeIn and Network CHOPs and thought that this would be a reasonable way of inputing the Joystick data. Eventually I was able to locate a description of the file format used by Houdini to parse the data from PipeIn. So being ambitious, I wrote a Python script (and yes, I still use Python) to connect to the Houdini Network CHOP. My plan was to use Python and PyGame, a set of open-source Python bindings to the OpenSDL gamine libraries (which provide Joystick support).
Unfortunately I couldn't get this to work, for whatever reason. I could create a server that could make connections and spit out random channel values, but I couldn't make it connect to the network CHOP. I went to bed thinking I would revisit my network CHOP in the days to come.
Then I think I had a dream. I dreamt that it would be really cool if there was some kind of software SDK that would let you extend Houdini with your own SOP/CHOP/POP/etc. code to do what you wanted. When I woke up from the dream, I was almost disappointed that I had only been dreaming... after all, that would be the perfect way to input Joystick data into a CHOP. So you can imagine my joy when I sat down to investigate this, and there was indeed a Houdini Development Kit that let you write your own CHOPs!!!!!
Here's what I learned about getting going with the HDK in Houdini:
- First, if you want to compile on Windows (I have Windows XP) you're going to need to have Microsoft Visual C++ installed. This costs money, so if you're the frugal type you may want to go the Linux route with its less expensive (free) development tools.
- Next, you need to have the environment variable HFS set to wherever you installed Houdini. Set this in your Control Panel -> System -> Environment Variables. For me this was HFS=C:\Program Files\Side Effects Software\Houdini 8.0.345
- Next, you need to have the Houdini bin directory in your PATH, once again setting this in your Windows environment variables. For me this meant adding C:\Program Files\Side Effects Software\Houdini 8.0.345\bin to my path.
- Next, you need to have the Microsoft Visual C++ executable directory in your PATH. I think MSVC did this for me when I installed it - so check your PATH, and refer to your MSVC documentation if you think your PATH is not correct.
- When all of this is done, bring up a command shell and CD to your Houdini bin directory by typing "cd %HFS%\bin"
- Run the command "hdkinstall"
- Walk through installing the HDK - you will need to get a license key in order to install the HDK. For me this was a bit complicated: it didn't happen automatically, so I needed to follow some instructions generated by the installed, go to the Side Effects web site, manually generate a license key and copy-and-paste it into the Side Effects license key manager (hkey).
- Finally, I was able to compile and install the Houdini sample CHOPs located in %HDK%\toolkit\samples\CHOP
So, if you follow that admittedly rough set of instructions, you can also get the Houdini HDK working with the Apprentice edition.
To cap off the night, I copied one of the sample programs and modified it to compile and link some SDL code. I tried running Houdini, and after playing around with where to put the SDL.dll file (I ended up putting it in c:\Windows\System) I successfully ran Houdini with my new hybrid CHOP that contained the code to initialize the joystick system. My Joystick CHOP doesn't yet read any Joystick data - that's my project for the coming days - but it does execute and initialize without bringing the whole system down. That's a good start. Here's proof:
And interesting note to end on: Working through the Houdini code
brought back a lot of memories of working at Side Effects almost 10
years ago! The code style is very similar to 1994!
Comments