Forum: Poser Python Scripting


Subject: Turn off all DisplayOrigin points in a scene, at once?

HartyBart opened this issue on Jul 14, 2021 ยท 19 posts


structure posted Sun, 18 July 2021 at 1:17 AM Forum Coordinator

> # Turn off PREVIEW visibility of "Grouping 1" grouping box, assumed to be present in the scene.

to avoid script crashes You should never assume something is present in the scene.

You could use the following options to test for it before attempting to do anything with it.

option 1:

try:
    scene.SelectActor(scene.Actor("Grouping 1"))
    actor = scene.ActorByInternalName("Grouping 1")
   ... rest of script
except:
    pass

option 2:

if scene.Actor( "Grouping 1" ):
    scene.SelectActor(scene.Actor("Grouping 1"))
    actor = scene.ActorByInternalName("Grouping 1")
    ... rest of script

Locked Out