Display borders & controlling border width


#1

if(window -ex testwin){
deleteUI testwin;
}

window -t “test” -wh 200 50 -s 0 testwin;

columnLayout;
button -l “Display Borders” -c “findo” db;

floatFieldGrp -l “Boder Width” borderwi;

showWindow testwin;

proc findo(){

float $wid = floatFieldGrp -q -v "borderwi" ;

displa $wid;

}
findo()

global proc displa(float $wid){

string $bord[] = ls -sl;

for($widths in $bord) {

string $shap[] = `listRelatives -shapes $widths`;

setAttr ($shap[0]+".displayBorders")1;
setAttr ($shap[0]+".borderWidth")$wid;

}

}

iam getting error :- // Error: line 3: Cannot convert data of type float[] to type float. //

plz any one help me…


#2

Not at maya right now, so untested, but try this 2 line change…

float $wid[] = floatFieldGrp -q -v "borderwi" ;

displa $wid[0];

David


#3

Thnks Its Working… :slight_smile: :slight_smile:


#4

HI
Can u Explain me about error.


#5

-v gives you values for all the fields, so it gives you an array even if you only have defined one.
Treating it as an array and getting only the first value makes it work.

You can use also -v1 instead to get only the first value:

float $wid = `floatFieldGrp -q -v1 borderwi` ;