Previous Thread  Next Thread

chat icon How to set dimension of rendered image?

obmana

Posted: Sat Jun 30, 2012 10:46 am
Joined: 30 Jun 2012
Posts: 1
Hi,

I render a scene from Python:

Code:
bpy.ops.render.render()


and get image with dimension 960x540 or similar. How can I set resolution of rendered image to be 640x480 for example, without using GUI?

Thanks
Reply with quote


clayh

Posted: Mon Jul 09, 2012 9:08 pm
Joined: 06 Jul 2012
Posts: 1
Do something like this before rendering the scene:

Code:
# Get the scene
scene = bpy.data.scenes["Scene"]

# Set render resolution
scene.render.resolution_x = 64
scene.render.resolution_y = 32
scene.render.resolution_percentage = 100
Reply with quote


CoDEmanX

Posted: Tue Jul 10, 2012 7:51 pm
Joined: 05 Apr 2009
Posts: 698
replace
Code:
scene = bpy.data.scenes["Scene"]

by
Code:
scene = bpy.context.scene


and it will always take the current scene
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group