Forum: Poser Python Scripting


Subject: How to fetch the full os.path of a CurrentFigure ?

HartyBart opened this issue on Dec 27, 2020 ยท 27 posts


adp001 posted Tue, 19 January 2021 at 8:45 AM

HartyBart posted at 8:32AM Tue, 19 January 2021 - #4410678

I'm told that Renderosity can now only test Freestuff Python scripts with Poser 12. This effectively means that no Poser 11 Python script will ever again pass Freestuff testing, if it is even slightly sophisticated. I assume the same will also apply to newly uploaded commercial Python scripts for the Store.

What's the probem with this?

Python scripts can be written to run with P11 and P12. Python 2 scripts are dead. Relics of a bygone century.

Just write a few lines at the top of your script and you are good to go:

from __future__ import print_function, division

And if you use "basestring" (to avoid problems with utf-8 strings in Python 2.7, as I do):

import sys
if sys.version_info.major > 2:
    basestring = str

And use a modern Python editor able to notify you if you use libs or a syntax not compatible with Python 3. There is always a way around possible errors.