Chepri
01-13-2012, 08:30 AM
Hey guys, I've created this script where I can alter the visibility of a cube through a melscript GUI pop up window.
It works perfectly, BUT I don't have a feedback function.
I want to be able to use the script and have the correct radiobutton checked.
So it needs to check the vis of the cube and then check the correct radiobutton.
if ( `window -exists MyWindow` ) {deleteUI MyWindow;}
window
-title "new window"
-widthHeight 300 50
MyWindow;
formLayout
-numberOfDivisions 100
myForm;
radioButtonGrp
-numberOfRadioButtons 2
-label "Cube"
-labelArray2 "Off" "On"
-changeCommand "visibilityCube();"
myRadBtnGrp;
formLayout
-edit
-attachForm myRadBtnGrp "top" 10
-attachForm myRadBtnGrp "left" -50
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; }
I think I need to create a checkVisCub procedure.
global proc checkVisibilityCube() {
if (`pCube1.visibility` == 0)
set radioButtonGrp 1;
if (`pCube1.visibility` ==1)
set radioButtonGrp 2;
Another issue is where do I initiate this procedure?
I'm braindead at the moment (deadline yesterday, too little sleep) so any help will be greatly apreciated. :3
It works perfectly, BUT I don't have a feedback function.
I want to be able to use the script and have the correct radiobutton checked.
So it needs to check the vis of the cube and then check the correct radiobutton.
if ( `window -exists MyWindow` ) {deleteUI MyWindow;}
window
-title "new window"
-widthHeight 300 50
MyWindow;
formLayout
-numberOfDivisions 100
myForm;
radioButtonGrp
-numberOfRadioButtons 2
-label "Cube"
-labelArray2 "Off" "On"
-changeCommand "visibilityCube();"
myRadBtnGrp;
formLayout
-edit
-attachForm myRadBtnGrp "top" 10
-attachForm myRadBtnGrp "left" -50
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; }
I think I need to create a checkVisCub procedure.
global proc checkVisibilityCube() {
if (`pCube1.visibility` == 0)
set radioButtonGrp 1;
if (`pCube1.visibility` ==1)
set radioButtonGrp 2;
Another issue is where do I initiate this procedure?
I'm braindead at the moment (deadline yesterday, too little sleep) so any help will be greatly apreciated. :3
