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 b3263d9d01 - Show all commits

View File

@ -51,23 +51,25 @@ class BSBST_preferences(bpy.types.AddonPreferences):
row = layout.row() row = layout.row()
col = row.column() col = row.column()
dir_exists = os.path.isdir(utils.get_resource_directory()) dir_exists = os.path.isdir(utils.get_resource_directory())
if not dir_exists: resources_available = os.path.isfile(f"{utils.get_resource_directory()}brushstroke_tools-resources.blend")
if not dir_exists or not resources_available:
col.alert = True col.alert = True
col.prop(self, 'resource_path', placeholder=utils.get_resource_directory()) col.prop(self, 'resource_path', placeholder=utils.get_resource_directory())
resources_available = os.path.isfile(f"{utils.get_resource_directory()}brushstroke_tools-resources.blend")
if dir_exists: split = layout.split(factor=0.25)
if not resources_available: split.column()
col = row.column() col = split.column()
col.alert = True if not dir_exists:
op = col.operator('brushstroke_tools.copy_resources', icon='IMPORT') col.alert = True
op.update = False row = col.row()
elif self.resource_path: row.label(text='The selected directory does not exist.', icon='ERROR')
op = row.operator('brushstroke_tools.copy_resources', icon='IMPORT', text='') elif not resources_available:
op.update = True col.alert = True
col = layout.column() split = col.split(factor=0.75)
col.alert = True split.label(text='The required resources were not found at the specified directory.', icon='ERROR')
if not resources_available: op = split.operator('brushstroke_tools.copy_resources', icon='IMPORT')
col.label(text='The required resources were not found at the specified directory.', icon='ERROR') op.update = False
if self.import_method == 'LINK' and not self.resource_path: 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') col.label(text='Linking the resources from the default addon directory is not recommended.', icon='ERROR')