Skip to content

Instantly share code, notes, and snippets.

@p2or
Last active May 21, 2023 18:34
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 p2or/0d6546cdd53aa7a053f34776119d9b0a to your computer and use it in GitHub Desktop.
Save p2or/0d6546cdd53aa7a053f34776119d9b0a to your computer and use it in GitHub Desktop.
New Flipbook based on https://www.sidefx.com/forum/topic/42808/ #Houdini
custom_range = (0,10)
filename = "~/flipbook/flip_$F4.png"
cur_desktop = hou.ui.curDesktop()
scene = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer)
flip_options = scene.flipbookSettings().stash()
flip_options.frameRange(custom_range)
flip_options.output(filename)
scene.flipbook(scene.curViewport(), flip_options)
from time import gmtime, strftime
# GET VIEWPORT CAMERA PATH
cur_desktop = hou.ui.curDesktop()
desktop = cur_desktop.name()
panetab = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer).name()
persp = cur_desktop.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().name()
camera_path = desktop + "." + panetab + "." + "world" "." + persp
# BUILD DEFAULT FILE NAME FROM CURRENT TIME
default_filename = strftime("screenshot_%d_%b_%Y_%H_%M_%S.jpg", gmtime())
# SELECT FILE
filename = hou.ui.selectFile( title='Select Screenshot File', default_value=default_filename, file_type=hou.fileType.Image )
# WRITE TO FILE
if filename is not None:
frame = hou.frame()
hou.hscript( "viewwrite -f %d %d %s '%s'" % (frame, frame, camera_path, filename) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment