PDA

View Full Version : I need a global reset


thehive
03-07-2008, 12:13 PM
im makin a UI for my car an i have a rest on all the slider grps but i wanted to make a globla rest for all the sliders , the prob is seems a button cant have too many arguments not sure if i need a loop of some sort any help would be great thanks









//Delte name of parmater an replace with attribute



string $window = `window -title "CAR_UI"



-iconName "UI1.0"

-widthHeight 400 400`;

scrollLayout;

columnLayout -columnAttach "left" 5 -rowSpacing 10 -columnWidth 320;


//Global Rest for all sliders
button -label "Reset_ALL" -c "setAttr Man_str.ry 0";









separator -w 450;



button -label "Reset" -c "setAttr Man_str.ry 0";

button -label "KEY" -c "setKeyframe \ Man_str.ry";

attrFieldSliderGrp -label "Steering"

-fmn-35 -fmx 35 -s 0 -minValue -35 -maxValue 35 -cal 1 left

-at Man_str.ry;







button -label "Reset" -c "setAttr BODYCTL.WheeL_SPN 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.WheeL_SPN";

attrFieldSliderGrp -label "Global Tire Speed"

-fmn 0 -fmx 100 -s 0 -minValue 0 -maxValue 100 -cal 1 left

-at BODYCTL.WheeL_SPN;





button -label "Reset" -c "setAttr BODYCTL.FRT_SPD 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.FRT_SPD ";

attrFieldSliderGrp -label "Front Tire Speed"

-fmn 0 -fmx 100 -s 0 -minValue 0 -maxValue 100 -cal 1 left

-at BODYCTL.FRT_SPD;





button -label "Reset" -c "setAttr BODYCTL.RER_SPD 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.RER_SPD ";

attrFieldSliderGrp -label "Rear Tire Speed"

-fmn 0 -fmx 0 -s 0 -minValue 0 -maxValue 100 -cal 1 left

-at BODYCTL.RER_SPD;





button -label "Reset" -c "setAttr BODYCTL.Nose_Dive 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.Nose_Dive ";

attrFieldSliderGrp -label "Nose Control"

-fmn -1.5 -fmx 1.5 -s 0 -minValue -1.5 -maxValue 1.5 -cal 1 left

-at BODYCTL.Nose_Dive;



button -label "Reset" -c "setAttr BODYCTL.Rear_Dive 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.Rear_Dive ";

attrFieldSliderGrp -label "Rear Control"

-fmn -1.5 -fmx 1.5 -s 0 -minValue -1.5 -maxValue 1.5 -cal 1 left

-at BODYCTL.Rear_dive;





button -label "Reset" -c "setAttr BODYCTL.bod_ROT 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.bod_ROT ";

attrFieldSliderGrp -label "Drifter"

-fmn -80 -fmx 80 -s 0 -minValue -80 -maxValue 80 -cal 1 left

-at BODYCTL.bod_ROT;



button -label "Reset" -c "setAttr BODYCTL.Spring_up 0";

button -label "KEY" -c "setKeyframe \ BODYCTL.Spring_up ";

attrFieldSliderGrp -label "Body elevation"

-fmn -0.6 -fmx 0.6 -s 0 -minValue -0.6 -maxValue 0.6 -cal 1 left

-at BODYCTL.Spring_up;





button -label "Reset" -c "setAttr Man_str.ry 0";

button -label "KEY" -c "setKeyframe \ Man_str.ry ";

attrFieldSliderGrp -label "Suspension multiplier"

-fmn-35 -fmx 35 -s 0 -minValue -35 -maxValue 35 -cal 1 left

-at BODYCTL.ry;









showWindow;

NPuetz
03-07-2008, 12:44 PM
try putting the all your setAttr for the "reset all" commands in a separate procedure and than call that procedure in the "reset all" button command.

proc xx_resetAll()
{
setAttr ball.rx 0
setAttr ball.ry 0
setAttr ball.rz 0
...
...
}

button -label "Reset_ALL" -c ("xx_resetAll();");

thehive
03-07-2008, 01:39 PM
ah man awsome thanks,

CGTalk Moderation
03-07-2008, 01:39 PM
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.