Setting Executables via Paramaters

If you are seeking for help, this is the right place to ask!

Setting Executables via Paramaters

Postby FruehBird » 26 Jun 2017, 17:00

Is it possible to set the executable path using a Parameter?

Reason being is now that MODO is releasing new versions at such a high rate our render management is getting overloaded with renderers. It would be nice to set one renderer per major release. for example: MODO 10 has had 10.0v1, 10.1v1, 10.2v1, 10.2v2, 10.2v3, and 10.2v4. It would be nice to set this through our custom submitter.
FruehBird
 
Posts: 11
Joined: 29 Feb 2016, 21:59

Re: Setting Executables via Paramaters

Postby FruehBird » 06 Jul 2017, 17:57

~Bump~

New version released again. Any way to make this possible?
FruehBird
 
Posts: 11
Joined: 29 Feb 2016, 21:59

Re: Setting Executables via Paramaters

Postby Shoran Support » 07 Jul 2017, 12:01

Not really sure what you want to do exactly. If you want to have a renderer parameter that selects the executable to use, you have to perform the entire command-line compilation via Python scripting yourself. So it is possible in theory, but rather cumbersome.
User avatar
Shoran Support
RenderPal Team
 
Posts: 1156
Joined: 11 Apr 2008, 00:35
Location: Germany

Re: Setting Executables via Paramaters

Postby FruehBird » 07 Jul 2017, 16:16

Shoran Support wrote:Not really sure what you want to do exactly.


For each new MODO there is a new executable for rendering. For example the latest is: C:\Program Files\Luxology\modo\11.1v1\modo_cl.exe

The executable parameter is only settable through the render management window. (As far as I know)

So for Modo 10 I have had to create 7 production renderers just to change the executable path for that version.
C:\Program Files\Luxology\modo\10.0v1\modo_cl.exe
C:\Program Files\Luxology\modo\10.1v1\modo_cl.exe
C:\Program Files\Luxology\modo\10.1v2\modo_cl.exe
C:\Program Files\Luxology\modo\10.2v1\modo_cl.exe
C:\Program Files\Luxology\modo\10.2v2\modo_cl.exe
C:\Program Files\Luxology\modo\10.2v3\modo_cl.exe
C:\Program Files\Luxology\modo\10.2v4\modo_cl.exe

If I could pass a variable to replace the version number I could then just have a renderer for the 10 series as a whole.
C:\Program Files\Luxology\modo\$(Version)\modo_cl.exe


Regarding the entire command line via python. Is there some documentation as to the syntax for that and where in the renderer the code goes? It looks like I would need to use the CompileCommandLineSwitch() are there any examples of this?
FruehBird
 
Posts: 11
Joined: 29 Feb 2016, 21:59

Re: Setting Executables via Paramaters

Postby Shoran Support » 07 Jul 2017, 16:54

You can use the GetExecutable event for this. Our manual contains plenty of information about the renderer scripting API. You should also take a look at some renderers that make use of the scripting capabilities (3dsMax, for example).
User avatar
Shoran Support
RenderPal Team
 
Posts: 1156
Joined: 11 Apr 2008, 00:35
Location: Germany

Re: Setting Executables via Paramaters

Postby FruehBird » 07 Jul 2017, 23:52

Thanks for pointing me towards the GetExecutable event.

I still can't seem to get it to work:
Code: Select all
from RenderPal import *
from RenderSystem import *

def GetExecutable(renderSet, result):
   
   mVersion = renderSet.GetValue("mVersion")
   
   exePath = "C:\Program Files\Luxology\modo\\"+mVersion+"\modo_cl.exe"
   result.Set(exePath)
   print exePath
   
   return exePath


The exe that is used is still the one set in the Executables Tab and setting that to nothing results in an error. Do I have the correct syntax here?
FruehBird
 
Posts: 11
Joined: 29 Feb 2016, 21:59

Re: Setting Executables via Paramaters

Postby Shoran Support » 08 Jul 2017, 10:08

You have to return rpTrue, not the exePath.
User avatar
Shoran Support
RenderPal Team
 
Posts: 1156
Joined: 11 Apr 2008, 00:35
Location: Germany

Re: Setting Executables via Paramaters

Postby FruehBird » 10 Jul 2017, 16:35

Wonderful :) That worked.

For anyone looking to do the same here is the code I used:
Code: Select all
from RenderPal import *
from RenderSystem import *

def GetExecutable(renderSet, result):
   
   # Retrieve MODO Version from renderSet (Custom Flag)
   mVersion = renderSet.GetValue("mVersion")
   
   # Use Version to build Executable path ("11.1v1")
   exePath = "C:\\Program Files\\Luxology\\modo\\%s\\modo_cl.exe" % mVersion
   
   # Set The path as the resulting executable
   result.Set(exePath)
   
   return rpTrue
FruehBird
 
Posts: 11
Joined: 29 Feb 2016, 21:59


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests