Skip to content

Commit d92263d

Browse files
committed
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.
1 parent 43b25c0 commit d92263d

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

.github/workflows/BlenderMalt.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ jobs:
3232
body: |
3333
[**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Windows.zip)
3434
[**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{env.BRANCH_NAME}}-latest/BlenderMalt-Linux.zip)
35-
36-
*(Requires Blender 4.1)*
35+
3736
3837
- name: Rollback Tagged Release
3938
uses: author/action-rollback@stable
@@ -56,7 +55,6 @@ jobs:
5655
[**BlenderMalt-Windows.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Windows.zip)
5756
[**BlenderMalt-Linux.zip**](https://github.com/${{github.repository}}/releases/download/${{github.ref_name}}/BlenderMalt-Linux.zip)
5857
59-
*(Requires Blender 4.1)*
6058
6159
outputs:
6260
upload_url: ${{ steps.create_release.outputs.upload_url }}

BlenderMalt/__init__.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
from os import path
1414
import bpy
1515

16-
def version_missmatch():
17-
return bpy.app.version[:2] != bl_info['blender'][:2]
18-
def version_missmatch_message():
19-
if version_missmatch():
20-
v = bl_info['blender']
21-
return f"Malt loading aborted. The installed Malt version only works with Blender {v[0]}.{v[1]}"
22-
2316
#Add Malt and dependencies to the import path
2417
__CURRENT_DIR = path.dirname(path.realpath(__file__))
2518
__MALT_PATH = path.join(__CURRENT_DIR, '.MaltPath')
@@ -63,10 +56,6 @@ def update_debug_mode(self, context):
6356
def draw(self, context):
6457
layout = self.layout
6558

66-
if version_missmatch():
67-
layout.label(text=version_missmatch_message(), icon='ERROR')
68-
return
69-
7059
if context.scene.render.engine == 'MALT':
7160
layout.operator('wm.path_open', text="Open Session Log").filepath=sys.stdout.log_path
7261
else:
@@ -130,9 +119,12 @@ def do_windows_fixes():
130119
if platform.system() == 'Windows':
131120
sys.executable = sys._base_executable
132121
# Use python-gpu on windows (patched python with NvOptimusEnablement and AmdPowerXpressRequestHighPerformance)
122+
python_gpu_path = path.join(__MALT_DEPENDENCIES_PATH, 'python-gpu-{}.exe'.format(_PY_VERSION))
123+
if os.path.exists(python_gpu_path) == False:
124+
print(f"MALT WARNING: python-gpu-{_PY_VERSION}.exe not found. Performance might be affected.")
125+
return
133126
python_executable = path.join(sys.exec_prefix, 'bin', 'python-gpu-{}.exe'.format(_PY_VERSION))
134127
if os.path.exists(python_executable) == False:
135-
python_gpu_path = path.join(__MALT_DEPENDENCIES_PATH, 'python-gpu-{}.exe'.format(_PY_VERSION))
136128
try:
137129
copy(python_gpu_path, python_executable)
138130
except PermissionError as e:
@@ -201,10 +193,6 @@ def get_modules():
201193

202194
def register():
203195
for _class in classes: bpy.utils.register_class(_class)
204-
205-
if version_missmatch():
206-
print(version_missmatch_message())
207-
return
208196

209197
import importlib
210198
for module in get_modules():

0 commit comments

Comments
 (0)