Created
April 8, 2015 19:18
-
-
Save erfannoury/76c839b96ebd17aa2102 to your computer and use it in GitHub Desktop.
A sample script for rendering scenes in Poser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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