Brushstroke Tools: Initial Version #328
@ -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')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user