Jump to content

Python: Save out render snapshots


TomRaynor

Recommended Posts

Working late, got loads of WIP renders that I have been doing all day and wish I had a script that would take all of my render snapshots and save them out as exr files to the local "pic" folder rather than me having to manually right click on each one and save them out.

Anyone up for a little python challenge?

Link to comment
Share on other sites

Hi Tom. There is not much you can do with this in python/hscript. However, you can save current image from IPR view. Here a little python function i wrote. It's a bit hacky, and not very fast, but it works.


import hou
image_path = r'C:\temp\ipr.png'
def saveIPRImage():
desk = hou.ui.curDesktop()
ipr = desk.paneTabOfType(hou.paneTabType.IPRViewer)
resx, resy = ipr.imageResolution()
pixdata = []
for py in reversed(range(resy)):
for px in reversed(range(resx)):
pixdata.extend(ipr.pixel('C', px, py))
hou.saveImageDataToFile(pixdata, resx, resy, image_path)
[/CODE]

Unfortunately, there is no way to get access to IPRview snapshots from python/hscript. :(

Edited by Stalkerx777
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...