UI button command

Become a member of the CGSociety

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

Thread Tools Display Modes
  03 March 2005
UI button command

I am looking for some syntax help in attaching commands that have to do with window pane display. Example: Button/checkbox to toggle joints/geometry/curves/etc...

Heres the first way I tried it :

 frameLayout -w 450 -l "Visibility" -cll true -cl false -bs "etchedOut";
checkBox -l "Curve Visibility" -al left
			 -occ "string $activePanel = `getPanel -underPointer`; 
if(`modelEditor -q -nurbsCurve $activePanel `!=0)modelEditor -e -nurbsCurve 0 $activePanel ; 
else modelEditor -e -xray 1 $activePanel ;";

and I tried adding the if/else statement before UI and calling if variable is 0 or 1 and change to 1 or 0 and that didnt work either.......this is possible right?
  03 March 2005
okay, here`s the code:


frameLayout -w 450 -l "Visibility" -cll true -cl false -bs "etchedOut";
checkBox -l "Curve Visibility" -al left -cc "string $activePanel = `getPanel -wf`; int $value = `modelEditor -q -nurbsCurves $activePanel`;$value = $value==0 ? 1 : 0; modelEditor -e -nurbsCurves $value $activePanel;";


instead of -underPointer use -withFocus ( -wf ) in order to work properly
the $value = $value==0 ? 1 : 0 sintax means that if $value is 0 it will be replaced by 1 and if it`s not 0 it will be replaced by 0.

  03 March 2005
Sorry for the delayed response, thank you for clearing it up would not have guessed to use a different flag. Is there a different syntax and course of action to use with UI commands in general or is this a special case for viewport options?

Last edited by Andrei2k : 03 March 2005 at 05:25 AM.
  03 March 2005
in general every UI thing (button, checkbox, etc) has the -c flag where you specify what to do when it's clicked, etc. For instance put -c "myCommand" to execute myCommand procedure when cliked.
in the command line, type `help COMMAND`, where COMMAND would be "button", "checkbox", or any other MEL command to get a list of it's flags and some quick help.

salut wai.pa.pa.yashu.
  03 March 2005
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 10:31 PM.

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