Tue, Nov 19, 7:42 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: Poser 8: (un)Binding Events


Dizzi ( ) posted Wed, 25 November 2009 at 6:23 AM · edited Tue, 19 November 2024 at 7:28 AM

Did anyone manage to bind keyboard events to a wxPanel?
Is unbinding events possible? I'm getting a Python error when doing an Unbind, but I have no idea if that's a broken Python lib or me ;-) 



semidieu ( ) posted Wed, 25 November 2009 at 6:47 AM

From what I know, it is not possible to do this for a wxPanel. It can be done for wxDialog I think.


nruddock ( ) posted Wed, 25 November 2009 at 3:02 PM

I can't see anything to suggest that you can't Bind key events to a panel, but the problem I supsect  you'll run into is one of the Panel having focus (aspects of the Poser GUI may exacerbate this) or making sure controls within the panel pass unhandled key events up the chain.


Dizzi ( ) posted Wed, 25 November 2009 at 3:32 PM · edited Wed, 25 November 2009 at 3:32 PM

Quote - I can't see anything to suggest that you can't Bind key events to a panel, but the problem I supsect  you'll run into is one of the Panel having focus (aspects of the Poser GUI may exacerbate this) or making sure controls within the panel pass unhandled key events up the chain.

 Yes, you're right, I shouldn't have tested that late at night, it works, if the panel is selected. Thanks :-)

I also found a way to stop Poser reacting to the pressed key:
Bind components of Panel to EVT_KEY_DOWN
and have the event handler do event.SetUnicodeKey(0)... I'm not sure if that's safe to do, but it works at the moment ;-) (maybe it stops when I try that again tomorrow ;-))



Dizzi ( ) posted Wed, 25 November 2009 at 5:37 PM

Probably better to use event.StopPropagation()

I've got still no idea, why Unbind gives

Traceback (most recent call last):<br></br>File "P:Poser 8RuntimePythonposerScriptsScriptsMenumousewheelposing.py", line 79, in EvtKey
self.Unbind(wx.EVT_KEY_DOWN, self.EvtKey)
File "P:Poser 8RuntimePythonlibsite-packageswx-2.8-msw-ansiwx_core.py", line 3916, in Unbind
id  = source.GetId()
AttributeError: 'function' object has no attribute 'GetId'



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.