Forum: Poser Python Scripting


Subject: Primitive but useful ( at least for me ...)

mmogul opened this issue on Dec 18, 2004 ยท 3 posts


mmogul posted Sat, 18 December 2004 at 1:34 PM

i made almost 100 head morphs using MAX 4, then i made a lit Delphi app to generate random pose files using this morphs. Up to 10 morphs are used in each PZ2. Only 10% of the generated faces are usable, but all of them need a bit of refine.

This WAS my problem ... i had a long list of morphs in my parameters dials windows, and i wanted to see only the non-zeroed.

Here cames the extense ockhams script lib. I dowloaded a lot of them, studied 2 or 3 hours, and - voil- my first python script.

#Hidde all zeroed head morphs
import poser
import string

scene = poser.Scene()
fig = scene.CurrentFigure()
neck = fig.ActorByInternalName("neck")
head = fig.ActorByInternalName("head")

for Parm in head.Parameters():
        if Parm.IsMorphTarget():
                if Parm.Value() == 0.0:
                        # print Parm.Name()
                        # print Parm.Value()
                        Parm.SetHidden(1)
scene.SelectActor(neck)
scene.SelectActor(head)

Are you scary ? So, let me show the other :

#UnHidde all head morphs
import poser
import string

scene = poser.Scene()
fig = scene.CurrentFigure()
neck = fig.ActorByInternalName("neck")
head = fig.ActorByInternalName("head")

for Parm in head.Parameters():
  if Parm.IsMorphTarget():
    Parm.SetHidden(0)
scene.SelectActor(neck)
scene.SelectActor(head)

Works fine, very useful, at least for me. Please, send your applauds to ockham, that thaught Python to a jackass. Littles scripts, but a great content !

Thank you ockham