• Welcome to Dizzi's Support Forum.
 

News:

Welcome to my support forum for Advanced Library and PoseMagic2Pose.

Main Menu

Ensure that a palette is visible

Started by Dizzi, April 04, 2010, 09:56:19 AM

Previous topic - Next topic

Dizzi

If you got a python script that needs the "Python Scripts" palette to be visible, here's a script to ensure the palette is visible. You can for example add these lines to the Wardrobe Wizard script in Poser 8's scripts menu, so the Python Scripts palette opens automatically if it's not already open :-)


#Show python palette
import poser
import wx.aui
bIsShown=False
for x in poser.WxAuiManager().GetManagedWindow().Children:
try:
if x.GetName()=='PythonPalette':
bIsShown=x.IsShown()
for y in x.Children:
if y.GetName()=='PythonPalette':
bIsShown=x.IsShown()
except: pass
if not bIsShown:
poser.ProcessCommand(1509)


If you wanted the hierarchy editor, you'd exchange 'PythonPalette' with 'HierarchyEditor' and poser.ProcessCommand(1509) to poser.ProcessCommand(1488).
If you need other palettes, just print out the x.GetName() and y.GetName() after you opened the palette you want to check for. You can find other ProcessCommands in the Poser.xrc in Runtime\ui.