Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/python_api')
-rw-r--r--doc/python_api/requirements.txt4
-rw-r--r--doc/python_api/rst/info_overview.rst8
-rw-r--r--doc/python_api/sphinx_doc_gen.py16
3 files changed, 19 insertions, 9 deletions
diff --git a/doc/python_api/requirements.txt b/doc/python_api/requirements.txt
index c2b5b2fd794..263b12eb604 100644
--- a/doc/python_api/requirements.txt
+++ b/doc/python_api/requirements.txt
@@ -1,2 +1,2 @@
-Sphinx==1.8.5
-sphinx_rtd_theme==0.4.3
+Sphinx==3.0.3
+sphinx_rtd_theme==0.5.0rc1
diff --git a/doc/python_api/rst/info_overview.rst b/doc/python_api/rst/info_overview.rst
index e341453fe93..562076c6c43 100644
--- a/doc/python_api/rst/info_overview.rst
+++ b/doc/python_api/rst/info_overview.rst
@@ -253,7 +253,13 @@ Registering a class with Blender results in the class definition being loaded in
where it becomes available alongside existing functionality.
Once this class is loaded you can access it from :mod:`bpy.types`,
-using the bl_idname rather than the classes original name.
+using the ``bl_idname`` rather than the classes original name.
+
+.. note::
+
+ There are some exceptions to this for class names which aren't guarantee to be unique.
+ In this case use: :func:`bpy.types.Struct.bl_rna_get_subclass`.
+
When loading a class, Blender performs sanity checks making sure all required properties and functions are found,
that properties have the correct type, and that functions have the right number of arguments.
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 676fa26a17a..9e81760a794 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -481,6 +481,11 @@ if _BPY_PROP_COLLECTION_FAKE:
else:
_BPY_PROP_COLLECTION_ID = "collection"
+if _BPY_STRUCT_FAKE:
+ bpy_struct = bpy.types.bpy_struct
+else:
+ bpy_struct = None
+
def escape_rst(text):
""" Escape plain text which may contain characters used by RST.
@@ -1432,7 +1437,7 @@ def pyrna2sphinx(basepath):
if _BPY_STRUCT_FAKE:
descr_items = [
- (key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items())
+ (key, descr) for key, descr in sorted(bpy_struct.__dict__.items())
if not key.startswith("__")
]
@@ -1448,9 +1453,6 @@ def pyrna2sphinx(basepath):
for identifier, py_prop in base.get_py_properties():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
- for identifier, py_prop in base.get_py_properties():
- lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
-
if lines:
fw(".. rubric:: Inherited Properties\n\n")
@@ -1474,6 +1476,8 @@ def pyrna2sphinx(basepath):
lines.append(" * :class:`%s.%s`\n" % (base.identifier, func.identifier))
for identifier, py_func in base.get_py_functions():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
+ for identifier, py_func in base.get_py_c_functions():
+ lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
if lines:
fw(".. rubric:: Inherited Functions\n\n")
@@ -1561,7 +1565,7 @@ def pyrna2sphinx(basepath):
# write fake classes
if _BPY_STRUCT_FAKE:
- class_value = bpy.types.Struct.__bases__[0]
+ class_value = bpy_struct
fake_bpy_type(
"bpy.types", class_value, _BPY_STRUCT_FAKE,
"built-in base class for all classes in bpy.types.", use_subclasses=True,
@@ -1701,7 +1705,7 @@ class PatchedPythonDomain(PythonDomain):
fw("def setup(app):\n")
fw(" app.add_stylesheet('css/theme_overrides.css')\n")
- fw(" app.override_domain(PatchedPythonDomain)\n\n")
+ fw(" app.add_domain(PatchedPythonDomain, override=True)\n\n")
file.close()