Add macOS build helper for Blender 5.1 Python 3.13#73
Open
HMiranda00 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a macOS build helper for Blender 5.1 / Python 3.13, documents the CPython ABI mismatch that prevents Python 3.11 extension modules from loading in Blender 5.1, and adds
.skpdrag-and-drop import support through Blender'sFileHandlerAPI.Why
Blender 5.1 bundles Python 3.13. When the add-on ships with
sketchup.cpython-311-darwin.so, Blender cannot import the nativesketchupmodule. The error shown by Blender can look like a circular import:The root cause is that the binary extension was compiled for CPython 3.11, while Blender 5.1 imports CPython 3.13 extension modules.
What changed
scripts/build_macos_blender_extension.sh.README.md..skpFileHandlerthat forwards dropped files toimport_scene.skp.SKP Importsand a per-fileSKP - <filename>collection, instead of relying on shared top-level import collections.Python.h,CPYTHON_SOURCE_DIRfor offline/header-cache builds,sketchup.cpython-313-darwin.so,SketchUpAPI.frameworkinstall name to@loader_path,Validation
Tested locally on macOS arm64 with Blender 5.1.0 / Python 3.13.9:
The resulting module also loaded from Blender's add-on directory after being copied into
~/Library/Application Support/Blender/5.1/scripts/addons/sketchup_importer/.The Python add-on file was syntax-checked with Blender's bundled Python: