Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Forcing viewport redndering engine

Forcing viewport redndering engine

Anonymous
Not applicable
1,550 Views
2 Replies
Message 1 of 3

Forcing viewport redndering engine

Anonymous
Not applicable

For compatibility issues, we need to force users to use Viewport 2.0 with the 'OpenGL - Legacy' rendering engine (as it's in preferences->display->viewport 2.0).

 

We're in a studio situation, relying on user preferences is not sufficient. Any suggestions on how to force this at startup via a script, cmd-line option environment variable, etc... I can't find any documentation on it.

 

Using maya.cmds.modelEditor doesn't work as the only options are: [u'Viewport 2.0 (OpenGL)', u'Default Quality Rendering', u'High Quality Rendering', u'Stub Renderer'].

 

Cheers,

 

Jesse

0 Likes
Accepted solutions (1)
1,551 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

Hi Jesse,

 

I think what you are looking for is the following mel script:

 

setRenderingEngineInModelPanel "OpenGLLegacy"

Had to force my users to use the directx11 rendering engine over here and this was the solution

 

cheers!

Message 3 of 3

Anonymous
Not applicable

Thanks, that led me in the correct direction.

 

I'm using 

 

 maya.cmds.optionVar( stringValue = ( 'vp2RenderingEngine' , renderingEngine    ) )

to force the rendering engine. If it's called in the userSetup, Maya doesn't need to be restarted. If Maya has already finished launching, it will require a restart. Setting the optionVar directly avoids the restart prompt.

 

It takes one of the following values: 'OpenGLLegacy' , 'OpenGLCoreProfileCompat', 'OpenGLCoreProfile'

 

If you give it any other value it defaults to OpenGLLegacy

0 Likes