PyDoc: add an "Advanced" section to document WITH_PYTHON_MODULE

Document the use cases, usage and limitations
of using Blender as a Python module.
This commit is contained in:
2022-09-14 15:11:50 +10:00
parent d26220d97a
commit 260b75a952
3 changed files with 149 additions and 1 deletions

View File

@@ -402,8 +402,15 @@ INFO_DOCS = (
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
("info_gotcha.rst",
"Gotcha's: Some of the problems you may encounter when writing scripts"),
("info_advanced.rst",
"Advanced use (topics which may not be required for typical usage)"),
("change_log.rst", "Change Log: List of changes since last Blender release"),
)
# Referenced indirectly.
INFO_DOCS_OTHER = (
# Included by: `info_advanced.rst`.
"info_advanced_blender_as_bpy.rst",
)
# only support for properties atm.
RNA_BLACKLIST = {
@@ -1470,7 +1477,7 @@ def pyrna2sphinx(basepath):
struct_module_name = struct.module_name
if USE_ONLY_BUILTIN_RNA_TYPES:
assert(struct_module_name == "bpy.types")
assert (struct_module_name == "bpy.types")
filepath = os.path.join(basepath, "%s.%s.rst" % (struct_module_name, struct.identifier))
file = open(filepath, "w", encoding="utf-8")
fw = file.write
@@ -2314,6 +2321,8 @@ def copy_handwritten_rsts(basepath):
if not EXCLUDE_INFO_DOCS:
for info, _info_desc in INFO_DOCS:
shutil.copy2(os.path.join(RST_DIR, info), basepath)
for info in INFO_DOCS_OTHER:
shutil.copy2(os.path.join(RST_DIR, info), basepath)
# TODO: put this docs in Blender's code and use import as per modules above.
handwritten_modules = [