Filter: Safe | Wed, Apr 22, 10:53 AM CDT

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Lobo3433, Staff Forum Coordinators: Anim8dtoon

Poser Python Scripting F.A.Q (Last Updated: 2026 Apr 22 10:09 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: Environment variables - Mac equivalent of APPDATA


3dcheapskate ( ) posted Tue, 28 April 2020 at 3:07 AM · edited Fri, 17 April 2026 at 1:24 PM

Environment variables - what's the Mac equivalent of APPDATA ?


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) 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.




adp001 ( ) posted Tue, 28 April 2020 at 4:45 AM

Is the APPDATA concept not Windows specific?

Using Python, os.gentenv("HOME") should you return the current users home directory.

Scripts running in Poser are part of the Poser-App. No need to keep some orphans which are dependent on Poser after Poser is deinstalled. On the other side: If I move Posers data area, I want to move script dependant data too.

Data areas under Poser-Pythons script path are completely safe and secure under all operating systems.




3dcheapskate ( ) posted Tue, 28 April 2020 at 5:55 AM · edited Tue, 28 April 2020 at 5:59 AM

Perhaps "the Mac equivalent of APPDATA" was the wrong phraseology. In Windows, APPDATA appears to be the place where applications are supposed to save user-specific configuration files, etc. Sothe question'sreally where do Mac applications usually put their user-specific configuration files, etc ?

Regarding file location - the spanner in the works is that the specific datafile in question here is for both* Poser and DAZ Studio.

As I understand things now, because both PoserPython scripts and DAZ Scripts will need to be able to write to the file, it cannot go anywhere that the OS considers to be part of either the Poser or DAZ Studio installation, because the other program would be forbidden from writing to it.

Therefore in Windows a "%APPDATA%/Roaming/3DCheapskate_Pose_DAZ_SmartPlus" folder containing my "SmartPlusData.txt" file seems the best solution at present.

So now I'm really looking for the most sensible place to put my ":3DCheapskate_Pose_DAZ_SmartPlus:SmartPlusData.txt" file on a Mac.

*yes, I really do need (want?) to use exactly the same single file for both Poser and DAZ Studio.

Edit: forgot to add a crosslink to the original thread - How do you avoid UAC problems writing to poser.AppLocation() subfolders ?


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) 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.




adp001 ( ) posted Tue, 28 April 2020 at 11:29 AM

In a unixoid OS the users home directory is where apps store files. Where path-/filenames starting with a dot (".") in "home" are special and such pathnames are often used as "application pathes". All other pathes may need a special user to create/modify files.

By the way: os.getenv("USER") and os.getenv("HOME") seems to deliver nothing with Poser-Python (at least in my installation).




adp001 ( ) posted Tue, 28 April 2020 at 11:51 AM
path = os.path.expanduser("~/3Dcheapskate/config.txt")
os.mkdir(os.path.dirname(path))
fh = open(path, "w")
fh.close()

seams to deliver something useful with Windows, under Poser and also with Linux (should be the same with OSX).




3dcheapskate ( ) posted Thu, 30 April 2020 at 1:34 AM

adp001 posted at 1:33PM Thu, 30 April 2020 - #4387630

...

By the way: os.getenv("USER") and os.getenv("HOME") seems to deliver nothing with Poser-Python (at least in my installation).

I assume you're talking Windows there ?


The 3Dcheapskate (also available in DAZ and HiveWire3D flavours) 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.




an0malaus ( ) posted Thu, 07 May 2020 at 10:28 AM · edited Thu, 07 May 2020 at 10:28 AM

The place where Poser puts its preferences in macOS (returned by poser.PrefsLocation() ) returns "/Users/[USERNAME]/Library/Application Support/Poser Pro/11". As you can see from the "Application Support" folder name, this is entirely equivalent to the Windows concept of AppData.

Again, I say. "Just use poser.PrefsLocation()!" If you don't like it being associated with Poser, because you want it for application data sharing, though if Poser weren't one of the apps you're sharing data between, that would be the sole reason I could imagine for not putting it there, as I suggested in the other thread, put your subfolder within the parent of the parent of poser.PrefsLocation(), or ~/Library/Application Support/Somewhere Nobody Will Ever Look But Can Always Write To. ;-)



My ShareCG Stuff

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


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.