Darius1989
07 July 2012, 09:36 AM
Hello
Right a little about my background in coding... I did some scripts in maxscript back in the day. I looked over maya in recent months and now I decided to easy my live with a bit of python for maya...
I run in to few issues - which I will post here as I go but as start I have a little problem getting to work creating Layer Ovverides in render settings. Its something I'd like to set up for easy scene set up... Here is my python start and error I get... any hints where I went wrong ?
import maya.cmds as cmds
import maya.mel as mel
#Common
cmds.setAttr ('defaultRenderGlobals.enableDefaultLight', 0);
#Features
cmds.setAttr ('miDefaultOptions.scanline', 0);
#Quality
cmds.editRenderLayerAdjustment('miDefaultOptions.minSamples', 0);
cmds.setAttr('miDefaultOptions.minSamples', 2);
cmds.setAttr('miDefaultOptions.maxSamples', 2);
cmds.setAttr('miDefaultOptions.filter', 2);
I get this error
# Error: line 1: No object matches name: 0
# Traceback (most recent call last):
# File "<maya console>", line 12, in
# ValueError: No object matches name: 0 #
// Result: scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|formLayout40|tabLayout2|formLayout65|cmdScrollFieldExecuter8 //
mentalRayOptionsCheckRenderer;miUpdateRenderQualityMenu scanline;
control -edit -enable true miMinSampleCtrl;
// Result: miMinSampleCtrl //
Now I was tring to change the 0 number at the end to 1/2 and erase it but I always get error :/
cmds.editRenderLayerAdjustment('miDefaultOptions.minSamples', 0);
Any hints where I went wrong? :s
Thanks, bye.
Right a little about my background in coding... I did some scripts in maxscript back in the day. I looked over maya in recent months and now I decided to easy my live with a bit of python for maya...
I run in to few issues - which I will post here as I go but as start I have a little problem getting to work creating Layer Ovverides in render settings. Its something I'd like to set up for easy scene set up... Here is my python start and error I get... any hints where I went wrong ?
import maya.cmds as cmds
import maya.mel as mel
#Common
cmds.setAttr ('defaultRenderGlobals.enableDefaultLight', 0);
#Features
cmds.setAttr ('miDefaultOptions.scanline', 0);
#Quality
cmds.editRenderLayerAdjustment('miDefaultOptions.minSamples', 0);
cmds.setAttr('miDefaultOptions.minSamples', 2);
cmds.setAttr('miDefaultOptions.maxSamples', 2);
cmds.setAttr('miDefaultOptions.filter', 2);
I get this error
# Error: line 1: No object matches name: 0
# Traceback (most recent call last):
# File "<maya console>", line 12, in
# ValueError: No object matches name: 0 #
// Result: scriptEditorPanel1Window|TearOffPane|scriptEditorPanel1|formLayout37|formLayout39|paneLayout1|formLayout40|tabLayout2|formLayout65|cmdScrollFieldExecuter8 //
mentalRayOptionsCheckRenderer;miUpdateRenderQualityMenu scanline;
control -edit -enable true miMinSampleCtrl;
// Result: miMinSampleCtrl //
Now I was tring to change the 0 number at the end to 1/2 and erase it but I always get error :/
cmds.editRenderLayerAdjustment('miDefaultOptions.minSamples', 0);
Any hints where I went wrong? :s
Thanks, bye.