Forum: Poser - OFFICIAL


Subject: Posible to load script with .pz2 file?

momodot opened this issue on Jan 02, 2009 · 20 posts


alizea posted Wed, 24 June 2009 at 4:31 AM

Hi everybody ; I 've lost the trace of this thread but finally found it !
So here is the script I'm using :

import poser
scene = poser.Scene()

actorList1 = ["hip", "chest","abdomen","lcollar","rcollar"]
morphList1 = ["Muscles_01","Muscles_02"]

figureToChange   = scene.CurrentFigure()

for actrName in actorList1:
 actr = figureToChange.Actor(actrName)
 if (actr) :
  for morphName in morphList1:
   curParm = actr.Parameter(morphName)
   if (curParm == None) :
    actr.SpawnTarget(morphName)

For this script I have this message :

Traceback (most recent call last):
  File "C:Program FilesImages de synthèsePoser ProRuntimePythonposerscriptsscriptsMenuAddChannels2.py", line 10, in ?
    actr = figureToChange.Actor(actrName)
poser.error: Figure has no actor by that name

(the script works as it adds the two channels)
(the figure has only hip, abdomen and chest bodyparts)

if I add this block at the end of the script:

try :
  actr=figureToChange.ActorByInternalName(actrName)
except :
        continue

I have this message ( and there are no channels added ):
  File "C:Program FilesImages de synthèsePoser ProRuntimePythonposerscriptsscriptsMenuAddChannels2.py", line 20
    continue
SyntaxError: 'continue' not properly in loop

I've tried adding this block at the end of the script:

try :
  actr=figureToChange.ActorByInternalName(actrName)
except :
        pass

but I have the same result as the original script (poser.error: Figure has no actor by that name ; but new channels were added )

I've tried this "try ...except"  with ActorByInternalName or simply Actor , same result .
I'm sure there must be a way , I have programming notions , unfortunately not in Python language ;)

Thank you all !
 

Alice's and GND4's Tailor !
Check my free clothing fits : www.alizea3d.com