Influence cmds.mayaHasRenderSetup() without restarting Maya?

Influence cmds.mayaHasRenderSetup() without restarting Maya?

h.schoenberger
Enthusiast Enthusiast
687 Views
4 Replies
Message 1 of 5

Influence cmds.mayaHasRenderSetup() without restarting Maya?

h.schoenberger
Enthusiast
Enthusiast

Hi

 

I would like to know if it is possible to influence the result of the function cmds.mayaHasRenderSetup() without changing prefs files? Is it based on some undocumented global variable?

 

Issue:

We would like to start render scenes with Legacy Layers and Render Setup on the farm.

We start Maya and control it with a script. This script needs to be able to render any scene.

The Maya preferences are the default ones, which means Render Setup is enabled.

 

The Render Setup module needs to be loaded to be able to use it.

But as far as I can see there the Legacy Render setup is always working.

There is only a switch at startup to hide the old UI from the user.

 

In older Maya versions (2016, 2017 first updates, 2018 first updates) it worked fine to change the preferences *after* starting Maya to "Legacy Layers" to influence the mel function mayaHasRenderSetup().

This way we got Maya to render Legacy Layers without issues.

But this is not possible with the latest Maya 2018 updates.

The mel function was changed into cmds.mayaHasRenderSetup(). And this command seems to be implemented into a DLL file, so we cannot check how it it working.

 

If it is not possible to change the result of this function, is is possible to switch to Legacy Layers with an environment variable? (And vice versa as i do not know what Maya saves in the prefs file on close)

0 Likes
Accepted solutions (1)
688 Views
4 Replies
Replies (4)
Message 2 of 5

sean.heasley
Alumni
Alumni

Hi @h.schoenberger

 

It's possible there may have been a code change with a Maya update that is stopping this functionality with your current script.

 

Out of curiosity, do you know what Update for 2018 this stopped working?

 

 

0 Likes
Message 3 of 5

h.schoenberger
Enthusiast
Enthusiast
I am sorry, I do not know which update it was. The old version had the file Maya2018\scripts\others\mayaHasRenderSetup.mel with the function mayaHasRenderSetup(). This function is now in some DLL. I checked the documentation and the function has some flags that we will try, but the help states: "This flag is for internal use only, may change at any time and is unsupported."
0 Likes
Message 4 of 5

sean.heasley
Alumni
Alumni

Hi @h.schoenberger

 

Ah ok then yeah like that flag said it's possible that there was an internal change that has stopped this from working.

 

Feel free to play around with the flags and see if you are able to get it working.

 

If you can't get it to function however, I'll pass your question along to our developers and see if there is a workaround or if this is now by design.

 

Let me know if anything changes!

 

 

0 Likes
Message 5 of 5

h.schoenberger
Enthusiast
Enthusiast
Accepted solution
Hi Yes, I got it working with the new command cmds.mayaHasRenderSetup(edit = True, enableCurrentSession = False) But as the help writes that this one is unsupported and might change, I would like to request that it does not change 🙂 At least that part of the command I am using. I would expect that you want to get rid of the old render layer system at some point, but for now some of our customers are still using it. thanks