Search form

'The Magic of Houdini': SOPs That Confound the Melon -- Part 1

In the latest excerpt from the book The Magic of Houdini, Will Cunningham discusses a few more complicated SOPs.

All images from The Magic of Houdini by Will Cunningham. Reprinted with permission.

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.

In this section, I take a few minutes to go over a few SOPs in particular. These werent covered earlier in detail because it would have taken you too far off the path of the exercise. Here, however, there is no path but detail! The following topics are covered because I recall them appearing murky at best when first learning about them. Hopefully, you can avoid some of that frustration by getting the answers right now at the outset.

Object Merge SOP

The Object Merge SOP is a useful tool for bringing the SOP contents of one object into another object. It all seems pretty simple until you really start to think about what the Transform object is doing. At least for me, that part gets a little murky. But, with a short exercise and some discussion, Ill wager you can regain a solid footing.

  • 1. Open a new session of Houdini and lay down three Geometry objects. Name them sphere, box and cone.

2. Jump into the sphere object and drop a Sphere SOP. Jump into the box object and drop a Box SOP. Jump into the cone object and drop a Tube SOP. Change the rad1 channel to 0 to change the tube into a cone. Delete the file nodes in each of the objects if they exist.

3. Jump back up to the objects context. Leave the sphere at the world origin. Translate the box object in positive Y by five units. Translate the cone object in positive X by three units. Home the perspective view, dolly out a bit, and you should see what is shown in Figure 1.

[Figure 1] Zee perspective view.

  • 4. Jump into the sphere object and lay down an unconnected object Merge SOP. Append a Merge SOP and wire the sphere node into it as well. As always, update the Display flag.

5. In the Object 1 parameter for the object merge node, navigate to and choose tube 1 node inside the cone object. Toggle the See One/See All button so you can see the other two objects. Currently, the merged cone is sitting on top of the sphere at the world origin. Why didnt it inherit the transform of the cone object and so be right on top of it? Because the Transform Object field is empty, only the SOP information is being imported. And so, the +3 units in X arent being inherited.

6. Now, it starts to get a little murkier. In the Transform Object field, navigate to and choose the sphere object. The cone has moved over on top of the other cone. Go to wireframe shading and turn on the display of primitive numbers. The numbers verify that there are two cones occupying the space. Usually, this is what you want. Delete the /obj/sphere path and replace it with a. and you will get the same result. A period just means to inherit the current objects transforms.

But, why if you set it to inherit the spheres object transforms do you get the +3 units in X from the cones object transforms? Think of it this way. This specifies the object merges world origin to be the same as the sphere objects. Then, it evaluates the cones object transform relative to this new world origin. The cone object is 3 in positive X from the specified world origin and so the imported cone sits on top of the cone object.

7. Change the Transform Object field to /obj/cone and the cone jumps back to be on top of the sphere. The reason is different this time, though. Earlier, it was because no object transforms were being considered. This time, the object merges origin is set to +3 in X. It then evaluates where the cone object is relative to that new world origin. It is right on top of it, and so no transforms are applied. The result is that the cone sits on top of the sphere.

8. To get even loopier, change the Transform Object field to /obj/box. Whoa! Exploding brain mass engage! You are object merging a SOP from one object into another object using the object transforms from yet another object. Now, this is getting silly. Yet, you can make sense of it. First the object merges world origin is set to +5 in Y. Then, the cone object is evaluated relative to that new world origin. The cone is five units down and three units to the right. So, the merged cone is now below the cone object as shown in Figure 2. Once you get into the details, it becomes readily understandable. And, if not, go through the exercise one more time as repetition does help comprehension!

[Figure 2] The merged cone using the boxs object transforms.

Blast SOP, Delete SOP and Dissolve SOP

I recall first being introduced to these three operations. I quickly came to point of near total confusion and would always end trying them all when I wanted to do something that involved deleting things. Well, there is an easier way and that is to understand how they are different.

  • 1. Start a fresh batch of Houdini and jump into the default geometry object. Throw down three Sphere SOPs and change them all to a Polygon Primitive Type. Set the Frequency on each to 1.

2. Place the Display flag back on the first one. Make sure you are using a primitive selection mask (the hotkey is 5). Turn on the display of primitive numbers. Over the viewport, select a Blast operation and select and blast primitive 15 and 16. It deleted the two primitives and left a hole.

3. Put the Display flag on the sphere2 node. Over the viewport, select a Delete operation and select and delete primitives 15 and 16. Again, it deleted the two primitives and left a whole. So, they do the same thing? Well, yes. However, look at the parameters for each node. The delete node offers all kinds of options that the blast does not. Basically, you can forget about the Blast SOP and just use the Delete SOP. Sometimes you will use the extra functionality and sometimes not.

4. Put the Display flag on the sphere3 node. Over the viewport, select a Dissolve operation and select and dissolve primitives 15 and 16. This time, all of the edges that comprised the two primitives were deleted, but the primitives adjusted in order to repair the hole. That is the main difference between this operation and the previous two. This is most often used to delete unnecessary edges. Notice it has a useful option to remove inline points. Lets use it in this manner to see how it works.

5. Drop an unconnected Grid SOP and change its Rows to 3 and its Columns to 7. Change the Orientation to XY so that is facing you. Over the viewport, select a Dissolve and switch to the edges selection mask (the hotkey is 2). Choose the inner four edges, as shown in Figure 3.

6. Houdini dissolved the edges and left the primitives that the edges were a part of. Turn on the display of points, if necessary, and notice that Houdini stranded points in the vertical edges. Toggle on Remove Inline Points and Houdini will take care of them too.

[Figure 3] Choose these four edges and dissolve them.

Copy SOP, Primitive SOP, Duplicate SOP and Copy/Paste

Here is another gaggle of SOPs that gave me some confusion initially. They can all kind of copy things. Lets look at each to see the differences.

  • 1. Start a new session of Houdini and jump into the default geometry object. Drop a Sphere SOP and change the Type to Polygon. Change the Radius in all axes to 0.2.

2. Drop an unconnected Grid SOP and change the Size in X and Y to 5.

3. Drop an unconnected Copy SOP and wire the sphere into its left input and the grid into its right input. This operation copies one full copy of the left input to every point in the right input.

4. Drop an unconnected Primitive SOP and wire the sphere into the left input and the grid into the right input. Toggle on Do Transformation. You see a contorted piece of geometry.

5. Insert a Facet SOP between the left input and the sphere node. Toggle on Unique Points. Now, it is easier to see what it is doing. This operation copies one primitive in the left input to a point in the right input until all primitives in the left input are used. You can see this because all the points on the grid have a piece of the sphere copied to them except for the last two rows. There are 80 primitives in the sphere and 100 points in the grid.

6. Branch off a Duplicate SOP from the sphere node. Change the Number of Copies to three and change the Translate in X to 1. This operation merely makes multiple copies of the input.

7. And finally, select the sphere node and press Ctrl+C and then Ctrl+V. This just does a copy and paste job in the old fashioned sense of the phrase. Thats all there is to it. No need for any future confusion.

Find out more about how to apply each of Houdinis 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.