-- The Pain Point for Development in Blender Python --
Blender does not expose its Python API (bpy) as standard Python files outside of its built-in text editor. This makes add-on development in external IDEs tedious and prone to type errors.
-- Solution & How it Works --
Instead of relying on the starndard inspect module which often fails to handle edge cases in Blender's dynamic environment. fake-bpy-module parses the official Blender Python API documentation to generate .pyi stub files.
Of course, documentation parsing comes with its own challenges. Some APIs are undocumented, and others cannot be used as-is (such as the bpy_prop_collection class). To address this, the generator internally transforms and patches the types during the stub generation phase to ensure strict compatibility.
-- Availability & Daily CI/CD --
The stubs are available via PyPI (ex. pip install fake-bpy-module-5.2) and support a wide range of Blender versions.
The latest stubs based on the latest Blender code are also available (pip install fake-bpy-module). To realize this, our custom CI/CD system builds the Blender binary daily from the latest source code.
-- Sub-project: fake-bge-module --
UPBGE is an open-source game engine fork based on Blender. I have also created a dedicated sub-project fake-bge-module, for the UPBGE Python API (bge). https://github.com/nutti/fake-bge-module
I would love to hear your feedback on these tools!
loading...