Skip to content

Instantly share code, notes, and snippets.

@erfannoury
Created April 8, 2015 19:18
Show Gist options
  • Save erfannoury/76c839b96ebd17aa2102 to your computer and use it in GitHub Desktop.
Save erfannoury/76c839b96ebd17aa2102 to your computer and use it in GitHub Desktop.
A sample script for rendering scenes in Poser
import poser
import string
import os
scene = poser.Scene()
scene.CurrentFireFlyOptions().SetShadows(0)
scene.LoadLibraryCamera('C:/Users/Public/Documents/Poser Pro 2014 Content/Runtime/Libraries/Camera/cameras.cm2')
rootDir = 'G:/University Central/IPLab/Datasets/Final Mocap Files/02/02_02/'
format = '.png'
numFrames = scene.NumFrames()
scene.SetCurrentRenderEngine(poser.kRenderEngineCodePREVIEW)
for cam in scene.Cameras():
if cam.Name().startswith('cam'):
scene.SetCurrentCamera(cam)
for frm in range(numFrames):
scene.SetFrame(frm)
scene.Render()
fileName = rootDir + cam.Name() + '/' + string.zfill(frm, 5) + format
directory = os.path.dirname(fileName)
if not os.path.exists(directory):
os.makedirs(directory)
scene.SaveImage('png', fileName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment