[Bf-blender-cvs] [f62eb8ac16c] master: BPY-Docs: Add missing file context members documentation

Julian Eisel noreply at git.blender.org
Wed Sep 1 16:28:51 CEST 2021


Commit: f62eb8ac16c1bd7abe0925b8b70fb47b613fbdd8
Author: Julian Eisel
Date:   Wed Sep 1 16:27:29 2021 +0200
Branches: master
https://developer.blender.org/rBf62eb8ac16c1bd7abe0925b8b70fb47b613fbdd8

BPY-Docs: Add missing file context members documentation

Context members of the file space would not be shown in the context API
docs.

===================================================================

M	doc/python_api/sphinx_doc_gen.py
M	source/blender/editors/space_file/file_intern.h
M	source/blender/editors/space_file/space_file.c

===================================================================

diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 99d1828e529..aa0f79646e6 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1039,6 +1039,7 @@ context_type_map = {
     # context_member: (RNA type, is_collection)
     "active_annotation_layer": ("GPencilLayer", False),
     "active_bone": ("EditBone", False),
+    "active_file": ("FileSelectEntry", False),
     "active_gpencil_frame": ("GreasePencilLayer", True),
     "active_gpencil_layer": ("GPencilLayer", True),
     "active_node": ("Node", False),
@@ -1077,6 +1078,7 @@ context_type_map = {
     "gpencil_data": ("GreasePencil", False),
     "gpencil_data_owner": ("ID", False),
     "hair": ("Hair", False),
+    "id": ("ID", False),
     "image_paint_object": ("Object", False),
     "lattice": ("Lattice", False),
     "light": ("Light", False),
@@ -1105,6 +1107,7 @@ context_type_map = {
     "selected_editable_keyframes": ("Keyframe", True),
     "selected_editable_objects": ("Object", True),
     "selected_editable_sequences": ("Sequence", True),
+    "selected_files": ("FileSelectEntry", True),
     "selected_nla_strips": ("NlaStrip", True),
     "selected_nodes": ("Node", True),
     "selected_objects": ("Object", True),
@@ -1201,6 +1204,7 @@ def pycontext2sphinx(basepath):
         "text_context_dir",
         "clip_context_dir",
         "sequencer_context_dir",
+        "file_context_dir",
     )
 
     unique = set()
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index 17749d36418..905c0aeb8e0 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -92,6 +92,9 @@ void file_sfile_to_operator(struct Main *bmain, struct wmOperator *op, struct Sp
 
 void file_operator_to_sfile(struct Main *bmain, struct SpaceFile *sfile, struct wmOperator *op);
 
+/* space_file.c */
+extern const char *file_context_dir[]; /* doc access */
+
 /* filesel.c */
 void fileselect_refresh_params(struct SpaceFile *sfile);
 void fileselect_file_set(SpaceFile *sfile, const int index);
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index daf522273a9..a4f36c2a6ee 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -871,7 +871,7 @@ static void file_space_subtype_item_extend(bContext *UNUSED(C),
   RNA_enum_items_add(item, totitem, rna_enum_space_file_browse_mode_items);
 }
 
-static const char *file_context_dir[] = {
+const char *file_context_dir[] = {
     "active_file",
     "selected_files",
     "asset_library_ref",



More information about the Bf-blender-cvs mailing list