Skip to content

Instantly share code, notes, and snippets.

@jamesrobinsonvfx
Last active March 9, 2023 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesrobinsonvfx/2d773b45c61452a592dc6fff28db6fbc to your computer and use it in GitHub Desktop.
Save jamesrobinsonvfx/2d773b45c61452a592dc6fff28db6fbc to your computer and use it in GitHub Desktop.
Toggle Manual Mode in Houdini
def toggle_manual():
"""Toggle cook mode"""
current_mode = hou.updateModeSetting()
auto = (hou.updateMode.AutoUpdate, hou.updateMode.OnMouseUp)
toggle_cook = hou.shelves.tool("toggle_manual")
toggle_cook.setLabel("Auto Update")
if current_mode in auto:
hou.setUpdateMode(hou.updateMode.Manual)
toggle_cook.setIcon("MISC_cook")
elif current_mode == hou.updateMode.Manual:
hou.setUpdateMode(hou.updateMode.AutoUpdate)
toggle_cook.setIcon("BUTTONS_do_not")
toggle_cook.setLabel("Manual Mode")
with hou.undos.disabler():
toggle_manual()
@jamesrobinsonvfx
Copy link
Author

Updated to exclude this from the undo stack (super annoying when trying to debug something heavy!), and added John Hughes' nifty icon switching logic

@jamesrobinsonvfx
Copy link
Author

Make sure the tool is called toggle_manual wherever you've saved it.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment