Using hou.node().cook(force=True) on TOP nodes

   6467   2   0
User Avatar
Member
7 posts
Joined: July 2017
Offline
Hi everyone,

I am trying to cook a houdini node with python script, by getting a node “end_node” with hou.node(“../path/to/that/node”), and then use end_node.cook(force=True) to get it to cook. To test it, there is a file saving node before the end_node, so if it runs successfully, the script will save a file.

This works well with geo network. However, when I tried to implement this in TOP network, the python could get the end_node, print the name of that node, but it does not save a file. I am using a ROP Geometry Output node as the end_node.

Does hou.node().cook() work with TOP network? If it does, how should I organize the script?

Many thanks!
User Avatar
Member
31 posts
Joined: Aug. 2015
Offline
https://www.sidefx.com/forum/topic/68141/?page=1#post-289575 [www.sidefx.com]
User Avatar
Member
7 posts
Joined: July 2017
Offline
X_H_N
https://www.sidefx.com/forum/topic/68141/?page=1#post-289575 [www.sidefx.com]

Thank you so much! It solved the problem

———————-
For anyone looking at this thread in the future, here is what I did –

Initially when the code works in SOP, it was
node = hou.node(node_path)
node.cook(force=True)

Now for the TOP version, it is
node = hou.node(node_path)
node.cook(force=True)
node.executeGraph(False, True, False, False)

Basically the TOP graph needs to be cooked, so the PDG graph would exist and could be executed.
Edited by lzl - Aug. 19, 2019 00:11:45
  • Quick Links