Select from a list with missing objects

How can I make this simple line execute if random objects in the array happen to be missing from the scene?

select #($Sphere002, $Sphere001, $Sphere003, $Sphere004, Sphere005)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

 

select (for obj in #($Sphere002, $Sphere001, $Sphere003, $Sphere004, $Sphere005) where isValidNode obj collect obj)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.