In the latest excerpt from the book The Magic of Houdini, Will Cunningham explains Point and Primitive SOPs.
This is the next in a series of excerpts from the Thomson Course Technology book The Magic of Houdini by Will Cunningham. In the next few months VFXWorld readers will learn the basics of the dominant tool that has been used in the creation of some of the most awe-inspiring animation and cinematic effects ever made.
Understanding Point and Primitive SOPs
This section could probably occupy the contents of an entire book all on its own because these two SOPs have real, ultimate power. The big difference between the two is that, as the names imply, one lets you access point attributes, whereas the other lets you access primitive attributes. The amazing part about them is that they allow you to get down and dirty and apply and modify attributes on a per point (or per primitive) basis if desired. So, you could say, "Primitive number 5,573, I hereby decree that you will be purple." Or "Point number 102,972, I hereby decree that you will have a velocity in X of 110,199." In addition, you can utilize the power of various local variables to affect all points (or primitives) on an individualized basis. Let's check out a simple example of each.
- 1. Start up Houdini and jump into the default Geometry object.
2. Jump into it and drop a Grid SOP.
3. Append a Point SOP and add + rand($PT) * 0.4 to the ty channel so that it reads $TY + rand($PT) * 0.2. The local variable TY says to take the position in Y of each point individually in the grid. The PT variable is the point number for each point. So, each point will be get a different, random amount of noise because it will feed the rand() expression its own point number. Then multiply that value by 0.4 to scale it down a little bit. Take that value and add it to the original position, which is stored in $TY. Your grid should look like the one shown in Figure 1.
- 4. Branch a Facet SOP from the grid node. Toggle on the Unique Points parameters.
- 5. Append a Primitive SOP to the facet node. Toggle on Do Transformation. Enter
$BBX * 90
in the Rotate Z field. BBX is a local variable that sets a range from 0 to 1 using the X extents of the bounding box of the geometry. So, multiplying that by 90, you see that the left edge of the grid is pretty flat (where BBX is 0) and the primitives are progressively more vertical as they get closer to the right edge (where BBX is 1).
6. Go to the Attributes tab and change Keep Color to Add Color. RMB on the Color label and delete the channels. Set all three to 0 and then enter $BBX in the green field. Remember that the fields are red, green and blue from left to right. The left side of the grid is black and gets progressively greener toward the right edge. Your grid should now look like Figure 2.
Using the Edit and Transform SOPs
These operators aren't all the confusing but they do have some important points to take note of.
- 1. Open a new session of Houdini and drop a Geometry object and jump into it.
2. Drop a Sphere SOP and change its Type to NURBS. Turn on the display of points.
3. Let's say you wanted to turn the sphere into a beautifully modeled head. That process is certainly going to require many adjustments to points here and there to get everything just right. Over the viewport, select a Transform operator and choose a few points and drag the around. Still over the viewport, press q to repeat the transform and choose another set of points and move those around. Doh! Say you made a mistake with that last adjustment and want to grab a few more points to move. Press the Reselect Geometry for Current Operation button, which is the one with the red arrow on it in Figure 3. This is in the left stowbar of the Viewer pane. Now select all of the points you meant to the first time around and RMB to complete. The new selection gets the changes previously applied!
- 4. Every time you want to move a different set of points, you will have to add a new Transform. This will create a very explicit history of nodes recording what was done in each step. It is easy to see how this can quickly lead to enormous and unwieldy network. In addition, it is painful having to add a new operator each time you want to choose some new points to move around. There is a simpler way!
5. The way is the Edit SOP. Over the viewport, choose an Edit SOP and grab a few points and move them around. Press the Reselect Geo button to make a new selection. RMB and then transform that around. Note that the each transform is saved and not lost while still only leaving one node in the network. Press Reselect Geo again and choose another set of points. RMB and move those around. So, the Edit operation allows you to make as many changes as you want within a single node and stores the aggregate effect of those changes. You won't be able to later come back and trace through each little adjustment as you would with a huge network of transform nodes.
6. Although this is somewhat easier, it could be even easier yet. You have to press that Reselect Geo button every time to make a new selection. Toggle off the Secure Selection button, which is the button just above the Reselect Geo button. Now, you can just grab some points, RMB, and move them around. Select some different points, RMB, and move those around. Alas, it is a relatively painless process!
Find out more about how to apply each of Houdini's features to your projects as you take on modeling, character animation, particle effects animation, dynamic simulation animation, shading, digital asset creation and rendering. The Magic of Houdini by Will Cunninham. Boston, MA: Thomson Course Technology, 2006. 355 pages with illustrations. ISBN: 1-59863-082-2 ($49.95). Check back to VFXWorld frequently to read new excerpts.
Will Cunningham began his trek by studying both traditional art subjects and 3D computer software at the Academy of Entertainment and Technology. After his studies, he was hired as a Houdini technical intern by Side Effects, the developers of the Houdini software package. Eager to create effects for the big screen, he then jumped into production with BlackBox Digital on the feature,
The Prince and Me. Shortly thereafter, he also began teaching Introduction to Houdini at the Academy and has since taught both the introductory and intermediate Houdini courses. In the fall of 2004, he was awarded a fellowship grant by Santa Monica College to support his efforts in creating this book. Over the years, Will has worked for a number of production studios on a variety of projects, including The Chronicles of Narnia: The Lion, the Witch and the Wardrobe, Open Season and Ghost Rider. Currently, he is enjoying effects challenges and learning opportunities at Sony Pictures Imageworks.