Sat, Nov 30, 2:50 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



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


dennisharoldsen ( ) posted Mon, 07 May 2007 at 8:41 AM · edited Mon, 18 November 2024 at 9:00 PM

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.


PhilC ( ) posted Mon, 07 May 2007 at 8:54 AM

Try using the alternative quote symbol 

' .... in place of .... "

in the line

actor = scene.Actor(“Main Camera”)


dennisharoldsen ( ) posted Mon, 07 May 2007 at 9:00 AM

thank you very much
that does work


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.