Brushstroke Tools: Initial Version #328

Merged
Simon Thommes merged 229 commits from SimonThommes/blender-studio-tools:brushstroke_tools-initial-version into main 2024-11-06 15:03:47 +01:00
Showing only changes of commit dd768bc74d - Show all commits

View File

@ -6,11 +6,11 @@ def update_resource_path(self, context):
utils.update_asset_lib_path()
class BSBST_OT_copy_resources_to_path(bpy.types.Operator):
"""
Remove the active Style Preset Library.
Copy Resources to Directory.
"""
bl_idname = "brushstroke_tools.copy_resources"
bl_label = "Copy Resources to Directory"
bl_description = "Remove the modifier to the preset"
bl_label = "Copy Resources"
bl_description = "Copy addon resources to local directory"
bl_options = {"REGISTER", "UNDO"}
update: bpy.props.BoolProperty(default=False)
@ -71,6 +71,18 @@ class BSBST_preferences(bpy.types.AddonPreferences):
split.label(text='The required resources were not found at the specified directory.', icon='ERROR')
op = split.operator('brushstroke_tools.copy_resources', icon='IMPORT')
op.update = False
elif self.resource_path:
lib_version = utils.read_lib_version()
version_comp = utils.compare_versions(lib_version, utils.addon_version)
if bool(version_comp):
col.label(text=f"Version mismatch: Local Data ({'.'.join([str(i) for i in lib_version])}) {'>' if version_comp>0 else '<'} Addon ({'.'.join([str(i) for i in utils.addon_version])})", icon='ERROR')
split = col.split(factor=0.75)
if version_comp>0:
split.label(text="Consider upgrading the addon or re-copying the data.")
else:
split.label(text="Consider upgrading re-copying the data.")
op = split.operator('brushstroke_tools.copy_resources', icon='IMPORT')
op.update = False
if self.import_method == 'LINK' and not self.resource_path:
col.label(text='Linking the resources from the default addon directory is not recommended.', icon='ERROR')