shadowst17 Posted September 15, 2023 Share Posted September 15, 2023 (edited) Hello, I'm trying to run a python script that does some code, runs a TOPS and then waits for said TOPs to finish then continue the rest of the script. Any ideas on how I could go about that? I've tried time but i guess it's on the same thread so it freezes Houdini. Here's a simplified script giving you the gist of what I'm looking for. import hou import time node = hou.selectedNodes()[0] hip = hou.hipFile.path() hou.hipFile.save(hip) node.parm("cookbutton").pressButton() time.sleep(2) cooking = True failed = False while cooking: for i in range(60): if node.getCookState(1) != hou.topCookState.Cooking: print("Cook finished") cooking = False break time.sleep(2) if node.getCookState(1) == hou.topCookState.Cooking: print("Times up") failed = True cooking = False print("Continue the rest of the script") SOLVED: Using the .CookOutputWorkItems(block=True) solved my issue. Edited September 15, 2023 by shadowst17 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.