Introduction

This is the first part out of a 2 part post – for beginner and intermediate users. The Beginner version will hold you by the hand with an explanation at each step, while intermediate version will have a more code based approach, for a fully automated procedure.

For the intermediate version read through ” Houdini – Procedurally Retopo Limbs – Intermediate Tutorial” or else (pun intended) continue reading.

In this post I will teach you how to retopologize appendages (arms and legs) procedurally. You can of course adapt these methods to anything else. There is a tiny bit of code but it’s nothing to be afraid of. I promise! If you get lost, download the finished_Human_Retopo file and look inside.

In short I will be placing a cylinder at the opening of a shoulder or leg and conform (ray) it to a target high poly mesh.

Set up:

1. To start off you’ll need a base mesh that already has some shoulder or leg topology to point at the rest of the appendage. Give the whole mesh a group. If you leave the base group field empty, everything will be selected. (mine is called base_mesh)
2. Then take a group expression node and using the code bellow we’ll find the approximate polygons of the opening of the leg. I will name my group leg_loop_grp. This group will be used for intersection further on.

@P.y>(SOME_VALUE) & @P.x>(ANOTHER_VALUE)

The selecting points that have a position above “SOME_VALUE” in Y and “ANOTHER_VALUE” in X. Using 2 axis is good for extra control. Play around with the 2 parameters to see how the selection changes.

Note: All of the group expression nodes can be replaced with regular group nodes and if the code is written in the “base” field without any spaces.

TIP: If you write in the name field $OS (stands for operator string), the group name will be the same as the node name.

3. Connect a group promote and promote your “leg_loop_grp” to edges.
4. Add a new edge group node. Untick enable for base group , then enable include by edges and unshared edges. All of this will unselect the whole mesh and select all open edges, like border select in 3ds max. Then type in group name “leg_loop_grp” and set initial merge to “Intersect with Existing”. After that you should have a loop only for the leg.

5. Grab a polyfill node and set the group name to your leg loop group. Now you have a polygon that has filled that space. Then at the bottom of the node click patch group (you can rename it if you want)

6. Using the blast node we will select the patch group, tick “Delete Non Selected” and we should be left off with the ugly n-gon from step 5.

7. Now comes a bit more “scary” coding in the wrangle node. We will create a detail attribute with the number of points of the ngon. Set Run Over to Detail(only once).

i@nm_sides = npoints(0);

All we are doing is: Creating a detail (because we are in detail mode) integer (i) attribute (@) with the name “nm_sides with a value equal to npoints. Npoints is the number of points in the specified geometry, which in our case is from the first input. (0 for first, 1 for second and so on)

8. Add a “primitive” node, reduce all scale values to 0 and in the pivot fields write:

$CEX in for X (1st block)

$CEY in for Y (2st block)

$CEZ in for Z (3st block)

9. Place a point node and set the attribute to normal. Here we are obviously adding normals. Afterwords plug a fuse node at the end and untick Remove Degenarate and Update point normals.

You can’t see anything? Well, that’s because we collapsed all points to a single point at the center. To visualize points, look at the right bar of the viewport and click on the icon with a dot, right bellow the glasses icon. If you want to see normals as well, click the icon beneath that.

10. Now feed the output of the fuse to the second input of a copy stamp node. Go to the stamp section, tick Stamp inputs, write a variable name for the number of sides of the leg and for value use “detail” expression to get the value of the attribute from earlier.

detail(1,”nm_sides”, 0)

1 is the second input, nm_sides is the attribute and 0 is the element in the attribute. For example, if we have a vector we could take the 2nd number from it, like the Y axis. This procedure will place a cylinder pointing at the direction of the normal of the single point we made. The stamp “thingy” is explained next.

Leg creation time!

1. Make a cylinder and place it’s base at 0 on the Y axis – ch(“height”)/2 in the “Center” field for the Y axis. Write in the columns field.
stamp(“../leg_to_body”, “nm_sides”, 0)
All this will do is take the value from variable 1 (nm_sides) in the copy stamp node(mine is named leg_to_body). If such a variable doesn’t exist it will take 0 as a default value and you will end up with a very weird leg.

2. Group expression again! Write @P.y<0.001 to select the first row and set type to points. (my grp is called leg_grp)

3. Group promote leg_grp to edges

4. Add transform – this is used for tweaking the size, orientation and position of the cylinder. Feed the transform to the first input of the copy stamp node. Copy stamp will use the Z and not Y (houdini’s default vertical axis) to orient the cylinder. So as a start, rotate the cylinder in X by 90 degrees.

5. Plug the copy stamp in the first input of a Ray node and the original high poly in the second. Reverse the rays, set the Method to Project Rays and using the Transform node tweak the cylinder to fit over the whole leg. By typing use the bias with negative values to keep the rays from going too far.

6. Then merge the retopo base mesh with the leg and bridge them. As source and destination use the cylinder leg_grp group and the leg_loop_grp. That way you are independent of manual selection and because of the code we wrote earlier the cylinder sides and the sides of the base mesh loop will always match. If your bridge is twisted use Default pairing shift to fix it a bit, the next steps fix it further. Also set Implicit Paring to Use Edge Counts. You might get triangle bridges if you don’t.

7. Add a smooth node with the base mesh group inversed. You can do that by typing an exclamation mark in front of the group name. In my case !base_mesh. Play around with the smooth settings (strength and filter quality) to get the desired look.

8. Conform the mesh again (without reversing the rays) so you can bring back the detail

Congratulations! It’s done. You wrote some VEX and did some retopo without placing dots and edges manually.

Bellow you can see how the final result looks on both arms and legs.