gregzaal / Gaffer

A light-manager add-on for Blender
386 stars 30 forks source link

Please make Gaffer "Portable" #115

Closed MJH1000 closed 8 months ago

MJH1000 commented 4 years ago

Great Add-on Gregzaal!

Unfortunately I use Blender Portable across 4 different computers. The "data/gaffer" folder is always generated on the C drive which means each computer needs to re-build any changes in that directory.

Please change "data/gaffer" to a subfolder of the HDRI folder selection in the prefs, thanks!

gregzaal commented 4 years ago

Good idea, but I'd rather make it separately customizable since there can possibly be multiple HDRI folders, and someone may want to have the data folder somewhere else instead like a synced dropbox folder.

MJH1000 commented 4 years ago

A separate customizable folder is even better. Keep up the great work.

Felina-Lain commented 3 years ago

I was trying to find the code to do that, I suppose it's in the init.py, but so far I'm having no luck locating the exact code I tried searching for "path" or "settings" to see where those might be used or saved, but I'm not finding anything that looks like it (if I do manage to do it, would you want me to send you the changed code?)

gregzaal commented 8 months ago

The way Gaffer currently has the data folder configured and used, it's not possible to change this via a user preference (the data folder is read before the add-on registers its preferences).

However as a workaround, you can manually hard code the path you want on line 120 of constants.py. By default this looks like:

data_dir = os.path.join(os.path.abspath(os.path.join(bpy.utils.resource_path("USER"), "..")), "data", "gaffer")

And you could change it for example to:

data_dir = "C:/whatever/file/path/you/like"

If on Windows, be sure to use forward slashes (/) or double backslashes (\\). Single backslashes, which you'll get if you copy-paste a folder path, will likely give you some errors.