Sun, Jan 5, 4:17 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 Dec 02 3:16 pm)

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: Non-docking option for wxPython windows?


face_off ( ) posted Mon, 18 June 2012 at 12:19 AM · edited Sun, 05 January 2025 at 12:44 AM

Hi

I haave searched the wxPython doco high and low, and been unable to determine how to create a wx.Panel window in Poser that does NOT dock when moved on the Poser UI (ie. I want it always floating).  Does anyone know how to do this?

Thanks

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook


grichter ( ) posted Mon, 18 June 2012 at 2:20 AM

no...just starting to mess with wxpython myself and studying the examples under scriptsmenu:partners: that came with p9 and PP2012

they are uncompressed py's in there that do not dock (they float) also snarly's scenefixer is the same uncompressed py that floats that you can see the code used to create the window-panel.

Have a look at those scripts it should give you a hint of how it is done

 

what I am trying to figure out is a window-panel that sets to a given minimum size and if needed to based on a list of figures and props in a scene grows bigger in the vertical dimension (some are short lists and some are longer lists based on the number of items in a scene that I want to automatically stretch the window to accomodate.

Good luck

Gary

 

 

 

Gary

"Those who lose themselves in a passion lose less than those who lose their passion"


PhilC ( ) posted Mon, 18 June 2012 at 2:38 AM

Here is an example of a non-docking wxPython window taken from my Python for Poser Tutorial/Manual.

 

"Hello World" wxPython script.

import wx
import wx.py
import wx.aui

try:
    import poser
    scene = poser.Scene()
    man = poser.WxAuiManager()
    root = man.GetManagedWindow()
    print "Running in Poser 8"
    standalone = 0
except:
    standalone = 1

class MyApp(wx.Frame):
    def init(self,parent,title):
        wx.Frame.init(self,parent,title=title,size=(300,200))

        # add panel
        self.p = wx.Panel(self,id=wx.NewId(),size=(300,200))

        # Background colour to match Poser 8
        # Note that is coloUr not color. Yeah Queen's English :)
        self.p.SetBackgroundColour("#4B4B4B")

        # text label
        self.t1 = wx.StaticText(self,-1,"HELLO WORLD",pos=(10,20))
        self.t1.SetForegroundColour("#FFFFFF")
        self.t1.SetBackgroundColour("#4B4B4B")

if name == 'main':
    if standalone == 1:       
        app = wx.App(False)
        frame = MyApp(None, "Hello World")
        frame.Show(True)
        app.MainLoop()
    else:
        frame = MyApp(None, "Hello World")
        frame.Show()
       


face_off ( ) posted Mon, 18 June 2012 at 3:07 AM · edited Mon, 18 June 2012 at 3:07 AM

Thanks Phil

So basically you do a wx.Frame rather than a wx.Panel, and do not use the poser.WxAuiManager().  Appreciate the help.  I'll try that.

Whilst on the subject, have you tried modal frames/dialogs?  I tried a number of ways to do this, but they all failed (can't remember the error/result), so I figured Poser didn't support modal for a specifc reason.

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook


semidieu ( ) posted Tue, 19 June 2012 at 8:32 AM

They do support modal, at least for wxDialog...

 

Interesting to see that you don't need to use the WxAuiManager... Question is... if you do without it, is it still possible to determine if the frame was already opened, to avoid having the same script running twice ? (going to try this a little later)


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.