Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Wonderful, thanks Dizzi. This is tested and working in Poser 11 and 12 on Windows....
Learn the Secrets of Poser 11 and Line-art Filters.
Thanks, both. Further tests show a problem. Works 'as described' for PythonPalette, for which it was originally intended. Also for AnimationPalette.
But does not work with the AnimationControls panel. I suspect that what fooled me into thinking it did, for a moment, was that the script defaults to the poser.ProcessCommand - and that does work. But only by toggling Animation Controls panel on/off un-intelligently. Which was my opening problem in this thread.
I suspect the script cannot find AnimationControls because there is no such panel label. It must be one of the panels without a given PaletteById 'Palette Code', which appears to be required. The available Palette Codes are listed in the Poser manual, and there are only a few.
This missing panel label (if there is one) is not an undocumented variant either, as I tried various:
AnimationControls
AnimationControl
Animation Control
Animation_Controls
AnimationControlsPalette
etc
Learn the Secrets of Poser 11 and Line-art Filters.
The correct way would not be to address the window itself, but rather the AuiManager, which is responsible for the layout.
Each regular window is provided with a wrapper (wx.AuiPaneInfo) that contains everything needed to manage this window in the overall structure. The AuiManager knows all these structures and a Python script can use them.
All Poser windows can be listed this way:
auimgr = poser.WxAuiManager()
poser_windownames = [pane.name for pane in mgr.AllPanes]
If you only need a specific window whose name you know, you can get the AuiPaneInfo structure like this (without error detection):
known_name = "AnimationPalette"
pane_info = [pane for pane in auimgr.AllPanes if pane.name==known_name]
pane_info[0] is now of type wx.AuiPaneInfo()
On the wxPython website you can read what you can do with this structure now: https://docs.wxpython.org/wx.aui.AuiPaneInfo.html
Using the AuiPaneInfo() structure, your own script is able to do everything with the window that Poser can do with it. "ProcessCommand" is no longer needed to show or hide a window.
By the way, the animation part consists of two independent windows ("Panes"): SmallAnim and AnimationPalette
Hah, I got it! Success. I was correct, the above failing script was not detecting the panel as being named AnimationControls. The real Animation Controls label is undocumented, but is actually 'SmallAnim'.
First I used this old mini script...
...to get a list of available panel names in the Poser UI, and I noted there a 'SmallAnim'. Could that be it? Yes, on testing it, that's what its correct label is. This works as I require...
Learn the Secrets of Poser 11 and Line-art Filters.
Thanks adp, I found the answer before I saw your feedback.
I should add also, tested and working in Poser 12.
Learn the Secrets of Poser 11 and Line-art Filters.
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.
I am trying to have a script open the Animation Controls panel in Poser, if the user does not already have it open.
All I have to do this is...
... which partly works, but this particular command will also close the panel (if the user already has it open).
Is there a way for a PoserPython script to detect if a particular Poser UI panel is closed, and open it?
Learn the Secrets of Poser 11 and Line-art Filters.