Skip to content

Commit

Permalink
Fix CLIP model download steps for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
UuuNyaa committed Jan 3, 2023
1 parent e598afe commit 3e3ca7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion motion_generate_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
bl_info = {
"name": "motion_generate_tools",
"author": "UuuNyaa",
"version": (0, 0, 3),
"version": (0, 0, 4),
"blender": (3, 3, 0),
"location": "View3D > Sidebar > Panel",
"description": "Utility tools for motion generating.",
Expand Down
34 changes: 17 additions & 17 deletions motion_generate_tools/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def _lines_append(line: str):
class DownloadClipModel(bpy.types.Operator):
bl_idname = 'motion_generate_tools.download_clip_model'
bl_label = 'Download CLIP Model'
bl_options = {'REGISTER'}
bl_options = {'REGISTER', 'INTERNAL'}

@classmethod
def poll(cls, _context):
return not setup_utils.is_installer_running()
return (not setup_utils.is_installer_running()) and setup_utils.get_required_modules()['clip']

def execute(self, context):
_LINES.clear()
Expand All @@ -37,7 +37,7 @@ def execute(self, context):
class DeleteClipModel(bpy.types.Operator):
bl_idname = 'motion_generate_tools.delete_clip_model'
bl_label = 'Delete CLIP Model'
bl_options = {'REGISTER'}
bl_options = {'REGISTER', 'INTERNAL'}

@classmethod
def poll(cls, _context):
Expand All @@ -52,7 +52,7 @@ def execute(self, _context):
class UpdatePythonModulesOperator(bpy.types.Operator):
bl_idname = 'motion_generate_tools.update_python_modules'
bl_label = 'Update Python Modules'
bl_options = {'REGISTER'}
bl_options = {'REGISTER', 'INTERNAL'}

use_gpu: bpy.props.BoolProperty(default=False)

Expand All @@ -74,7 +74,7 @@ def execute(self, context):
class UninstallPythonModulesOperator(bpy.types.Operator):
bl_idname = 'motion_generate_tools.uninstall_python_modules'
bl_label = 'Uninstall Python Modules'
bl_options = {'REGISTER'}
bl_options = {'REGISTER', 'INTERNAL'}

@classmethod
def poll(cls, _context):
Expand All @@ -93,7 +93,7 @@ def execute(self, context):
class ListPythonModulesOperator(bpy.types.Operator):
bl_idname = 'motion_generate_tools.list_python_modules'
bl_label = 'List Python Modules'
bl_options = {'REGISTER'}
bl_options = {'REGISTER', 'INTERNAL'}

@classmethod
def poll(cls, _context):
Expand All @@ -117,17 +117,6 @@ class MotionGenerateToolsAddonPreferences(bpy.types.AddonPreferences):
def draw(self, _context: bpy.types.Context):
layout = self.layout

col = layout.column(align=True)
flow = col.grid_flow(align=True)
flow.row().label(text="CLIP Model:")
is_clip_model_exist = setup_utils.is_clip_model_exist()
if not is_clip_model_exist:
flow.row().label(text="Not found", icon='ERROR')
col.operator(DownloadClipModel.bl_idname)
else:
flow.row().label(text="OK", icon='CHECKMARK')
col.operator(DeleteClipModel.bl_idname)

col = layout.column(align=True)
flow = col.grid_flow(align=True)
flow.row().label(text="Required Python Modules:")
Expand All @@ -140,6 +129,17 @@ def draw(self, _context: bpy.types.Context):
flow.row().operator(UninstallPythonModulesOperator.bl_idname)
flow.row().operator(ListPythonModulesOperator.bl_idname)

col = layout.column(align=True)
flow = col.grid_flow(align=True)
flow.row().label(text="CLIP Model:")
is_clip_model_exist = setup_utils.is_clip_model_exist()
if not is_clip_model_exist:
flow.row().label(text="Not found", icon='ERROR')
col.operator(DownloadClipModel.bl_idname)
else:
flow.row().label(text="OK", icon='CHECKMARK')
col.operator(DeleteClipModel.bl_idname)

col = layout.column(align=False)
row = col.row(align=True)
row.prop(
Expand Down

0 comments on commit 3e3ca7f

Please sign in to comment.