Forum: Poser Python Scripting


Subject: Crippled Python in Poser 5

mkrueger opened this issue on Oct 31, 2004 ยท 7 posts


mkrueger posted Sun, 31 October 2004 at 2:29 PM

Hi all, I just discovered that there is no module "thread" in Poser's version of Python. This is quite a heavy blow, up until now I thought Poser 5 contained a full version of Python 2.2. Has anyone else discovered similar "holes" in Poser's Python? And is this a bug or is it a deliberate "pruning"? martin


duckmango posted Mon, 01 November 2004 at 12:40 PM

I dunno, I think the biggest "holes" are in the Poser module itself -- just a lack of access/functionality to some of the more interesting things Poser can do. For example,

  1. Lack of direct python access to P5's material room (nodes and shaders.)

  2. Lack of (interesting) python routines to manipulate magnets. For instance, while python can apply magnets to a character, I don't think there's any direct way to add the character's clothes to the magnets' zone as well. (If someone knows how in python, I'd be mighty grateful for the info.)

As for other problems with standard modules, I do remember Mac P5 users reporting some problems with the Tkinter installation on OSX. Anyone know if this was fixed?


mkrueger posted Mon, 01 November 2004 at 4:42 PM

duckmango, I completely agree with you, Python support should be far more extensive. Python 2.3 support wouldn't hurt either. As far as Mac troubles are concerned, I wouldn't know as I'm running on WinXP. I primarily meant the basic Python runtime in Poser. So I experimented a bit. I reinstalled Python 2.2.3 and copied the python22.dll to my Poser installation directory (first renaming the Poser version of the file). And now my Poser's Python has a thread module :)


duckmango posted Tue, 02 November 2004 at 12:03 AM

Very nice tip... must try it out some time.

Ok, now I'm curious: why the interest in the thread module? Is it for some programming technique, like threading user i/o while running another process simultaneously? Or is there something "larger" in mind?


stewer posted Tue, 02 November 2004 at 4:07 AM

Threads in Python are considered an optional feature. I deliberately disabled threads for P5 on Windows because they were causing crashes in Tkinter windows (even in single-threaded Python scripts).


mkrueger posted Tue, 02 November 2004 at 4:03 PM

duckmango, I haven't got something larger in mind really. I just thought a Python shell in Poser would be a nice idea to try things out interactively. So I tried to embed IPython, which wasn't very successful. So I started to program my own shell with a simple Tkinter GUI. Along the way I added a function to call the Python Windows help and struggled with the diverse spawn*, exec* functions in the os module. Since all experiments haven't worked out properly, I started to use a separate thread to start the chm file. This finally worked ok when starting outside of Poser, but then: no thread module in Poser! So this is how I discovered the missing thread module. stewer, how did you disable threads for P5? There isn't any thread module in Poser5's version of Python. Apart from that, dis/enabling threads would mean recompiling Python itself. Could you tell me more, I'm really curious. Another thing is that before I exchanged python22.dll, I had to start my script 2 times before I got the Tkinter GUI and Python was reacting queer sometimes i.e. sometimes it just ignored commands. After the exchange everything worked fine.


an0malaus posted Wed, 03 November 2004 at 4:47 AM

Latest word from CL tech support is that TkInter support for Mac under OS X is being worked on but no completion or release date.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.