Josiah opened this issue on Nov 19, 2002 ยท 3 posts
ockham posted Tue, 19 November 2002 at 10:06 PM
One problem is sort of subtle: in line 3 you use a try/except for a condition that won't really generate an error. If the actor is not a magnet-base, IsBase will simply give 0, which is not an error. So this just needs a plain old If, not a try/except. (I committed this error OFTEN when I first started Pythoning, so I know it well!) The second problem is that you use "actor" for the list-of-actors obtained from scene.Actors(), and also use "actor" for a member of that list. Third problem is that you didn't actually select the actor before deleting it. Below is a version that works: #------------------------------ scene = poser.Scene() for actor in scene.Actors(): # Go through all actors ~if actor.IsBase(): # is it a magnet base? ~~scene.SelectActor(actor) # if so, select it, ~~scene.DeleteCurrentProp() # and then delete it.