Gaffer icon indicating copy to clipboard operation
Gaffer copied to clipboard

Please make Gaffer "Portable"

Open MJH1000 opened this issue 5 years ago • 3 comments

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!

MJH1000 avatar May 29 '20 11:05 MJH1000

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.

gregzaal avatar May 29 '20 13:05 gregzaal

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

MJH1000 avatar Jun 04 '20 13:06 MJH1000

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?)

Felina-Lain avatar Mar 10 '21 22:03 Felina-Lain

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.

gregzaal avatar Mar 27 '24 07:03 gregzaal