Forum: Poser Python Scripting


Subject: How do you avoid UAC problems writing to poser.AppLocation() subfolders ?

3dcheapskate opened this issue on Apr 23, 2020 ยท 38 posts


3dcheapskate posted Sun, 26 April 2020 at 11:35 PM

Thanks everybody, lots of good feedback there.

Regarding the temporary pose file TempPose.pz2, poser.TempLocation() is almost certainly the best place for that. The file is created-and-written/overwritten by the script and then immediately loaded by the script (it's a workaround for stuff that PoserPython doesn't do properly, mentioned at the bottom of this post), so the fact that each version of Poser uses one from a different location doesn't matter.

However, the datafile is another matter. I think I mentioned that, not only do I want all versions of Poser that are installed on the system to use the same single datafile, but all versions of DAZ Studio too. poser.PrefsLocation() is therefore not an option since DAZ Studio has no way to access that location. So it really has to be one of the os.environ[WHATEVER] locations.

And since Poser and DAZ Studio both run on Windows and Mac, os.environ[WHATEVER] has to be one that exists on both. Does the environment variable USERPROFILE exist on a Mac ?

Also, looking at the existing subfolders in os.environ[USERPROFILE] on my system (i.e. C:/Users/[username]/) I don't think a '3DCheapskate' or 'SmartPlus' folder at that level (alongside the Windows standard Desktop, Downloads, Documents, etc folders) would be appropriate, although SmithMicro DLM and GIMP have created folders there (and that has always irritated me). So I'm leaning towards perhaps C:/Users/[username]/AppData/Roaming/3DCheapskate-Poser-DAZ-SmartPlus. 'Roaming' rather than 'Local' because there are already 'DAZ 3D', 'Poser', and 'Poser Pro' folders in the latter, but none in the former. And the rather long folder name '3DCheapskate-Poser-DAZ-SmartPlus' because I've always hated folder names that leave you wondering who put them there and what they're for.

So that shouldbe okay for Windows. But what about a Mac ? What's the equivalent to 'C:/Users/[username]/AppData/Roaming' there, where both Poser and DAZ Studio put user files ?


The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident. And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU or something else.
*soon only to be available in two flavours - 
 DAZ and Renderosity