Skip to content

Instantly share code, notes, and snippets.

@jamesrobinsonvfx
Created July 20, 2021 03:53
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/058ac44d400db20286691254ddc06f1f to your computer and use it in GitHub Desktop.
Save jamesrobinsonvfx/058ac44d400db20286691254ddc06f1f to your computer and use it in GitHub Desktop.
Set viewport to camera
import toolutils as tu
viewer = tu.sceneViewer()
viewports = viewer.viewports()
cam = hou.node("/obj/rendercam")
# There are always 4 viewports!
# https://www.sidefx.com/forum/topic/38171/#post-174454
for vp in viewports:
vp.setCamera(cam)
@jamesrobinsonvfx
Copy link
Author

This is useful wrapped up as a utility function to quickly switch between cameras via script (multi-shot workflow, etc)

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