Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
MAYA:MAYA ForumMAYA TutorialsMAYA

Radio Button Script Without Button

COW Forums : MAYA

VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Jacqueline JohnsenRadio Button Script Without Button
by on Dec 27, 2011 at 2:00:12 pm

Hello,
I want a simple script to turn the visibility of an object on and off. I actually have it working, but I want to get rid of one extra step. Which is the button. However Maya doesn't seem to like the "-command" in the radioButtonGrp. So if someone knows the solution please let me know... ^^

This script uses a cube mesh named pCube1


if ( `window -exists MyWindow` ) {
deleteUI MyWindow;
}
window -title "new window" -widthHeight 300 200 MyWindow;
formLayout -numberOfDivisions 100 myForm;
radioButtonGrp
-numberOfRadioButtons 2
-label "select type"
-labelArray2 "Off" "On"
-select 1
myRadBtnGrp;
button -label "Get Rid of this Button" -command "visibilityCube()" myBtn1;
formLayout -edit
-attachForm myRadBtnGrp "top" 10
-attachForm myRadBtnGrp "left" -50
-attachForm myBtn1 "bottom" 10
-attachForm myBtn1 "left" 10
myForm;

showWindow MyWindow;
global proc visibilityCube() {
if (`radioButtonGrp -q -select myRadBtnGrp` == 1) setAttr pCube1.visibility 0;
if (`radioButtonGrp -q -select myRadBtnGrp` == 2) setAttr pCube1.visibility 1;
}


Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]