Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
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"
Here is an example of a non-docking wxPython window taken from my Python for Poser Tutorial/Manual.
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()
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
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)
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.
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