playmesumch00ns
03-19-2003, 04:42 PM
I've got this error loads of times on other things but never been able to work it out, now it's just getting to be a pain in the arse. The procedure looks like this:
global proc nprAddLayer()
{
$sel = `ls -sl`;
for ($s in $sel)
{
string $nt = `nodeType $s`;
switch ($nt)
{
case "mesh":
nprAddLayerToObject($s);
break;
case "transform":
select $s;
pickWalk -d down;
$ns = `ls -sl`;
string $nst = `nodeType $ns[0]`;
if ($nst == "mesh")
{
nprAddLayerToObject($ns);
break;
}
else
{
error("Please select either a mesh or its tranform");
break;
}
default:
error("Please select either a mesh or its tranform");
break;
}
}
}
now I get the "Error: Cannot convert data of type string[] to type string" alternately when I run the proc, i.e first time it doesn't work, so try again straight away and it works. Try again straight away and it doesn't etc etc.
Can someone please tell me what's going on here? Thanks:thumbsup:
global proc nprAddLayer()
{
$sel = `ls -sl`;
for ($s in $sel)
{
string $nt = `nodeType $s`;
switch ($nt)
{
case "mesh":
nprAddLayerToObject($s);
break;
case "transform":
select $s;
pickWalk -d down;
$ns = `ls -sl`;
string $nst = `nodeType $ns[0]`;
if ($nst == "mesh")
{
nprAddLayerToObject($ns);
break;
}
else
{
error("Please select either a mesh or its tranform");
break;
}
default:
error("Please select either a mesh or its tranform");
break;
}
}
}
now I get the "Error: Cannot convert data of type string[] to type string" alternately when I run the proc, i.e first time it doesn't work, so try again straight away and it works. Try again straight away and it doesn't etc etc.
Can someone please tell me what's going on here? Thanks:thumbsup:
