Forum: Poser - OFFICIAL


Subject: Poser Python "Use File Compression" option: Query/Change?

pikesPit opened this issue on Jan 19, 2020 ยท 9 posts


an0malaus posted Tue, 21 January 2020 at 9:09 AM

Actually, the LICENCE file is a mistake, since that came from another addon product I'd been working on. I am in some internal debate about how to least restrict the use of that code, since there are onerous versions at either end of the scale, such as the one you see, or the GPL, versions of which imply code must remain in the public domain and cannot be onsold as part of something else. However, the real purpose of the package is to, as I see it, fill a gap in what Poser provides. I would love to see all of that incorporated directly into Poser itself, so the addon would be totally redundant. As it stands, recent changes in version information have "broken" some old scripts which expect version numbers in a certain format. Thanks to SnarlyGribbly's workaround, which I incorporated in PoserLib with his attribution and permission, (I must check that that remains in the documentation, as it's in the source code which I haven't released just yet), that's not a problem any more.

Part of PoserLib's long term development has included internal tests for the availability of specific methods in Poser, so it tries to remain version independent. Wherever possible, if Poser has a method to do something, the code will make use of that directly. If not, it attempts to work around the missing feature (sometimes with more success than others). There will, of course, be limits to this, so future features may be restricted to the latest versions of Poser. At the moment, we have quite a large gap in the progression of Poser version operability, with everything from Poser Pro 2014 Game Dev to the last SM release of Poser Pro 11.1 rendered inoperative unless it has a permanent licence key, due to the switchoff of the required SM license servers. But non-Game Dev 2014 and earlier versions can still make use of PoserLib with various functions worked around. Too much earlier, though, and the Python library becomes incompatible unless you have the source python files.

Anyway, as I genuinely hope all of these features eventually find their way into Poser, it doesn't hurt to put it out there, if for no better reason than to polish the code where others find problems I wasn't able to discover on macOS alone. It SHOULD work on windows, but please let me know if you run into any problems.

On the status of the Poser preference file, I believe that it does get saved the moment the user clicks OK in the preferences dialog. There are other things like the library configuration which get written out when Poser exits (the preferences may do as well), but I know from experience that at least one of the preference entries, the LAST_OPEN_SAVE_PATH is updated whenever Poser reads from or writes to the library/filesystem, so that pretty much proves that parsing the file when you run your script will give you a LIVE state of the USE_COMPRESSION setting.

Another project of mine is to parse, load and save poser files without the current restrictions of Poser's parameter filters. There aren't enough required methods in the Python API to actually load a character or scene completely (without using just the direct calls that do so), but poses are fine. Part of the process involves checking whether a file is a compressed format before opening and reading it, or opening it in compressed mode to create/overwrite a pose file. I'm happy to share the code which deals with such, if you'd like to see it.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.