Wed, Nov 20, 6:23 AM 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: new poser python discovery, or old news for some ;)


c1rcle ( ) posted Thu, 12 September 2002 at 11:23 AM ยท edited Wed, 20 November 2024 at 6:21 AM

I've just installed the newest version of python ready for when poser5 arrives in my sweaty hands & going through the manual I came across the grab function, what it does is locks the system so that only the active python window can be interacted with until you close that window. I'm wondering if this is in the python that ships with poser, if it is we can use it to solve the disappearing window problem we've had with python scripts up to now.


ockham ( ) posted Thu, 12 September 2002 at 8:53 PM

Short answer: Yes. P5 includes ver 2.2 of Python, and after reading your msg, I looked in the new TKinter.py script and found a family of grab functions that serve the purpose you describe. I hadn't heard of it before; guess I'd better read up on it! Controlling window focus is a huge problem, and it would be grand if this solves it.

My python page
My ShareCG freebies


c1rcle ( ) posted Fri, 13 September 2002 at 4:37 AM

:) just call me the problem solver, problem to my friends ;)


jcarp ( ) posted Fri, 13 September 2002 at 1:53 PM

Focus_set() (Focus() is the same thing) is probably what you need (w.focus() gives widget w focus when its window is clicked). Grab_set() takes ALL the events for the application, which usually makes it real hard to do anything outside the grabbing widget.

Focus_force() will give the widget and its window focus without having to click the window. You probably want to be a little thoughtful about doing this, as it's easy to be rude.

Also, lift() will bring your window to the top, if that's a problem.

I wish I had a good reference for this topic, but I don't. Try it out.


jcarp ( ) posted Fri, 13 September 2002 at 2:12 PM

Attached Link: http://www.python.org/topics/tkinter/doc.html

hey, if you're reading Tkinter.py for documentation, you might want to try the documents in the link, not that you'll find any of them much help on this particular topic.

Also thanks for reporting the version in P5. But is it 2.2 or 2.2.1?


ockham ( ) posted Fri, 13 September 2002 at 5:31 PM

Thanks for clarity. I was just making a quick check to see if grab() was present; I mainly use some PDF files from pythonware.org for docs. And the main Python22.dll is definitely plain 2.2, not 2.2.1.

My python page
My ShareCG freebies


c1rcle ( ) posted Sat, 14 September 2002 at 1:17 PM

1 thing I've noticed which is a real pain right now, Poser4 Python is disabled if you install the full python 2.2.1, guess I will have to wait for poser5 before I really get started on python properly :(


jcarp ( ) posted Sat, 14 September 2002 at 2:19 PM

OK, now I'm curious about focus control and disappearing windows in Poser Python and the idea that grabs might be the solution to something. What are the problems you're seeing?

I don't have ProPack (I'm waiting for P5 on OS X and hoping I'm not to be looking up admiringly at the flocks of pigs flying south over the skating rink in Hell when it arrives), so I apologize in advance if what I have to say is irrelevant to the real problem.

Do scripts launch windows that disappear behind the Poser window (which takes the whole display, naturally) once they lose focus? Do they have focus on launch?

If that's the case, I have a clue about why it happens, which I'll spare you. However, you might try these possible solutions:

For focus on launch of window w, use w.focus_force() in your script.

To keep the window on top, bind its FocusOut event, and in the handler raise the window to the top. Here's the short version. (Square for angle brackets):

w.bind( [FocusOut] , lambda e: w.lift())

Is this anywhere close to relevant?


jcarp ( ) posted Sat, 14 September 2002 at 2:35 PM

c1rcle,

Guessing again, but is it a PATH problem? Have you tried changing $PATH and $PYTHONPATH so they're appropriate for what you're trying to use. If that's the problem, you could write a script to set the paths for whichever you want to use at the moment. I think they can't both be on the $PATH and both be happy is what I'm trying to say. HTH (MCH)


c1rcle ( ) posted Sat, 14 September 2002 at 2:39 PM

I didn't think of that :D I'll give it a go & let you knwothanks :)


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.