<p>You need the MTypeId of the override you want to create. Find typeIDs.py in your Maya installation folder (<code>.../lib/python2.7/site-packages/maya/app/renderSetup/model/typeIDs.py</code>)</p>

<p>As you can see, the MTypeId of a shader override is 0x58000386.</p>

<p>Then, just create a layer and a collection, and call your createOverride method:</p>

<pre><code>from maya.app import renderSetup
import maya.api.OpenMaya as OpenMaya

renderSetup.model.renderSetup.initialize()
rs = renderSetup.model.renderSetup.instance()

# Create layer
rsLayer = rs.createRenderLayer('MyFirstLayer')
# Create collection
rsColl = rsLayer.createCollection('MyFirstCollection')
# Create shading override
over_obj = rsColl.createOverride('MyFirstOverride', OpenMaya.MTypeId(0x58000386))
</code></pre>

<p>If you want to create another override, just find the according MTypeId.</p>

<p>Thanks to Fabrice that answered this question here: <a href="https://stackoverflow.com/questions/48305522/maya-python-how-to-create-shaderoverride">https://stackoverflow.com/questions/48305522/maya-python-how-to-create-shaderoverride</a></p>

CC BY-SA 3.0
2018-01-19T11:01:01.190Z
2018-01-19T11:01:01.190Z
Hadrien Huvelle
<p>Using python in Maya 2017, I'm able to reproduce the structure of my render_setup (layers, collections and overrides) except for shaderOverride.</p>

<p>For a classic override, I use the instance function : <code>maya.app.renderSetup.model.collection.Collection.createOverride()</code></p>

<p>Is there a similar command to create a shader override or do you add some specific attributes? </p>

<p>Thanks</p>

<maya>
Maya Python - How to create shaderOverride?
Kevin Lemaire
# Maya Python - How to create shaderOverride?

(Asked by: username_0 on 2018-01-18)

Using python in Maya 2017, I'm able to reproduce the structure of my render\_setup (layers, collections and overrides) except for shaderOverride.

For a classic override, I use the instance function : `maya.app.renderSetup.model.collection.Collection.createOverride()`

Is there a similar command to create a shader override or do you add some specific attributes?

Thanks

**Tags:** maya


---

## 1 answers

### Answer by username_1 on 2018-01-19. Score: 2 | Accepted answer

You need the MTypeId of the override you want to create. Find typeIDs.py in your Maya installation folder (.../lib/python2.7/site-packages/maya/app/renderSetup/model/typeIDs.py)
As you can see, the MTypeId of a shader override is 0x58000386.
Then, just create a layer and a collection, and call your createOverride method:
from maya.app import renderSetup
import maya.api.OpenMaya as OpenMaya

renderSetup.model.renderSetup.initialize()
rs = renderSetup.model.renderSetup.instance()

# Create layer
rsLayer = rs.createRenderLayer('MyFirstLayer')
# Create collection
rsColl = rsLayer.createCollection('MyFirstCollection')
# Create shading override
over_obj = rsColl.createOverride('MyFirstOverride', OpenMaya.MTypeId(0x58000386))

If you want to create another override, just find the according MTypeId.
Thanks to Fabrice that answered this question here: https://stackoverflow.com/questions/48305522/maya-python-how-to-create-shaderoverride


---

