check for presets in addons dirs. this way addons can install their own presets too.
This commit is contained in:
parent
7c5c256fd5
commit
a8b19260cf
@ -349,6 +349,14 @@ def preset_paths(subdir):
|
||||
raise Exception("invalid subdir given %r" % subdir)
|
||||
elif _os.path.isdir(directory):
|
||||
dirs.append(directory)
|
||||
|
||||
# Find addons preset paths
|
||||
import addon_utils
|
||||
for path in addon_utils.paths():
|
||||
directory = _os.path.join(path, "presets", subdir)
|
||||
if _os.path.isdir(directory):
|
||||
dirs.append(directory)
|
||||
|
||||
return dirs
|
||||
|
||||
|
||||
|
@ -76,6 +76,7 @@ class AddPresetBase():
|
||||
if hasattr(self, "add"):
|
||||
self.add(context, filepath)
|
||||
else:
|
||||
print("Writing Preset: %r" % filepath)
|
||||
file_preset = open(filepath, 'w')
|
||||
file_preset.write("import bpy\n")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user