Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 22-10-2015 , 03:09 PM
Registered User
Join Date: Oct 2015
Posts: 4

Basic MEL

Hi

Having moved onto Maya LT and lost Python, I'm struggling with MEL.

This seems really basic but I cannot work it out. I am creating a window with 4 check boxes and I want the 'Reset' button to set them all to be 0. Simple I thought.

I continually get the 'Object's name is not unique' when attempting to set the checkBoxGrp object. I can happily query it though.

Any help would be much appreciated.
Thanks!

{
string $window = `window
-widthHeight 450 150`;
columnLayout -adjustableColumn true;
checkBoxGrp
-numberOfCheckBoxes 4
-labelArray4 "One" "Two" "Three" "Four"
drawModeCheck;
button -label "Reset" -command "funcclear" -bgc 0.8 0.0 0.0;
button -label "Close" -command ("deleteUI -window " + $window);
separator -height 10 -style "in";
setParent ..;
showWindow $window;
}

global proc funcclear()
{
string $adVal = `checkBoxGrp -query -v1 drawModeCheck`;
print $adVal;

checkBoxGrp -va4 0 0 0 0 -ed 1 drawModeCheck;
}

# 2 22-10-2015 , 08:14 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
In the highlighted line you forgot the "-e" or -edit flag after the command name so it's in the default create mode. Maya thinks you're trying to create another control with the name "drawModeCheck".

Code:
global proc funcclear()
{
string $adVal = `checkBoxGrp -query -v1 drawModeCheck`;
print $adVal;

checkBoxGrp -va4 0 0 0 0 -ed 1 drawModeCheck;
}
correct code would be:

Code:
checkBoxGrp -e -va4 0 0 0 0 -ed 1 drawModeCheck;


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 3 26-10-2015 , 02:01 PM
Registered User
Join Date: Oct 2015
Posts: 4
Perfect! Thanks for you help.

I am sure I had tried that but I must have had it in the wrong place in the line.

Appreciate the assistance user added image

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads