PDA

View Full Version : UI Slider connection question


BoomRat
07-06-2003, 10:43 PM
Hey all,

I'm building a UI for a pair of wings and I'm in a bit of a tangle.

I'm trying to use a checkbox to connect one floatSliderButtonGrp to another and I can't quite figure out the syntax. Here's what I have:

floatSliderButtonGrp
-label "Lt Flap"
-f -1
-min -1
-max 10
-bl "Key"
-bc "setKeyframe wingCONTROLS.LtWingFlap"
ui_ltFlap_slider;
connectControl ui_ltFlap_slider wingCONTROLS.LtWingFlap;

checkBox
-l "Connect Rt to Lt"
-al "left"
-onc "WHAT GOES HERE";

floatSliderButtonGrp
-label "Rt Flap"
-f -1
-min -1
-max 10
-bl "Key"
-bc "setKeyframe wingCONTROLS.RtWingFlap"
ui_rtFlap_slider;
connectControl ui_rtFlap_slider wingCONTROLS.RtWingFlap;

The questions are: Can it be done? and How?

I'd really appreciate any help on this seeing as how the Maya Help is pretty useless on this.

dwalden74
07-07-2003, 08:01 AM
Sure it can be done!

-onc "WHAT GOES HERE";

here you want to edit the command of your left wing control such that when it changes value ("-cc" or "-dc" flag), it updates the "-value" of the right wing control. Got it?

:beer:
David

BoomRat
07-09-2003, 09:40 PM
here you want to edit the command of your left wing control such that when it changes value ("-cc" or "-dc" flag), it updates the "-value" of the right wing control. Got it?

Nope, don't get it... or I should say I understand the idea, just can't get my head wrapped around the syntax.

Should I put an "if/else" statement somewhere that if the status of the checkbox is "on"(checked) then the -value of ui_rtFlap_slider equals the -value of ui_ltFlap_slider? Something like:

floatSliderButtonGrp
-label "Lt Flap"
-f -1
-min -1
-max 10
-bl "Key"
-bc "setKeyframe wingCONTROLS.LtWingFlap"
ui_ltFlap_slider;
connectControl ui_ltFlap_slider wingCONTROLS.LtWingFlap;

checkBox
-l "Connect Rt to Lt"
-al "left"
-onc "flapConnect()"
ui_flapConnect_check;

floatSliderButtonGrp
-label "Rt Flap"
-f -1
-min -1
-max 10
-bl "Key"
-bc "setKeyframe wingCONTROLS.RtWingFlap"
ui_rtFlap_slider;
connectControl ui_rtFlap_slider wingCONTROLS.RtWingFlap;

global proc flapConnect()
{
-query "ui_flapConnect_check";

if (`-v ui_flapConnect_check=1)
-v ui_rtFlap_slider = -v ui_ltFlap_slider

else
-v ui_rtFlap_slider != -v ui_ltFlap_slider;
}

dwalden74
07-10-2003, 02:00 PM
If I understand U correctly...


if (`window -ex winTemp` == 1)
deleteUI winTemp;

window winTemp;
columnLayout;
floatSliderButtonGrp -dc "" slider1;

string $onCommandString = "float $slider1Value = `floatSliderButtonGrp -q -v slider1`; floatSliderButtonGrp -e -v $slider1Value slider2;";
string $onCommand = ("floatSliderButtonGrp -e -dc \"" + $onCommandString + "\" slider1");
string $offCommand = "floatSliderButtonGrp -e -dc \"\" slider1";

checkBox
-onc $onCommand
-ofc $offCommand
checkBox;

floatSliderButtonGrp slider2;

showWindow winTemp;

svenip
07-11-2003, 03:02 AM
hi david,

man you look different in my memory :) then your new avatar

dwalden74
07-11-2003, 09:16 AM
man you look different in my memory then your new avatar

yeah, i visited that new doctor you reccomended. E-mail me!

:beer:
David

CGTalk Moderation
01-15-2006, 02:00 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.