Forum: Poser Python Scripting


Subject: Detect if a Poser UI panel is closed, and open it

HartyBart opened this issue on Nov 07, 2022 ยท 9 posts


HartyBart posted Mon, 07 November 2022 at 4:22 PM

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...

import poser
import wx
import wx.aui

man = poser.WxAuiManager()
root = man.GetManagedWindow()

for pane in man.AllPanes:
    w = pane.window
    print("Window Name:",w.Name)


...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...

# Detect and show the Poser panel/window for the Animation Controls,
# if not already open. If this panel is already open, do nothing.
import poser
import wx
import wx.aui

bIsShown=False
for x in poser.WxAuiManager().GetManagedWindow().Children:
    try:
        if x.GetName()=="SmallAnim":
            bIsShown=x.IsShown()
        for y in x.Children:
            if y.GetName()=="SmallAnim":
                bIsShown=x.IsShown()
    exceptpass
if not bIsShown:
    poser.ProcessCommand(1459)



Learn the Secrets of Poser 11 and Line-art Filters.