maya Finding scene objects Using ls() to see if an object exists


Since ls() finds objects by names, it's a handy way to find out if an object is present in the scene. ls() with a list of objects will only return the ones which are in the scene.

 available_characters ='fred', 'barney', 'wilma', 'dino')
 # available_characters will contain only the named characters that are present