Houdini CHOPs: Curves from animation
This is a simple but in depth 4 page tutorial on how to use CHOPs to create a curve from the path of an animated object.
It is possible to use all sorts of methods to create plotted animation curves (like, for example, the Trail SOP), but the aim is to create a curve that will respond to any future changes in the object’s animation. Additionally, I also want to be able to specify the amount of detail in the curve. To finish the tutorial, I’ll show you how to turn the curve into a Houdini Digital Asset (HDA) so that you can easily reuse it in your own scenes.
The CHOP network
In Houdini, CHOPs allow us to look at animation data across the entire time range of the scene, and process it in many different ways. CHOPs can offer unique solutions to problems that would otherwise be very difficult to solve.
So to start, add a Null object and animate it any way you like. Call it “animatedNull”. Note that in the image to the left, I’ve added a particle trail so you can see where I’ve animated it.
Go Inside the new CHOP Network and create a Fetch CHOP called “fetch_Anim”. Change your main window to Motion View. In the Fetch CHOPs Node parameter, select the animated null that you created (which should be /obj/animatedNull), and in the Channels parameter, enter:
In Houdini, this is known as a string pattern. You can find it in the documentation under Houdini10 > Expression Functions > Pattern Matching or by searching for “Pattern Matching”. The syntax is very similar to wildcards in DOS and in this case is just a way of telling the Fetch SOP which channels you want to use. The above expression will match any of the following names:
tx ty tz
Which are the channels that you want to use from the animatedNull object. If you prefer, you could just type the channel names as shown above into the Channels parameter. It will still work.
Note that the following pattern will also work:
but it spreads the net too wide as it will import any channel that has “t” as its first letter. Not hugely problematic, but it could mean unnecessary processing for Houdini.
It is also worth noting that the order of the channels is dependent on what you type here. For example, either of the following two patterns:
tz ty tx
will import the channels in reverse order. Generally this doesn’t matter too much as the channels are usually identified by name, but it is worth being aware of.
Finally, add a Null CHOP and feed the output of the Fetch CHOP into it. Rename the Null to “OUT”, and enable the display flag for the new node.
Press h in the main viewport to frame the curves so that you see something similar to that shown in the image below.
The Fetch CHOP also has a parameter called Sample Rate which can be found on the node’s Channel tab. Changing its value changes the number of points (known as samples in CHOPs) that make up the animation curves in the viewport. If you press d in the viewport, you will toggle the display of dots that show the curve samples. Keep the Sample Rate set to default for the moment.
On the next page, you will use this value to control the resolution of your curve.