[Bf-blender-cvs] [44db4e50b24] master: PyAPI: remove context.active_base

Campbell Barton noreply at git.blender.org
Wed May 12 14:06:52 CEST 2021


Commit: 44db4e50b245041ea250bef4e525e658e83403cb
Author: Campbell Barton
Date:   Wed May 12 22:01:55 2021 +1000
Branches: master
https://developer.blender.org/rB44db4e50b245041ea250bef4e525e658e83403cb

PyAPI: remove context.active_base

All other access to the Base structure from Python was removed,
it seems this was left in by accident.

Ref T85675

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

M	doc/python_api/sphinx_doc_gen.py
M	source/blender/editors/space_view3d/space_view3d.c

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

diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 8be194a58a2..94c69be5530 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1029,7 +1029,6 @@ def pymodule2sphinx(basepath, module_name, module, title, module_all_extra):
 context_type_map = {
     # context_member: (RNA type, is_collection)
     "active_annotation_layer": ("GPencilLayer", False),
-    "active_base": ("ObjectBase", False),
     "active_bone": ("EditBone", False),
     "active_gpencil_frame": ("GreasePencilLayer", True),
     "active_gpencil_layer": ("GPencilLayer", True),
@@ -1549,8 +1548,8 @@ def pyrna2sphinx(basepath):
             fw(".. hlist::\n")
             fw("   :columns: 2\n\n")
 
-            # context does its own thing
-            # "active_base": ("ObjectBase", False),
+            # Context does its own thing.
+            # "active_object": ("Object", False),
             for ref_attr, (ref_type, ref_is_seq) in sorted(context_type_map.items()):
                 if ref_type == struct_id:
                     fw("   * :mod:`bpy.context.%s`\n" % ref_attr)
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index e6916c34a88..b5274c2357e 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1595,7 +1595,6 @@ static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(area))
 }
 
 const char *view3d_context_dir[] = {
-    "active_base",
     "active_object",
     NULL,
 };
@@ -1608,20 +1607,6 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes
   if (CTX_data_dir(member)) {
     CTX_data_dir_set(result, view3d_context_dir);
   }
-  else if (CTX_data_equals(member, "active_base")) {
-    Scene *scene = CTX_data_scene(C);
-    ViewLayer *view_layer = CTX_data_view_layer(C);
-    if (view_layer->basact) {
-      Object *ob = view_layer->basact->object;
-      /* if hidden but in edit mode, we still display, can happen with animation */
-      if ((view_layer->basact->flag & BASE_VISIBLE_DEPSGRAPH) != 0 ||
-          (ob->mode != OB_MODE_OBJECT)) {
-        CTX_data_pointer_set(result, &scene->id, &RNA_ObjectBase, view_layer->basact);
-      }
-    }
-
-    return 1;
-  }
   else if (CTX_data_equals(member, "active_object")) {
     /* In most cases the active object is the `view_layer->basact->object`.
      * For the 3D view however it can be NULL when hidden.



More information about the Bf-blender-cvs mailing list