Python pre/post- render

   207   1   0
User Avatar
Member
1 posts
Joined: Jan. 2022
Offline
hey everyone , i have a small issue that i can't figure it out , i'm trying to automate the Proxy meshes swap for rendering , i made a script for that , it refreshes and switches index based on the OP (pre-render/post-render) , when i tried it without loop for one single switch it worked just fine , but after adding the loop no errors occurs but only renders the Proxies .
any help or idea would be appreciated .



import hou  


parent_node = hou.node("/obj/tst_proxy") 


for node in parent_node.allSubChildren():
    if node.type().name() == "GFX_Proxy_Switch": 
        parm = node.parm("newparameter")
        
        if parm:
            parm.set(2)  
            print(f"Set parameter 'newparameter' to 2 for node: {node.path()}")
            
            
            node.cook(force=True)
            print(f"Recooked node: {node.path()}")
        else:
            print(f"Parameter 'newparameter' not found on node: {node.path()}")
User Avatar
Member
2633 posts
Joined: June 2008
Offline
You may want to re-tool your network to work with TOPs for that.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links