Problem referencing node using pre-render script in topnet

   489   2   1
User Avatar
Member
34 posts
Joined: Nov. 2018
Offline
I'm working on an HDA (at the OBJ level) that contains a number of geometry SOPs, materials and render presets using TOPs. I'd like to use a pre-render script on a ROP USD Output TOP to set a parameter on the HDA itself before outputting.

Some info:
  • The parameter I would like to set is called "disablesim".
  • The USD Output TOP is two levels deep inside the HDA.
  • The HDA is named "main".

My assumption is that this would work as a pre-render script:
hou.node("../..").parm("disablesim").set(0)

... but it gives me an error:
AttributeError: 'NoneType' object has no attribute 'set'

An absolute reference works:
hou.node("/obj/main").parm("disablesim").set(0)

But I can't use it for a few reasons:
  1. The HDA isn't always at the same path, nor is it always named the same way.
  2. There is some process happening in Houdini that converts the path to relative every time I save the hip or HDA, which breaks the reference at render time.

How do I set the value of a parameter in a pre-render script inside a topnet?
Edited by davidbk - Nov. 4, 2025 21:37:06
User Avatar
Member
9687 posts
Joined: July 2007
Offline
davidbk
My assumption is that this would work as a pre-render script:
hou.node("../..").parm("disablesim").set(0)
... but it gives me an error:

the node that the pre-render script is executed from is ropusd/ropnet1/usd1 so another 2 levels inside

all relative paths should be from that node and not from the ROP USD Output, so in your case something like
hou.node("../../../..").parm("disablesim").set(0)

alternatively you can also use Wedge ROP and its Push mechanism for TOPs to automatically set specific values to specific parameters when cooking
Edited by tamte - Nov. 4, 2025 22:08:40
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
34 posts
Joined: Nov. 2018
Offline
@tamte Thank you! I will give this a try.
  • Quick Links