Forum: Poser Python Scripting


Subject: Detecting Poser shutdown in Python script ?

madz opened this issue on Feb 21, 2002 ยท 3 posts


madz posted Thu, 21 February 2002 at 6:07 AM

Hello all !

Does anyone knows way to get a notification in a python
script when poser is about to exit (via File->exit) ?
One might have a need to do some clean-up in python
before poser (and the python interpreter) is shut down...

All hints welcome!
Thanks
madz


ockham posted Mon, 25 February 2002 at 5:35 PM

I've been thinking about this. Python can detect a small number of "events", but shutdown of Poser itself is not listed among them. One thing that is among the listed events (in the PPP help file for Python) is closing the existing PZ3 file, which always happens along with a complete exit but also may happen within a session. Would that serve your purpose? And what sort of cleanup do you want?

My python page
My ShareCG freebies


madz posted Tue, 26 February 2002 at 3:29 AM

Thanks, ockham ! Yes, thats a good hint . I'm currently working on a thingy to load poser files from arbitrary locations, or, otherway round, a Win "Send To" which sends stuff to poser. v0.1 will be released the next days. Since this works with python network communication on the local host, my problem is how to shut down the networking sockets gracefully when Poser is closed. Right now, they hang around doing nothing after Poser exit, and it needs quite a while untils the OS kicks them. Thanks again, madz