Brushstroke Tools: Initial Version #328
@ -51,23 +51,25 @@ class BSBST_preferences(bpy.types.AddonPreferences):
|
||||
row = layout.row()
|
||||
col = row.column()
|
||||
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.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:
|
||||
if not resources_available:
|
||||
col = row.column()
|
||||
col.alert = True
|
||||
op = col.operator('brushstroke_tools.copy_resources', icon='IMPORT')
|
||||
op.update = False
|
||||
elif self.resource_path:
|
||||
op = row.operator('brushstroke_tools.copy_resources', icon='IMPORT', text='')
|
||||
op.update = True
|
||||
col = layout.column()
|
||||
col.alert = True
|
||||
if not resources_available:
|
||||
col.label(text='The required resources were not found at the specified directory.', icon='ERROR')
|
||||
|
||||
split = layout.split(factor=0.25)
|
||||
split.column()
|
||||
col = split.column()
|
||||
if not dir_exists:
|
||||
col.alert = True
|
||||
row = col.row()
|
||||
row.label(text='The selected directory does not exist.', icon='ERROR')
|
||||
elif not resources_available:
|
||||
col.alert = True
|
||||
split = col.split(factor=0.75)
|
||||
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
|
||||
|
||||
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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user