https://github.com/ousttrue/bpy_module
build blender as module
https://github.com/ousttrue/bpy_module
Last synced: over 1 year ago
JSON representation
build blender as module
- Host: GitHub
- URL: https://github.com/ousttrue/bpy_module
- Owner: ousttrue
- License: gpl-3.0
- Created: 2019-12-02T06:13:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-15T12:09:28.000Z (over 3 years ago)
- Last Synced: 2025-01-21T00:20:10.486Z (over 1 year ago)
- Language: Python
- Size: 597 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bpy_module
* Auto clone, build and install blender python module(bpy)
* Link to local python(C:\Python39)
* generate pyi
* Blender v2.83
## require
* vc2019
* cmake(vc included)
* msbuild(vc included)
* git https://git-scm.com/
* svn https://sliksvn.com/download/
## memo
* blender
* lib
* git worktree
* branch: v2.93-release
* tag: v2.93.0
* tag: v2.93.1
* tag: v2.93.2
* tag: v2.93.3
* tag: v2.93.4
* tag: v2.93.5
## ToDo
* Vector as sequence
* Vector operator +
* Vector assigin =
* Matrix operator @
## doit version
```sh
```
## [obsolete] usage (build and install bpy)
```sh
python builder.py {WORKSPACE_FOLDER} {tag} --update --clean --build --install --stubs
WORKSPACE_FOLDER
+ blender(git clone)
+ lib(svn checkout)
+ build(cmake build)
```
* update: git clone and svn update
* clean: clear WORKSPACE_FOLDER/build
* build: cmake and msbuild
* install: copy dll and *py to PYTHON_FOLDER/lib/site_lib/blender and PYTHON_FOLDER/2.XX
example
```sh
> C:\Python38\python.exe builder.py --update --build --install C:/bpy_module v2.83
# link to C:\Pyhthon38\libs\python38.lib and install to C:\Python38
```
## generate python stub(pyi)
* Generate pyi stub from installed bpy
* Baseed on https://github.com/mutantbob/pycharm-blender
* Bassed on https://github.com/blender/blender/blob/master/doc/python_api/sphinx_doc_gen.py
```sh
python stub_generator.py
```
example
```sh
> C:\Python38\python.exe stub_generator.py
# generate C:\Python38\lib\site-package\blender\bpy\__init__.pyi
# generate C:\Python38\lib\site-package\blender\mathutils.pyi
```
### use stub on vscode
* install pylance
```json
// settings.json
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
```