Creating overrides for renderlayer in rendersetup

94 views
Skip to first unread message

Sigrid Mohn

unread,
Aug 8, 2019, 10:13:46 AM8/8/19
to Python Programming for Autodesk Maya
Hi

I am fairly new to Python within Maya so plz be a bit patient with me here:)
I am trying to  develop a script as part of our render setup to create some simple overrides and honestly I am kind of surprised I am stuck on thisXD

It works when I make them like this:
rl_env = rs.createRenderLayer("Sh0020" + '_env_beauty_v02')
rl_env
.createAbsoluteOverride('Aov_switch','Prod_AOV_Switch',0);  

but the renderlayers are created at a different stage so this isn't really a solution for me so I need a way to access the renderlayers. But when I try to add the rendelayer name instead it does not work. 

eg:

"Sh0020_env_beauty_v02"+.createAbsoluteOverride('Aov_switch','Prod_AOV_Switch',0)

This is probably super basic and I am probably a blond moron to not see the answer but now I have searched and googled everywhere without getting anywhere. 

Any suggestions are appreciated:)

Sigrid Mohn

unread,
Aug 8, 2019, 10:19:16 AM8/8/19
to Python Programming for Autodesk Maya
I forgot to add the imported modules:P

import maya.cmds as mc
import maya.app.renderSetup.model.override as override
import maya.app.renderSetup.model.renderLayer as renderLayer
import maya.app.renderSetup.model.renderSetup as renderSetup
rs
= renderSetup.instance()

Sigrid Mohn

unread,
Aug 9, 2019, 7:14:07 AM8/9/19
to Python Programming for Autodesk Maya
okay incase there is someone with the same issue it seems I have found an answer:)

layers = rs.getRenderLayers()

for layer in layers:
    layerName
= layer.name() #this will give the actual name of the render layer
    layer
.createAbsoluteOverride('Aov_switch','Prod_AOV_Switch',0)

There still seems to be an issue with the override not being given the value I am adding, but at least it is a minimal issue now:)
Reply all
Reply to author
Forward
0 new messages