trying to render using mayapy

636 views
Skip to first unread message

coffeeDan

unread,
May 14, 2009, 10:34:41 PM5/14/09
to python_inside_maya
hi , I am lost.

I try to render using the following, but it always says :
"Warning: Camera is not renderable at this time; skipping image //
projects/default/testPyRender.bmp."

import maya.standalone
maya.standalone.initialize(name='python')
import maya.cmds as cmds

cmds.file('c:/download/mel/testPyRender.mb',o=True)
cam = cmds.camera(centerOfInterest=100, focalLength=35, lsr=1,
cameraScale=1, horizontalFilmAperture=1.41732, \
horizontalFilmOffset=0,
verticalFilmAperture=0.94488, verticalFilmOffset=0, \
filmFit='Fill', overscan=1, motionBlur=0,
shutterAngle=144, nearClipPlane=0.1, \
farClipPlane=1000000, orthographic=0,
orthographicWidth=30)
cmds.setAttr(cam[1] + ".backgroundColor", type="double3 0.8 0.8 0.8")
cmds.setAttr('defaultRenderGlobals.imageFormat',20)
renderedImg = cmds.render(cam[0], x=256, y=256)
cmds.sysFile(renderedImg, rename='c:/download/mel/moinmoin.bmp')

coffeeDan

unread,
May 14, 2009, 10:37:14 PM5/14/09
to python_inside_maya
the complete message is :

Rendering using 2 threads.
A default light has been created, modify
defaultRenderGlobals.enableDefaultLight to change this behavior.
Automatic near/far clipping values: 0.1, 6.57709.
Starting Rendering //projects/default/testPyRender.bmp.

Chad Dombrova

unread,
May 14, 2009, 11:34:26 PM5/14/09
to python_in...@googlegroups.com
i haven't had a chance to test your script yet, but have you tried
forcibly enabling the canera's renderable attribute?

-chad
Reply all
Reply to author
Forward
0 new messages