Parameter-induced Cook Loop

   1451   2   0
User Avatar
Member
18 posts
Joined: Jan. 2009
Offline
Got a custom HDK SOP, which contains geometry and cooks on every frame. The SOP generates a set of float output values, which are set in parameters for sharing with other nodes.

I connect this SOP to the input of a second SOP, which makes use of both the geometry and the output parameters from the first SOP. As soon as I enter a parameter expression in the second SOP with a ch() referring to the first SOP, instant cook loop. The first SOP cooks continuously. I understand this is quite normal, based on how Houdini cooking works.

The behavior I want is that the output parameter values in my custom SOP be used exactly as-is, without recooking the custom SOP. Google offers three suggestions:

1) Set the PRM_BEHAVIOR_NORESIM flag on the parameters. Did that, and the SOP doesn't seem to respect it. Is it supposed to, or is this just for DOPs?

2) Use a chop to buffer the values, and chop() instead of ch() in the expression. Sounds good, but I haven't found a way to apply this that doesn't just make the cook loop one node bigger.

3) Share the output values in attributes instead of parameters. This would be really awkward, as the output values don't correspond to any entities in the geometry, so I'd have to contrive something. I may want to reference the values from a SOP other than the downstream one which has access to the geometry.

What's the cleanest way to break the cook loop?

Houdini 13.0.477 on 2013 Mac Pro with OSX 10.9, if it matters.
User Avatar
Member
7724 posts
Joined: July 2005
Online
glensandness
Got a custom HDK SOP, which contains geometry and cooks on every frame. The SOP generates a set of float output values, which are set in parameters for sharing with other nodes.

Stop right there. You can't do that. Generate them as detail attributes and share those values using detail() expressions. It's not contrived at all, “detail” attributes are global for the whole geometry.
User Avatar
Member
18 posts
Joined: Jan. 2009
Offline
Gave it a try, and it works well in practice. Definitely a clean solution. Thanks, Edward.

This also forced me to read the documentation on attributes more carefully. I've discovered a number of opportunities to clean up my data management.
  • Quick Links