Forum: Poser Python Scripting


Subject: Poser Readscript - weird behavior.

Xameva opened this issue on Jul 11, 2012 · 3 posts


millighost posted Wed, 11 July 2012 at 4:24 PM

Quote - .... From what I can see when loading the fixes with the above script which bugs the fixes, vs the working GUI script, the difference is:

That is plausible; the first script does a complete redraw and process some events after loading any pose file:

    poser.Scene().LoadLibraryPose( n )
    poser.Scene().ProcessSomeEvents(5)
    poser.Scene().DrawAll()     # redraw (costly)

The ProcessSomeEvents(5) looks a bit strange, btw. It might lead to changing the current figure in the midst of the process. I hope you know what you are doing :-)

Not sure why the one script works, but the other does not. But what looks at least a bit dangerous:

The script relies to be in the same path as the pz2 files (probably in the Pose directory of the Library). Are these script installed in the Pose directory? Most scripts are in the Python directory, in which case Poser will start to guess on what file it tries to load; very nasty if you have multiple files with the same name in your runtimes (it can load something from any runtime if you have multiple runtimes and are unlucky). In my experience, you cannot rely on Poser giving you an error message if a file is not there. Sometimes it has an equally named file in its cache or so and instead uses that.