[Bf-blender-cvs] [9ca1052226d] master: Fix Python API docs build error

Hans Goudey noreply at git.blender.org
Thu Jan 20 22:10:37 CET 2022


Commit: 9ca1052226d3eeb9546e6ea90f5ae3f8062e23ba
Author: Hans Goudey
Date:   Thu Jan 20 15:10:28 2022 -0600
Branches: master
https://developer.blender.org/rB9ca1052226d3eeb9546e6ea90f5ae3f8062e23ba

Fix Python API docs build error

There is probably a better solution that's possible, but the few other
things I tried didn't work, and the build error should be resolved for
the buildbots. This is similar to the "breaks" in the namespace for
functions declared in `ED_node.h`.

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

M	source/blender/editors/space_node/node_intern.hh
M	source/blender/editors/space_node/space_node.cc

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

diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh
index 9bd5c0ba00b..c161fc70402 100644
--- a/source/blender/editors/space_node/node_intern.hh
+++ b/source/blender/editors/space_node/node_intern.hh
@@ -45,6 +45,9 @@ struct wmGizmoGroupType;
 struct wmKeyConfig;
 struct wmWindow;
 
+/* Outside of blender namespace to avoid Python documentation build error with `ctypes`. */
+extern const char *node_context_dir[];
+
 namespace blender::ed::space_node {
 
 /** Temporary data used in node link drag modal operator. */
@@ -325,8 +328,6 @@ void node_geometry_add_attribute_search_button(const bContext &C,
                                                PointerRNA &socket_ptr,
                                                uiLayout &layout);
 
-extern const char *node_context_dir[];
-
 /* Nodes draw without dpi - the view zoom is flexible. */
 #define HIDDEN_RAD (0.75f * U.widget_unit)
 #define BASIS_RAD (0.2f * U.widget_unit)
diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc
index 40a7e3e616e..f794a8ce294 100644
--- a/source/blender/editors/space_node/space_node.cc
+++ b/source/blender/editors/space_node/space_node.cc
@@ -816,8 +816,14 @@ static void node_region_listener(const wmRegionListenerParams *params)
   }
 }
 
+}  // namespace blender::ed::space_node
+
+/* Outside of blender namespace to avoid Python documentation build error with `ctypes`. */
 const char *node_context_dir[] = {
     "selected_nodes", "active_node", "light", "material", "world", nullptr};
+
+namespace blender::ed::space_node {
+
 static int /*eContextResult*/ node_context(const bContext *C,
                                            const char *member,
                                            bContextDataResult *result)



More information about the Bf-blender-cvs mailing list