This document shows the procedure for generating module by yourself. You can choose the method to generate module.
The generating script can be run on Python >= 3.5. Ensure that Python version is >= 3.5 on your environment.
The generating script uses the packages listed on requirements.txt. Execute below command to install requirement packages.
$ pip install -r requirements.txt
Download Blender binary from Blender official download site. Download Blender whose version is the version you try to generate modules.
$ git clone git://git.blender.org/blender.git
Download the fake-bpy-module sources from GitHub.
Use Git and clone fake-bpy-module repository.
$ git clone https://github.com/nutti/fake-bpy-module.git
or
Download .zip file from GitHub.
https://github.com/nutti/fake-bpy-module/archive/master.zip
$ cd fake-bpy-module/src
$ sh gen_module.sh <source-dir> <blender-dir> <branch/tag/commit> <output-dir>
<source-dir>
: Specify Blender sources directory.<blender-dir>
: Specify Blender binary directory.<branch/tag/commit>
: Specify target Blender source's branch for generating module.- If you want to generate module for 2.79a, specify v2.79a
- If you want to generate module for newest Blender version, specify master
<output-dir>
: Specify directory where generated modules are output.
Download Blender binary from Blender official download site. Download Blender whose version is the version you try to generate modules.
$ git clone git://git.blender.org/blender.git
Be sure to match the version between sources and binary.
If you try to generate modules for v2.79, you should use git checkout v2.79
.
$ cd blender
$ git checkout [branch/tag/commit]
Generated .rst documents are located on doc/python_api/sphinx-in
.
$ blender --background --factory-startup -noaudio --python doc/python_api/sphinx_doc_gen.py
$ sphinx-build -b xml doc/python_api/sphinx-in <xml-out>
Download the fake-bpy-module sources from GitHub.
Use Git and clone fake-bpy-module repository.
$ git clone https://github.com/nutti/fake-bpy-module.git
or
Download .zip file from GitHub.
https://github.com/nutti/fake-bpy-module/archive/master.zip
$ cd fake-bpy-module/src
$ python gen.py -i <input-dir> -o <output-dir> -t <target> -f <format>
-i <input-dir>
: Specify input directory. (the directory .xml files are located by process 5)-o <output-dir>
: Specify output directory. (the directory generated files will be located)-t <target>
: Specify IDE target. If this option is specified, the optimized modules will be generated.pycharm
: Optimized for PyCharm
-d
: Dump internal data structures to<output-dir>
as the files name with suffix-dump.json
-f <format>
: Format the generated code using formatpep8
: Format generated code using pep8 format