Forum: Poser Python Scripting


Subject: Poser 6 'Cant open script for reading' (runPythonScript from CR2)

3dcheapskate opened this issue on Sep 02, 2024 ยท 7 posts


3dcheapskate posted Mon, 02 September 2024 at 3:01 AM

I've got a simple CR2 that does nothing except call a PoserPython script.

No problems in PP2014

But in Poser 6 I get this

So P6 appears to do the runPythonScript, but can't find the script - is that hat's happening ?

Any ideas why ? (the CR2 and script are in the same runtime)


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.




3dcheapskate posted Mon, 02 September 2024 at 5:10 AM

If I use Windows style path syntax (I'm on Windows 10) it still doesn't work


But with the full absolute path starting "C:\Users\..." it works.

Of course that's no use in a freebie as I have no idea where users will put the file.

So the new question now becomes "can Poser 6 handle runtime relative paths from a runPythonScript statement in a Poser file ?"


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.




3dcheapskate posted Mon, 02 September 2024 at 5:16 AM

And another related question -

which version of Poser was the first to allow Mac syntax runtime-relative pathnames in the runPythonScript statement in a Poser file ?


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.




jroulin posted Tue, 03 September 2024 at 10:29 AM

If it is in the same directory I would try this:

runPythonScriptEx "Classics01.py" 0


3dcheapskate posted Tue, 03 September 2024 at 11:27 AM

Thanks for the suggestion. I'm very rusty on all this - what's the difference between runPythonScript and runPythonScriptEx ?

I've also just identified a nagging thought - didn't Poser 6 require Python scripts to be in the main Poser runtime, not mapped runtimes ?



The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.




3dcheapskate posted Wed, 04 September 2024 at 3:21 AM

My nagging thought was spot on - when I moved my scripts from the desktop runtime I had them in to (backslashes changed to forward slashes simply to post on this forum) C:/Program Files (x86)/e frontier/Poser 6\Runtime/Python/poserScripts/ it worked perfectly, Mac syntax and all.

This is something I clearly knew 12 years ago as it's in the readme of my first freebie with a PoserPython script* - "2 - Copy the contents of the 'Poser Default Runtime' folder from the downloaded zip file to your DEFAULT runtime (These are the PoserPython scripts, which are called from PZ2/PP2 files - if you have several runtimes, then in order for the calls to work it appears that the PoserPython scripts MUST be in the main runtime, i.e. under your Poser installation)."


*South East Asian Duel (Poses, Prop, Scripts) - still avaiable at ShareCG


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.




3dcheapskate posted Wed, 04 September 2024 at 3:22 AM

So the question now becomes

Which Poser version was the first to support calling of PoserPython files in mapped runtimes from runPythonScript ?


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.