meldu
01-15-2013, 12:38 AM
Hi, good night. I have a problem with a tool that i`m trying to make. The tool is for multiple parent constraints. The tool will have two buttons:
-1 the first one, will define who is the father.
-2 the second button, will define which are the childs, i mean, who will be constrained. And, will constraint this objects to the first one.
So:
1-You select the father, hit the button that says "father"
2-You select the childs, then hit the button that says "sons"
But i get this error:
// Error: "$papa" is an undeclared variable.
This its the script.
//global proc that assing the father
global proc setFather () {
//a variable that search and define who its the father
string $papa[] = `ls -sl`;
print $papa[0];
select $papa[0];
}
//global proc that for the sons
global proc setSons () {
string $sons[] = `ls -sl`;
$myNum = (size(`ls -sl`));
for ($laps = 0; $laps <= $myNum; $laps++){
select -r $papa[0];
select -add $sons
doCreateParentConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
}
}
//main window
window -rtf true -title "multiConstraint" multiCons;
columnLayout;
button -c "setFather" -label "father";
button -c "setSons" -label "sons";
showWindow multiCons;
I think its something about the global variables, but i cant figure out how to do it.
Thanks.
-1 the first one, will define who is the father.
-2 the second button, will define which are the childs, i mean, who will be constrained. And, will constraint this objects to the first one.
So:
1-You select the father, hit the button that says "father"
2-You select the childs, then hit the button that says "sons"
But i get this error:
// Error: "$papa" is an undeclared variable.
This its the script.
//global proc that assing the father
global proc setFather () {
//a variable that search and define who its the father
string $papa[] = `ls -sl`;
print $papa[0];
select $papa[0];
}
//global proc that for the sons
global proc setSons () {
string $sons[] = `ls -sl`;
$myNum = (size(`ls -sl`));
for ($laps = 0; $laps <= $myNum; $laps++){
select -r $papa[0];
select -add $sons
doCreateParentConstraintArgList 1 { "1","0","0","0","0","0","0","1","","1" };
}
}
//main window
window -rtf true -title "multiConstraint" multiCons;
columnLayout;
button -c "setFather" -label "father";
button -c "setSons" -label "sons";
showWindow multiCons;
I think its something about the global variables, but i cant figure out how to do it.
Thanks.
