PDA

View Full Version : What is the right Name of miDefaultOptions.AmbientOcclusion?


sisqosnew
02-01-2011, 08:06 AM
Hello, everyone.
(Q)What is the current option name of miDefaultOptions.AmbientOcclusion?
I used MEL to set renderGlobal for rendering, but I can't use this mel to set attribute:

setAttr "miDefaultOptions.ambientOcclusion" 1;
//1 means Turn On

the mel will get an error:
// Error: No object matches name: miDefaultOptions.ambientOcclusion //

"Ambient Occlusion" option is in Features of renderGlobal.

Thanks for reading.
Tony

haggi
02-01-2011, 08:37 AM
The reason is: There is no spoon ehh.... there is no such attribute. Ambient occlusion is defined by a string option. By default (in maya2011) it is string option number 9. So this


setAttr -type "string" miDefaultOptions.stringOptions[9].value "false";

Will turn it off while

setAttr -type "string" miDefaultOptions.stringOptions[9].value "true";

will turn it on. Maybe it could be useful to loop through the string options list and check for the name of the option to ensure that you modify the correct value.

CGTalk Moderation
02-01-2011, 08:37 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.