Simple render in arnold not working with python or mel

Simple render in arnold not working with python or mel

joao_ferreira7SMZH
Explorer Explorer
692 Views
0 Replies
Message 1 of 1

Simple render in arnold not working with python or mel

joao_ferreira7SMZH
Explorer
Explorer

Hey guys, anyone could help me explaning why these approaches are not working for render a single frame in arnold?
My goal is simple:

  1. render the given camera with the given resolution using arnold
  2. save it in .exr in a given path

Please if you can, take a loot at my attempts codes:

 

# WORKING:
cmds.setAttr("defaultRenderGlobals.currentRenderer", "arnold", type="string")

output_path = "C:\\Users\\joao\\Desktop\\apresentacao\\renders\\render4.exr"
cmds.setAttr("defaultRenderGlobals.imageFilePrefix", output_path, type="string")
cmds.setAttr("defaultRenderGlobals.imageFormat", 51)

cmds.setAttr("defaultResolution.width", 1920)
cmds.setAttr("defaultResolution.height", 1080)

cmds.setAttr("defaultArnoldDriver.aiTranslator", "exr", type="string")

# NOT WORKING: it doesnt generate a proper image file, because its not openable in any software
cam = "persp"
cmds.render(cam)

# NOT WORKING: it doesnt respect the correct camera name ("front in this case")
mel.eval('renderWindowRenderCamera render renderView "front";')
mel.eval('renderWindowEditor -edit -writeImage "C:\\qwe.exr" renderView;')

# NOT WORKING: it renders with arnold, but I couldnt find how to change the camera
mel.eval('renderSequence;')

 

thanks a lot!

 

https://discourse.techart.online/t/render-a-single-frame-in-maya-with-arnold-not-working/16490

 

0 Likes
693 Views
0 Replies
Replies (0)