button to remove presets.
note: this is an option to the add preset operator which is a bit odd but easiest since these classes have all the info needed for removal as well.
This commit is contained in:
@@ -472,3 +472,20 @@ def addon_reset_all():
|
||||
elif is_loaded:
|
||||
print("\taddon_reset_all unloading", mod_name)
|
||||
addon_disable(mod_name)
|
||||
|
||||
def preset_find(name, preset_path, display_name=False):
|
||||
for directory in preset_paths(preset_path):
|
||||
|
||||
if display_name:
|
||||
filename = ""
|
||||
for fn in _os.listdir(directory):
|
||||
if fn.endswith(".py") and name == _bpy.path.display_name(fn):
|
||||
filename = fn
|
||||
break
|
||||
else:
|
||||
filename = name + ".py"
|
||||
|
||||
if filename:
|
||||
filepath = _os.path.join(directory, filename)
|
||||
if _os.path.exists(filepath):
|
||||
return filepath\
|
||||
|
||||
Reference in New Issue
Block a user