Forum: Poser Python Scripting


Subject: python: "Find a scene actor by its external name" does not work for me as docume

dennisharoldsen opened this issue on May 07, 2007 · 3 posts


dennisharoldsen posted Mon, 07 May 2007 at 8:41 AM

from: PoserPython Methods.pdf - page 27

actor = scene.Actor(“Left Forearm”)

mycode:

import poser
scene = poser.Scene()
actor = scene.CurrentActor()
print('CurrentActor: ' + actor.Name() + '  ', actor )
actor = scene.Actor(“Main Camera”) <-------------------fails here
print('CurrentActor: ' + actor.Name() + '  ', actor )

aActors= scene.Actors()
print('actors: ')
for oActor in aActors:
  print(oActor.Name())

result:

sys:1: DeprecationWarning: Non-ASCII character 'x93' in file

D:poserpythonsetActor.py on line 5, but no encoding declared; see

http://www.python.org/peps/pep-0263.html for details
  File "D:poserpythonsetActor.py", line 5
            actor = scene.Actor(“Main Camera”)
                                ^
SyntaxError: invalid syntax

(original message points to 'e.' in case your formatting is different)

I would very much appreciate getting a handle on this.