safakoner
01-28-2004, 01:17 PM
/*Hi
I am in trouble about selection.
I created a window and two different button and one float slider.
I can connect single selection with this float. But when I select two objects I can't connect selection with the float slider.
Try this
Select a locator click select button and than click connect button. Now change the slider value. This is work.
Select two locators click select button and than click connect button. Now change the slider value. This isn't work.
I use this code -> {"locator1", "locator2"}; for defining two objects. I have a problem here.
But I don't know how can I solve this problem.
Can you help me ?
Thanks
*/
window;
columnLayout;
rowColumnLayout -nc 3 -cw 1 200 -width 500 ;
textField -tx "" -w 250 tf01;
button -l "Select" -c "sel";
button -l "Connect" -c "con";
floatSliderGrp -min -50 -max 50 -v 0 -f true -cw2 45 45 -w 30 sld_lm;
setParent;
showWindow;
global proc sel()
{
string $sel[] = `ls -sl`;
if((size($sel) > 2) || (size($sel) == 0))
warning " Equinox Warning : You must select object(s) between 1 and 2";
else
{
if(`size($sel)` == 1)
{
//Get Name - Connection
string $getname = ( $sel[0] );
textField -e -tx $getname tf01;
}
else
{
if(`size($sel)` == 2)
{
//Get Name - Connection
string $getname = ( "{" + "\"" + $sel[0] + "\"" + ", " + "\"" + $sel[1] + "\"" + "}" );
textField -e -tx $getname tf01;
}
else
{
}
}
}
}
global proc con()
{
$htRA = ".ry";
$htOb = (`textField -q -tx tf01`);
floatSliderGrp -e -min -50 -max 50 -v 0 -f true -cw2 45 45 -w 30 sld_lm;
connectControl sld_lm ( $htOb + $htRA );
}
I am in trouble about selection.
I created a window and two different button and one float slider.
I can connect single selection with this float. But when I select two objects I can't connect selection with the float slider.
Try this
Select a locator click select button and than click connect button. Now change the slider value. This is work.
Select two locators click select button and than click connect button. Now change the slider value. This isn't work.
I use this code -> {"locator1", "locator2"}; for defining two objects. I have a problem here.
But I don't know how can I solve this problem.
Can you help me ?
Thanks
*/
window;
columnLayout;
rowColumnLayout -nc 3 -cw 1 200 -width 500 ;
textField -tx "" -w 250 tf01;
button -l "Select" -c "sel";
button -l "Connect" -c "con";
floatSliderGrp -min -50 -max 50 -v 0 -f true -cw2 45 45 -w 30 sld_lm;
setParent;
showWindow;
global proc sel()
{
string $sel[] = `ls -sl`;
if((size($sel) > 2) || (size($sel) == 0))
warning " Equinox Warning : You must select object(s) between 1 and 2";
else
{
if(`size($sel)` == 1)
{
//Get Name - Connection
string $getname = ( $sel[0] );
textField -e -tx $getname tf01;
}
else
{
if(`size($sel)` == 2)
{
//Get Name - Connection
string $getname = ( "{" + "\"" + $sel[0] + "\"" + ", " + "\"" + $sel[1] + "\"" + "}" );
textField -e -tx $getname tf01;
}
else
{
}
}
}
}
global proc con()
{
$htRA = ".ry";
$htOb = (`textField -q -tx tf01`);
floatSliderGrp -e -min -50 -max 50 -v 0 -f true -cw2 45 45 -w 30 sld_lm;
connectControl sld_lm ( $htOb + $htRA );
}
