Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
I reduced your script to just the input portion and it ran fine under straight Python ( I have both Python 2.0 installed for development as well as the Python 1.5.x that's running under Poser). If you're still having trouble I'll try it again tonight under Poser. FYI, I have found that On My Machine (OMM) Poser does not like running a script that has a Tkinter gui AND brings up the Python console window under Poser. The console and the GUI tend to beat up on each other. If you're debugging, close the GUI first from task manager or the start bar and then the console should come back with the error message(s). Important safety tip would be not to write a script that has a gui and then tries to print to the console. For anyone doing any serious gui work I heartily suggest taking a look at Python MegaWidgets at: http://www.dscpl.com.au/pmw/ Has a bunch of python scripts that build up on the basic Tkinter-Python widgets to make things like ComboBoxes, validated entry fields, etc. Heck of a lot easier to use than writing it yourself. It's pure python so it should run on a Mac or PC. I have tested it on my PC and one of my unindicted co-conspirators successfully tested it on his Mac. PMW is heavily featured in the book "Python and Tkinter Programming" so it should be free of alien influences.
Hi, are any MAC snakeheads around ? This script refuses entering any data on a MAC - shouldnt Python be compatible between the two platforms ? I wandered around in many newsgroups - no hint on this one. Buttons and everything else works fine. Hope to post my first scripts in a week or so: Automatic blinking and breathing. Karl
This is just a test script. I agree that using the console wouldn't be something to do as a standard practice. It was just to display some output from the script. jb - I've been looking at that book too. I'm wondering if it would be better for now to avoid extensions like PMW. I do agree with you that they are very useful and can help a lot getting the GUI built. I'm also concerned that having to find and install extras like PMW might scare off a lot of the non-techs. What are your thoughts? Grammer - Ouch! Sorry to hear that the script isn't working on your Mac. I too thought that PoserPython was going to work the same on both platforms. You might want to look at the animateTrans script that I used as the model. There may have been something Mac-related that I missed. Let me know if you find something so I can make course corrections.
Grammer - Thanks for the info. Since I don't have access to a Mac to try these scripts, your feedback is very helpful. The cross-platform aspect of PoserPython is the one area that troubles me since I can't check it myself. Hopefully, it will hold true as the scripts folks are working on get more complex.
I was able to solve it. When I got the new distribution of Python with Poser (2.0) The Poser installer did not remove the preferences from Python 1.5.3, which I had previously installed. I deleted them and now it works fine. You should also avoid to run several distributions of Python or TCL/TK parallel on one machine. The same holds for TCL/TK. TCL/TK (V 8.3) installs a folder in your "System Extensions" folder called "Tool command Language". In this folder are 5 aliases. In order for TK to run, theses 5 aliases should point to the respective files in your Poser: Runtime:Python folder. If you install TK seperately these aliases point to somewhere in the desert. You can also run into problems if you move your Poser folder on another harddisk or into another directory, then the aliases are not correct anymore. Learned again something: Be careful snakes may bite Karl
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.
Attached Link: http://bushi3d.com/PythonScripts/tkinput.py
I looked into using standard Python functions for entering text data. I couldn't get it to work correctly so I tried using TkInter instead. I've built a script that will display a pop-up window and accept text properly. The basic mechanism should be transferable to just about any PoserPython script that needs this functionality. It's based on the animateTrans script that comes with the PPP but has some extras that let the pop-up to close properly.