Tue, Nov 19, 9:14 AM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Disabling the 'Animation' window.


timarender ( ) posted Wed, 28 March 2012 at 10:00 AM · edited Tue, 19 November 2024 at 7:31 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.


Privacy Notice

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.