Forum: Poser Python Scripting


Subject: Parmatic script error

IsaoShi opened this issue on May 17, 2009 · 7 posts


svdl posted Sun, 17 May 2009 at 10:54 AM

Hmm, weird. If I read the script right, it'll test each actor for being a prop - if not, go to the next actor.
It should only reach the try: statement when the actor is a prop, and it should only reach the for statement if the Materials() function returns a value.

What might work is the following:

for actor in scene.Actors():
    if not actor.IsProp():
        continue
    try:
        materials=actor.Materials()
    except:
        continue
    if !materials:
        continue
    for mat in materials:
        ....

The red code should prevent the error from happening.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff