Brew together houdini multiparam and python.

This time i need to create a generator in Houdini and the problem was how to give more control to user.

The task is about to create a door/gate generator and be able to add as many of its instance as necessary. Plus each instance must be under full control.

So for me multi param looks like the best solution. The one problem was how to connect all the necessary parameters to necessary node.

Here is a solution.

  1. First create a nodes network you want to work with
  2. Put it to the subnetwork and add interface parameters via Edit parameter interface. I've added only the number of copiesThen I've linked number of spheres to number of points inside my subnetwork
  3. Turn this sub network to Houdini digital asset. This will allow you to work with python and redistribute an asset.
  4. Open HDA type properties by clicking RMB. In parameters tab you can modify the interface and add callbacks to it.
  5. Now let's add python script which will bind parameters together
  6. Script to bind parameters

    First of all - paths must be relative. To achieve this use './' construction. This will be like a top level of your HDA.

     

    returns a value of the channel

  7. Important - In scripts tab set Event handler to python module, otherwise this wont work.
  8. Go to Paramters tab. here I’ve add a button and in callback script field paste this code:

  9. set_conn(kwarkgs) is just a function call with giving al lthe parameters to it (might me not necessary)

That’s it. HDA sampleĀ 

Download (ZIP, 4KB)

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *