Hugh
03-22-2003, 04:57 PM
I'm writing a script at the moment that will check whether certain objects exist in the current scene....
I'm currently doing it with the following procedure:
global proc int findObject(string $name)
{
select -r $name;
$object = `ls -sl`;
if(size($object) == 0)
{
print("Failed to find "+$name+"\n");
return 0;
}
else
return 1;
}
However, if it finds that an object doesn't exist, the select command gives an error, and no more of the script is executed....
Is there any way of getting around this without writing my own stuff to go through all of the objects in the scene?
I'm currently doing it with the following procedure:
global proc int findObject(string $name)
{
select -r $name;
$object = `ls -sl`;
if(size($object) == 0)
{
print("Failed to find "+$name+"\n");
return 0;
}
else
return 1;
}
However, if it finds that an object doesn't exist, the select command gives an error, and no more of the script is executed....
Is there any way of getting around this without writing my own stuff to go through all of the objects in the scene?
