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.

How to remove an override with python?

How to remove an override with python?

h.schoenberger
Enthusiast Enthusiast
1,762 Views
3 Replies
Message 1 of 4

How to remove an override with python?

h.schoenberger
Enthusiast
Enthusiast

Hi

How can I delete an override in a render setup layer with python?

 

 

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

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

You should be able to get the overrides with:

 

maya.app.renderSetup.model.utils.getOverridesRecursive(layer)

 

and delete them with:

 

maya.app.renderSetup.model.override.delete(override)

 

Yours,

Li

Message 3 of 4

h.schoenberger
Enthusiast
Enthusiast

Thanks that worked.

 

Why are these functions not documented?

E.g. try to search for getOverridesRecursive in the help files  http://help.autodesk.com/view/MAYAUL/2017/ENU/

0 Likes
Message 4 of 4

Anonymous
Not applicable

Do you have any sample code of you using this? 

 

I cannot seem to get it working if I pass the name of a render layer to:

 

maya.app.renderSetup.model.utils.getOverridesRecursive(layer)

 

Never mind - I figured it out:

 

import maya.app.renderSetup.model.renderSetup as renderSetup
import maya.app.renderSetup.model.utils as utils
import maya.app.renderSetup.model.override as ov

 

 

rs = renderSetup.instance()

layers = rs.getRenderLayers()


for layer in layers:
print layer
for i in utils.getOverridesRecursive(layer)

ov.delete(i)