Render Setup commands documentation

InvisioMedia
Contributor

Render Setup commands documentation

InvisioMedia
Contributor
Contributor

Hi,

  I think some better documentation is now needed on the render setup commands.  Just writing help() with the module is absolutely not helping me, the API is obscure and the docstrings are barely readable for me..

 

  The MASH Api documentation pages are super well made and should be taken as a model to follow if I can suggest:

https://help.autodesk.com/cloudhelp/2018/ENU/Maya-Tech-Docs/MASH/MASH.html

 

  That being said, how can I create a material override in python, associated with a collection?  I have been able to create my layer and collection but spent the day wandering without being able to do it.  I know what type nodeType 'materialOverride' is, but it seems it's useless to know this in this situation, it doesn't appear anywhere in the node editor...  No way to get hints with the Echo All function of the script editor neither.

 

  Thanks for your help!!

0 Likes
Reply
Accepted solutions (2)
2,243 Views
6 Replies
Replies (6)

lanh.hong
Alumni
Alumni
Accepted solution

Hi,

 

The docs for the Render Setup Python API can be found here:

http://help.autodesk.com/view/MAYAUL/2019/ENU//?guid=GUID-FFC3298A-9803-4EAF-B472-D13247319EB0 

 

The API is unsupported and does not have any official documentation. What usually will help is to look at the Python files located in ..\Python\Lib\site-packages\maya\app\renderSetup

 

Here's a sample on how to create a material override.

import maya.app.renderSetup.model.renderSetup as renderSetup

rs = renderSetup.instance() 

# Create render layer and collection
rl = rs.createRenderLayer("MyRenderSetupLayer")
c = rl.createCollection("MyCollection")

# Create material override
materialOverride = c.createOverride("MyMaterialOverride", "materialOverride")

Regards,

Lanh


Lanh Hong
Developer Technical Services
Autodesk Developer Network



lanh.hong
Alumni
Alumni
Accepted solution

BTW createOverride method can be found in ..\Python\Lib\site-packages\maya\app\renderSetup\model\collection.py

 


Lanh Hong
Developer Technical Services
Autodesk Developer Network



InvisioMedia
Contributor
Contributor

Yes that's perfect, thank you so much.  Indeed, it's impossible to know what argument is expected in createOverride() with only the help() python function (the doc strings suggested by the maya help).  It took me 2 days to find this simple line of command, a little bit frustrating...

 

I should be good with the "\Python\Lib\site-packages\maya\app\renderSetup\model", thank you!  Some documentation would be welcomed, it's not very intuitive to dig in the maya installation python scripts for documentation and help.

0 Likes

Sigrid.mohn
Contributor
Contributor

agree that some more documentation could be handy I keep hitting a wall in what I would think should be super simple. Currently I am struggling with renaming already created render layers..

0 Likes

bdewalleDD7LQ
Contributor
Contributor

I strongly agree. The link provided above (https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Maya-Ren...) is not a documentation but a set of exemples.

 

A lot of stuff are not covered, and we should not have to retro - engineer maya api methods...

0 Likes

wrenA5JDC
Observer
Observer

Does anyone happen to have the Command to add a Render Settings Collection for all the overrides in the globals? I'm trying to create a custom python that will create a render layer that will contain specific Absolute render overrides for things like min and max samples.

0 Likes