menuItemīs "-collection" flag?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  05 May 2003
menuItemīs "-collection" flag?

Hi guys-

I need some help understanding the "-collection" flag in the menuItem command.

I have a script which is dynamically adding menuItems with submenus to a popup menu (it adds menuItems based on cameras and image planes found in the scene). However, Iīm getting errors (only sometimes, strangely) with these submenu menuItems: "Error... : Collection not found, or no current collection."

When the error occurs, it is found in a line that contains a menuItem with a radioButton. I was looking again over the menuItem flags in the MEL docs, and saw the "-collection" flag, although there are no examples of this flag, and the definition of this flag is "-cl/collection string: To explicitly add a radio menu item to a collection." What does that mean? Apparently I should create a collection somewhere and add the menuItems to this collection, but where and how???

  05 May 2003
A collection is an object that binds a group of radio buttons together so that when one turns on, the others turn off. Have a look at the radio button examples in the documentation, then be sure to make a collection object prior to your radio button menu items. Put the menu items in the collection at creation time with the -collection flag and that's all there is to it.

-- Mark
Mark R. Wilkins
author of MEL Scripting for Maya Animators
  12 December 2003
Is it possible to have a button that deselects all the radio buttons in a given radioButtonGrp?

I have an interface tab with several groups of radio buttons, and I'd like to have one "Master Reset" button to return them all to their default, unselected state.

At this time the radioButtonGrp's are not explicitly placed in a collection.

columnLayout -columnWidth 338 -height 312 -width 338`;

-numberOfRadioButtons 2
-label "Blah"
-labelArray2 "Blah1" "Blah2"

Fix it in pre.
  12 December 2003
david: to create a radio button collection, just use:

radioCollection someSortOfName;

and then when you create a radion button, just use:

radioButton -l "oh yeah!" -cl someSortOfName;

hope that helps ya!
  12 December 2003

Quote: Originally posted by dmeyer
Is it possible to have a button that deselects all the radio buttons in a given radioButtonGrp?

by the nature of radiobuttons that is not possible; you can do it with checkboxes though; an example how to make that work you can find in this thread:

  01 January 2006
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright Đ2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:27 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.