Home Coding, Scripting, Shaders

(MEL) help with getUVShells script

polycounter lvl 16
Offline / Send Message
onionhead_o polycounter lvl 16
Once again I have run into a bit of a wall Mel. I tried to write a script that get uv shells without having to select the uvs themselve one shell at a time.
global proc string getUVShells()<br>{<br>   string $shellList[];<br>   string $objects[] = `ls -o -sl`;<br>   int $shellIds [];<br><br>   for ($obj in $objects)<br>   {<br>       int $size = `polyEvaluate -uvShell $obj`; //get amount of uvShells<br>       for ($i = 0; $i < $size; $i++)<br>       {<br>           $shellIds[size($shellIds)] = $i;// populate shellIds <br>       }<br>       for ($s in $shellIds)<br>       {<br>       		string $uvsInShell[] = `polyEvaluate -uis $s $obj`;<br>			$shellList[size($shellList)] = stringArrayToString($uvsInShell, " ");	   <br>	   }<br>    }<br><br>   return $shellList;<br>}<br><br>getUVShells;<br><br>
when running this script with few mesh selected. I get this

Cannot cast data of type string[] to string. What I dont understand is stringArrayToString is suppose to work because this part was copied from this texGetShells.mel . C:\Autodesk\Maya2017\scripts\others\texGetShells.mel

I was hoping someone can help with this
Sign In or Register to comment.