diff --git a/CHANGELOG.md b/CHANGELOG.md index 5282ef5..474f6d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## unreleased +### Changed +* Improved the error message when attempting to install the addon on an unsupported Blender version. + ### Fixed * Fixed an issue where exporting would fail if an image texture did not use the expected naming convention. * Fixed an issue where some models would not correctly generate outline meshes for all relevant meshes. diff --git a/xenoblade_blender/__init__.py b/xenoblade_blender/__init__.py index 7108983..3d2f71b 100644 --- a/xenoblade_blender/__init__.py +++ b/xenoblade_blender/__init__.py @@ -55,6 +55,13 @@ def menu_import_camdo(self, context): def register(): + if bpy.app.version < bl_info["blender"]: + current_version = ".".join(str(v) for v in bpy.app.version) + expected_version = ".".join(str(v) for v in bl_info["blender"]) + raise ImportError( + f"Blender version {current_version} is incompatible. Use version {expected_version} or later." + ) + for cls in classes: bpy.utils.register_class(cls)