For people that launch via terminal, it should just be the directory in which the program is invoked, but I’m not sure what happens (on all 3 platforms) when blender is launched via some GUI (like clicking on a .blend file to open it).
If anyone here knows explicitly, please confirm this one way or the other.
If not, I would appreciate it if you could test this on your own platform:
Open a .blend, and post the result of running the following script (via “Run Script”):
import os
import bpy
print("-----------------------------------")
print(os.getcwd())
print(bpy.path.abspath("//"))
print("-----------------------------------")
Ok, based on these tests, it seems like blender doesn’t do anything internally; the current working directory may, or may not be set by the system to be that of the opened file.
That’s all I needed to know - Thanks guys.
@ Monster
I’m working on a blender plug-in, so bpy is the right module … Although, maybe I should have asked this in the Python forum.
This is on Windows. If you load Blender first then open a project then the CWD is where Blender is. If you double click on a blend file then the CWD is the location of the blend.