(MEL) Syntax help plz, UV script

(MEL) Syntax help plz, UV script

absoluteKelvin
Collaborator Collaborator
540 Views
1 Reply
Message 1 of 2

(MEL) Syntax help plz, UV script

absoluteKelvin
Collaborator
Collaborator

Hi, hope y'all are having a wonderful holiday break.

I require some assistance to bypass this error  // Error: line 12: Cannot convert data of type int[] to type int. //  in this script.

 

global proc string[] texGetShellsMOD()
{
    //modified to work on all uvshells 
    string $result[];
    int $UVShellsNum[];
    int $shellcount;
    string $selectedObjs[] = `ls -o -sl`;
	for ($o in $selectedObjs)
	{
		if(`nodeType $o` != "mesh" )
			continue;
		    $shellcount = `polyEvaluate -uvShell $o`;
		    print $shellcount;
		    for ($i=0; $i < $shellcount; $i++)
		    {
		     $UVShellsNum[$i] = $i;
		    }
		    for ($s in $UVShellsNum)
		    {
		        string $uvsInShell[] = `polyEvaluate -uis $s $o`;
		        $result[size($result)] = stringArrayToString($uvsInShell, " ");
		    }
	}

	return $result;
}

texGetShellsMOD;

this script is a modified version of the texGetShells which suppose to get all the uv shells inside the uv editor. Original script only grabs the selected uvshells. This current one will grab and store all the uvShells.

https://www.artstation.com/kelvintam
0 Likes
541 Views
1 Reply
Reply (1)
Message 2 of 2

absoluteKelvin
Collaborator
Collaborator

after posting, I fixed the syntax error. But to my surprise the new code yields empty results???? why?

 EDIT: i forgot to mention that i have 2 objects selected.

global proc string[] texGetShellsMOD()
{
    //modified to work on all uvshells 
    string $result[];
    int $UVShellsNum[];
    int $shellcount[];
    string $uvsInShell[];
    int $tempCounter;
    string $selectedObjs[] = `ls -o -sl`;
	for ($o in $selectedObjs)
	{
		if(`nodeType $o` != "mesh" )
			continue;
		    $shellcount = `polyEvaluate -uvShell $o`;
            $tempCounter = $shellcount[`size $selectedObjs`];    
		    for ($i=0; $i < $tempCounter; $i++)
		    {
		     $UVShellsNum[$i] = $i;
		    }
		    for ($s in $UVShellsNum)
		    {
		        $uvsInShell = `polyEvaluate -uis $s $o`;
		        $result[size($result)] = stringArrayToString($uvsInShell, " ");
		    }
	}
    print $result;
	return $result;
}

texGetShellsMOD;

 

https://www.artstation.com/kelvintam
0 Likes