Render script


#1

I’m writing a rendering script, and I have a couple of problems.

When I set the defaultRenderGlobals.imageFilePrefix to an arbitrary directory, maya adds ‘_tmp’ to the end of the file name.

When I call

cmds.render()

It renders a mesh with a standard shading, but it doesn’t render a mesh with my custom (plugin) hardware shader. If I press within the UI the ‘render the current frame’ button, then the rendering is fine.


#2

About 2, following

https://knowledge.autodesk.com/support/maya/troubleshooting/caas/sfdcarticles/sfdcarticles/Batch-rendering-through-the-render-view-window-in-Maya.html

this does a full render which works for my shader

mel.eval('renderWindowRenderCamera render renderView front;') # from renderWindowPanel.mel