Jump to content

Taking multiple camera screenshots


Ozeuth

Recommended Posts

scene = hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer)
viewport = scene.curViewport()
frame = hou.frame()
# cameras = list of scene cameras
i = 0
for camera in cameras:
    viewport.setCamera(camera)
    flip_options = scene.flipbookSettings().stash()
    flip_options.frameRange((frame, frame))
    #flip_options.beautyPassOnly(True)
    flip_options.cropOutMaskOverlay(True)
    path_name = hou.hipFile.name().split(".")[0]
    if not os.path.exists(path_name):
      os.makedirs(path_name)
    flip_options.output(path_name+"/opening_"+str(i)+".png")
    scene.flipbook(viewport, flip_options)
    i+=1

Hello all, I have a list of cameras. The goal is to view the scene through the cameras, take a screenshot and save them.Untitled1.thumb.png.564ebac592af5832dfbcf38d5c782a03.png

I expect to get results like this, where I am looking through a specific camera, saved.Untitled2.thumb.png.ff4e19670017e5265d6a6872be28bfb9.png

However, though the UI shows us to be looking through the correct viewport, we only ever save out the view from the last ever camera:opening_5.thumb.png.49b81caec11b29ec44d9e313c554eaa4.png

Any advice would be greatly appreciated! I have been unable to find a similar problem online. Thank You

opening_1.png

Edited by Ozeuth
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...