Approaches To Dynamics In Houdini


The following is a companion to my talk at the Houdini Apprentice Fest (or Houdini-Palooza as we like to call it) which took place 29 January 2003 in London.  

Download the accompanying Houdini hip file here, (approximately 500k).*
Download the finished movie
here, (approximately 2 meg, mpeg video). (Note, this mpeg was saved out with the IRIX utility dmconvert, thus it is in a very old mpeg format. If you can't play it, try renaming it to a .mov file and using QT player.)

* To use:  You must cook and lock the two geometry CHOPs in the CHOP editor.  Her's how:  Turn the update button at the top from "never" to "always" and then middle click (once) on each geometry CHOP to cook.  Then either lock the geometry CHOPs, or right-click and save the clip to disc and change the geometry CHOP with a FILE CHOP and load the saved clips.  Save the hip file to your system.


Vine Image  Vine Image  Vine Image  

Introduction


There are many different ways to create dynamic effects in Houdini.  You can use particle effects, soft body dynamics, hard body dynamics and even the old spring SOP.  In this example, I will show you how to use CHOPs (channel operators) to create a simple dynamics effect.   In this particular example, I show how to create swaying branches on a vine, so that the branches sway more at the top than the bottom.

The advantages of using CHOPs over any softbody dynamic effect are many:

Points Covered

Nulls with un-smoothed spline  Nulls with smoothed spline
Stamping  
Adding a random rotation for each copy
How a bounding box works

If you examine the hip file available on this page, you will also see the use of the chf expression to set point colours. Here is an explanation of the use of this expression.

The chf function is used to lookup a value at a specified index. In other words:

I have created a spare channel in a point SOP called which I have called "lookup", (ctr+r click in SOP arena to add spare channel). This lookup channel goes from zero to 100 in time. However, in this case, we are not really using this channel in reference to time, we are using it in reference to $CR, which is the red point colour. The point colours go from 0 to 1, which is too small to be useful in the channel editor, so I have multiplied it by 100 so that I have more resolution to play with, and it now goes from zero to 100.

So, where the value of $CR is zero, the expressions evaluates to use the value at frame zero. When the value of $CR is 1, then the expression evaluates to use the value at frame 100, (1*100).

In this way we can draw a nice curve in the graph editor to create or modulate any value. For example, you can use a similar expression to get the alpha of a particle to fade to zero near the end of its life. In a point SOP, alpha channel:

chf("./lookup",$LIFE*100)

Lag only
Lag only
CHOP network
Sean Lewkiw
http://www.lewkiw.com