If Block (New Updated If Block in Houdini 17) using Sop Solver Footprint

SideFX’s Footsteps example

SideFX’s Footsteps example

In a previous post, I created a scene using one of SideFX’s provided examples, “Footsteps”. It creates footsteps as a torus stamps it way across a grid. This example used the old if block nodes in Houdini, however these nodes have been updated and the workflow has changed, but the old nodes are still compatible with the newer versions of Houdini.

I took the Footsteps example and I have updated it so now it uses the new version of the if block nodes.

Updated Footsteps example HIP file to use the New If Block Nodes

Updated Footsteps example HIP file to use the New If Block Nodes

The above is what the new network looks like now. I left the old if block for reference, but the outputs of the old if block aren’t connected to anything so it doesn’t affect the scene in any way and is only still there for easy reference.

Let’s take a closer look at the new if block and compare it to the old if block.

Comparison between Old If node & New If node in Houdini

Comparison between Old If node & New If node in Houdini

The older if block nodes use to have a network within itself and in order to access the operations you would have to double click the old if block node to actually get to it.

The new updated if block node as you can see layout the network right on this context, so you can see all the nodes right here. Now the if block nodes still work almost the same way, except now we have the convenience of plugging in the nodes straight into the if block network without needing to plugging it into the old if block node as a parameter. My guess this is one of the reasons why SideFX decided to change the workflow.

Changes Footprint to green otherwise everything else is red

Changes Footprint to green otherwise everything else is red

In order to explain this I’m going to actually use a simpler piece of if block node setup that is currently changing the color of the footprint as the torus stamps onto the grid path.

 

Please refer to the screenshot right below this paragraph. You should see two constant vector nodes labelled, “RED” and “GREEN”. The RED node plugs into the input of the if block and the GREEN node plugs into the output of the end if block.

Why isn’t the RED node hooked up to any of the outputs? How is the grid red then?

New If Block in Houdini, Changes color based on condition

New If Block in Houdini, Changes color based on condition

That was one of my first thoughts too. Houdini’s if blocks, new and old have always worked by implicitly linking the parameters by common name. For example, the if node block input parameter is named, “Cd_in”. We can ignore the “_in” because that is auto-generated by Houdini. “Cd” is the name of the parameter. There is an implicit link that “Cd” input and output are the same values and Houdini automatically assumes that if the condition is not met, meaning that it’s false, then the “Cd” parameter will output directly to the end if block without passing through any other nodes inside the block statement (the blue colored area on the network).

So this results in RED output if condition is false and GREEN output if condition is true, because the GREEN is inside the if block.

Just remember:

if true —> goes through the if block network

if false —> skip if block network