From d92263ddde267caf55a33fba0351f1f827e0ae43 Mon Sep 17 00:00:00 2001 From: Miguel Pozo Date: Sat, 20 Jul 2024 23:34:45 +0200 Subject: [PATCH] Remove Blender version hard requirement From now own Malt can work with any future version as long as there's no Blender Python API breakage. --- .github/workflows/BlenderMalt.yml | 4 +--- BlenderMalt/__init__.py | 20 ++++---------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/BlenderMalt.yml b/.github/workflows/BlenderMalt.yml index 0042463f..248576fc 100644 --- a/.github/workflows/BlenderMalt.yml +++ b/.github/workflows/BlenderMalt.yml @@ -32,8 +32,7 @@ jobs: body: | [**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Windows.zip) [**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Linux.zip) - - *(Requires Blender 4.1)* + - name: Rollback Tagged Release uses: author/action-rollback@stable @@ -56,7 +55,6 @@ jobs: [**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Windows.zip) [**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Linux.zip) - *(Requires Blender 4.1)* outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} diff --git a/BlenderMalt/__init__.py b/BlenderMalt/__init__.py index 2f55671a..1a58a4ca 100644 --- a/BlenderMalt/__init__.py +++ b/BlenderMalt/__init__.py @@ -13,13 +13,6 @@ from os import path import bpy -def version_missmatch(): - return bpy.app.version[:2] != bl_info['blender'][:2] -def version_missmatch_message(): - if version_missmatch(): - v = bl_info['blender'] - return f"Malt loading aborted. The installed Malt version only works with Blender {v[0]}.{v[1]}" - #Add Malt and dependencies to the import path __CURRENT_DIR = path.dirname(path.realpath(__file__)) __MALT_PATH = path.join(__CURRENT_DIR, '.MaltPath') @@ -63,10 +56,6 @@ def update_debug_mode(self, context): def draw(self, context): layout = self.layout - if version_missmatch(): - layout.label(text=version_missmatch_message(), icon='ERROR') - return - if context.scene.render.engine == 'MALT': layout.operator('wm.path_open', text="Open Session Log").filepath=sys.stdout.log_path else: @@ -130,9 +119,12 @@ def do_windows_fixes(): if platform.system() == 'Windows': sys.executable = sys._base_executable # Use python-gpu on windows (patched python with NvOptimusEnablement and AmdPowerXpressRequestHighPerformance) + python_gpu_path = path.join(__MALT_DEPENDENCIES_PATH, 'python-gpu-{}.exe'.format(_PY_VERSION)) + if os.path.exists(python_gpu_path) == False: + print(f"MALT WARNING: python-gpu-{_PY_VERSION}.exe not found. Performance might be affected.") + return python_executable = path.join(sys.exec_prefix, 'bin', 'python-gpu-{}.exe'.format(_PY_VERSION)) if os.path.exists(python_executable) == False: - python_gpu_path = path.join(__MALT_DEPENDENCIES_PATH, 'python-gpu-{}.exe'.format(_PY_VERSION)) try: copy(python_gpu_path, python_executable) except PermissionError as e: @@ -201,10 +193,6 @@ def get_modules(): def register(): for _class in classes: bpy.utils.register_class(_class) - - if version_missmatch(): - print(version_missmatch_message()) - return import importlib for module in get_modules():