PDA

View Full Version : how can i setdriven through ui one to one when iam selected multiples?


blendMinds
03-14-2006, 10:01 AM
hi folks i doing setdriven through UI
my contrl curve is having number of attributes , all these attribute i added to textscrolllist
throught this list iam selecting multiple attributes and selecting mutiple joints in viewport that should be assign one driver to driven

1to 1, 2 to 2 3 to 3 means i want do orderedwise suppose i bed

this is the code


window;
columnLayout;
textScrollList -allowMultiSelection true -h 100 mylistA;
textScrollList mylistb;
popupMenu;menuItem -l "clearList" -c("clearlistA");
button -l "AddAttr" -c("AddAttr");
popupMenu; menuItem -l "clearList" -c("clearlist");
checkBox RotateX;
checkBox RotateZ;
text -l Min;
textField minlimit;
text -l Max;
textField maxlimit;
button -w 100 -l "SetDRiven" -c "SD" ;
showWindow;

global proc SD()
{
int $Rotatex=`checkBox -q -v RotateX`;
int $Rotatez= `checkBox -q -v RotateZ`;
$nodes = `selectedNodes`;
string $Selected[]=`ls-sl -type joint`;
string $SAttr[]=`textScrollList -q -si mylistA`;
string $SelCur[]=`textScrollList -q -si mylistb`;
int $minlimit = `textField -q -text minlimit`;
int $maxlimit = `textField -q -text maxlimit`;
int $i=0;
int $count=size($Selected);
while($i<=$count)
{
if ($Rotatex==1)
{
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv -10 -v $minlimit -itt linear -ott linear ($Selected[$i]+".rx") ;
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv 10 -v $maxlimit -itt linear -ott linear ($Selected[$i]+".rx") ;
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv 0 -v 0 -itt linear -ott linear ($Selected[$i]+".rx") ;
selectKey `listConnections -s 1 -d 0 -type animCurveUA $SAttr[$i]`;
}
if ($Rotatez==1)
{
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv -10 -v $minlimit -itt linear -ott linear ($Selected[$i]+".rz") ;
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv 10 -v $maxlimit -itt spline -ott linear ($Selected[$i]+".rz") ;
setDrivenKeyframe -cd ($SelCur[0]+"."+$SAttr[$i]) -dv 0 -v 0 -itt linear -ott linear ($Selected[$i]+".rz") ;
selectKey `listConnections -s 1 -d 0 -type animCurveUA $SAttr[$i]`;
}
$i=$i+1;
}
}


Anyone Explain wanna sorry for myenglish

CGTalk Moderation
03-14-2006, 10:01 AM
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.