Forum: Poser Python Scripting


Subject: Disabling the 'Animation' window.

timarender opened this issue on Mar 28, 2012 · 4 posts


timarender posted Wed, 28 March 2012 at 10:00 AM

If I run a script which involves many "SerValues", the running time is alot longer if the 'animation window' is open.

Is there any way (using Script) to temporarily disable the 'animation window' whilst the python script runs?

For example, this completes almost instantly when the window is closed:

import poser
scene = poser.Scene()
actor = scene.CurrentActor()
for n in range(1,100):
    scene.SetFrame(n)
    parm = actor.ParameterByCode(poser.kParmCodeXTRAN)
    parm.SetValue(n)

print "done"
scene.DrawAll()


PhilC posted Wed, 28 March 2012 at 11:17 AM

Try this:-

#test open/close animation palette

import poser, time

try:
    poser.PaletteById(poser.kCmdCodeANIMATIONPALETTE).Show(1)
    print "Animation palette opened."
except:
    print "Unable to open animation palette."

poser.Scene().DrawAll()
time.sleep(20)

try:
    poser.PaletteById(poser.kCmdCodeANIMATIONPALETTE).Show(0)
    print "Animation palette closed."
except:
    print "Unable to close animation palette."
poser.Scene().DrawAll()

I found that this appeared to enable/disable the palette rather than open and close it. I suspect that it is going to be far easier to start with a pop up message asking the user to ensure that the palette is closed before running the script.


Dizzi posted Wed, 28 March 2012 at 11:33 AM

Attached Link: http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2794782

For Poser 8+ it can probably work the same way as I demonstrated in the linked script for the python script palette.



timarender posted Wed, 28 March 2012 at 1:01 PM

Thank you both for very helpful suggestions.
The script is for my own use. And Phil's code works perfectly ok for my purposes.

The "ANIMATIONPALETTE.Show" does appear to disable the redraws on the window. But, as Phil suggests, it is not a suitable safe method for general Users. Without loads of additional error trapping etc. If the script fails; the AnimationPalette could appear visible, but remain inoperable (requring the User to close and reopen the palette).

Interestingly, when I use the "Import" menu in Poser, the Library window becomes disabled; but also looks disabled (greyed out) as well.

But I am happy now.