diff --git a/preferences/preferences.py b/preferences/preferences.py index 1a6a078..be02203 100644 --- a/preferences/preferences.py +++ b/preferences/preferences.py @@ -105,22 +105,29 @@ def update_panel_category(self, context): def get_default_executable_path(): - '''Set the default exectuable path for the vhacd exe to the addon folder. ''' + '''Set the default exectuable path for the vhacd executable to the addon folder. ''' path = Path(str(__file__)) parent = path.parent.parent.absolute() vhacd_app_folder = "v-hacd_app" - if platform.system() != 'Windows': + if platform.system() not in ['Windows', 'Linux']: return '' - OS_folder = 'Win' + OS_folder = '' + app_name = '' + + if platform.system() == 'Windows': + OS_folder = 'Win' + app_name = 'VHACD-4_1.exe' + elif platform.system() == 'Linux': + OS_folder = 'Linux' + app_name = 'VHACD' + collider_addon_directory = os.path.join( parent, vhacd_app_folder, OS_folder) if os.path.isdir(collider_addon_directory): - app_name = 'VHACD-4_1.exe' - executable_path = os.path.join(collider_addon_directory, app_name) if os.path.isfile(executable_path): return executable_path @@ -861,9 +868,9 @@ def draw(self, context): row.prop(self, propName) elif self.prefs_tabs == 'VHACD': - text = "Auto convex is only supported for Windows at this moment." + text = "Auto convex is only supported for Windows and Linux at this moment." texts = [text] - if platform.system() != 'Windows': + if platform.system() not in ['Windows', 'Linux']: for text in texts: label_multiline( context=context, diff --git a/ui/properties_panels.py b/ui/properties_panels.py index 23e6632..5b41030 100644 --- a/ui/properties_panels.py +++ b/ui/properties_panels.py @@ -33,12 +33,12 @@ def draw_auto_convex(layout, context): # row.label(text='Auto Convex') - if platform.system() != 'Windows': + if platform.system() not in ['Windows', 'Linux']: op = layout.operator("preferences.addon_search", text="", icon='PREFERENCES') op.addon_name = addon_name op.prefs_tabs = 'VHACD' - text = "Auto convex is only supported for Windows at this moment." + text = "Auto convex is only supported for Windows and Linux at this moment." label_multiline( context=context, text=text, diff --git a/v-hacd_app/Linux/VHACD b/v-hacd_app/Linux/VHACD new file mode 100644 index 0000000..828442e Binary files /dev/null and b/v-hacd_app/Linux/VHACD differ