Hey!
I have a project setup where alot of images need to render with specific output filenames in specific folders, something that is currently achieved with python scripting MentalRay. I'm now trying to run Octane Render (Maya plug-in) via python scripting and while running it from within Maya, in the "command promt" everything works just fine, however Maya needs to be visually up and running and all the changes made to the scene (layers switching on and off, set by the script) are visually being done.
When running the same script from Windows cmd tho, there's an error. See example below.
Starting a render with mayapy using the command:
"maya.cmds.octane(render=True, layer=layer_name)"
Fails with:
RuntimeError "Octane: progress window already in use..."
Is there any way to run the render without having to actually open up Maya manually?
/Robin
Scripting Octane for Maya (Python)
Moderator: JimStar
You can use the standard Maya's batch render command line tool the same way as with other renderers. Just give it the standard help switch to see all command line switches supported by Octane render.tailorstore wrote:Is there any way to run the render without having to actually open up Maya manually?
And you have the explorer "Render" context menu as an "without starting Maya GUI" option too...
- tailorstore
- Posts: 27
- Joined: Thu Apr 11, 2013 6:46 am
Unfortunately MayaBatch is not an option for us since we are loading hundreds of different textures with associated shadervalues and turning visibility on and off on different objects within the scene. As an example; we're rendering 8 different types of cuffs of a shirt in hundreds of different fabrics. Every fabric has its own shader values (connected with driven keys to a master locator) and all the values are set via "setAttribute" in python script. The whole process is started externally from a webserver so actually clicking on stuff isn't an option, so we need to get everything going without a graphic environment.JimStar wrote:You can use the standard Maya's batch render command line tool the same way as with other renderers. Just give it the standard help switch to see all command line switches supported by Octane render.
And you have the explorer "Render" context menu as an "without starting Maya GUI" option too...
Thanks!
Robin
Batch render command line does not imply the graphic environment. I just gave you the hint what to use according to your first post, where yourtailorstore wrote:The whole process is started externally from a webserver so actually clicking on stuff isn't an option, so we need to get everything going without a graphic environment.
is the same as using batch command line, something like this:tailorstore wrote:Starting a render with mayapy using the command:
"maya.cmds.octane(render=True, layer=layer_name)"
Code: Select all
"c:\Program Files\Autodesk\Maya2013\bin\render" -verb -renderer octane -gpu1 on -of gif -rl MyRenderLayer -cam camera1 -preRender "c:\MayaScenes\PreRenderScript.mel" -postRender "c:\MayaScenes\PostRenderScript.mel" -s 1 -e 10 -smp 8000 -v on "c:\MayaScenes\JustTest.mb"
- tailorstore
- Posts: 27
- Joined: Thu Apr 11, 2013 6:46 am
Hi Jim!
I've recently had some time to tinker with this problem again and I'll try to explain our situation more clearly.
As I said before, we're setting hundreds of different attributes and mess around with layers and cameras etc in a python script. These changes occur before each rendered image. Also, we need to control which combinations actually get rendered. We deny certain combinations to save thousands of renders. (As in "don't render object A if object B is visible" etc)
Today this solution works fine with mentalray, using "maya.cmds.Mayatomr()"
By trial and error we found the command "maya.cmds.octane()" and if we use this command from within Maya it seems to work as a drop-in replacement.
So if you would just implement a parameter to disable the GUI progress window, I don't see why it wouldn't work with our scripting environment as well.
I've recently had some time to tinker with this problem again and I'll try to explain our situation more clearly.
As I said before, we're setting hundreds of different attributes and mess around with layers and cameras etc in a python script. These changes occur before each rendered image. Also, we need to control which combinations actually get rendered. We deny certain combinations to save thousands of renders. (As in "don't render object A if object B is visible" etc)
Today this solution works fine with mentalray, using "maya.cmds.Mayatomr()"
By trial and error we found the command "maya.cmds.octane()" and if we use this command from within Maya it seems to work as a drop-in replacement.
So if you would just implement a parameter to disable the GUI progress window, I don't see why it wouldn't work with our scripting environment as well.