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 CLOSED
 
Thread Tools Search this Thread Display Modes
Old 05 May 2003   #1
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???


David
 
Old 05 May 2003   #2
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
 
Old 12 December 2003   #3
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.

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

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

Thanks
__________________
Fix it in pre.
 
Old 12 December 2003   #4
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!
__________________
-:macaroniKazoo:-
 
Old 12 December 2003   #5
@dmeyer

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:
http://www.cgtalk.com/showthread.php?threadid=106829


HIH
s
 
Old 01 January 2006   #6
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.
 
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 02:59 PM.


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