Thanks Joojaa for the reply.
I gonna post here all the code
1
2
3
4
5
6
7
8
9
10
11
string $fileUser = internalVar -userScriptDir
;
string $filePasta = "Poses/Do/";
string $filePath = $fileUser + $filePasta ; // logo da janela
string $filePaththumb = ""; // thumbs
window -tlb off -rtf on -sizeable off -t "Poses Do";
columnLayout -adjustableColumn true;
image -w 450 -h 100 -i ($filePath + "logo.BMP");
rowColumnLayout -numberOfRows 3
-rowHeight 1 75
-rowHeight 2 75
-rowHeight 3 75;
Then I use a default global proc from Maya to check the amount of character poses the global proc is currentCharacterPoses.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
global proc string[] currentCharacterPoses()
{
string $allPoses[];
string $characters[] = currentCharacters
;
int $n=0;
int $nchars = size($characters);
if ($nchars == 0) return allCharacterPoses();
for ($i=0; $i < $nchars; $i++)
{
string $poses[] = `pose -q -n $characters[$i]`;
for ($j=0; $j < size($poses); $j++)
$allPoses[$n++] = $poses[$j];
}
return $allPoses;
}
Then with this information
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
string $posesDo[] = currentCharacterPoses
;
int $i;
for ($i=1; $i< size($posesDo);$i++)
{
symbolButton -i ($filePath + "Corpo_P" + $i + ".BMP") -w 75 -h 75 -ann "$i" -c ("doPose(" + $i + ");");
}
global proc int doPose (int $i)
{
/*select -r "*Corpo\_P0";
string $obj[]= `ls -sl`;
string $character = "*DOcorpo";
pose -apply -name $obj $character;
return 1;*/
string $corpoP = "*Corpo\_P";
string $total = $corpo\_P + $i;
select -r total;
string $obj[]= `ls -sl`;
string $character = "*DOcorpo";
pose -apply -name $obj $character;
return 1;
}
showWindow;
I have follow your advice and use the command flag
-c ("doPose(" + $i + ");")
But first I need to tell proc $doPose what is variable $i. Unfortunately I can make this work because I get a error say that $corpo_P is an undeclared variable. :s But I already declared that this is a string variable.