Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple render in arnold not working with python or mel

0 REPLIES 0
Reply
Message 1 of 1
joao_ferreira7SMZH
565 Views, 0 Replies

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

Simple render in arnold not working with python or mel

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 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report