[Bf-blender-cvs] [3ea7a5d8699] master: Revert "Fix T62436: New added Torus won't appear in Local View"

Campbell Barton noreply at git.blender.org
Wed Mar 13 00:52:46 CET 2019


Commit: 3ea7a5d8699c74ddf4ea7b359022145e44f62bc2
Author: Campbell Barton
Date:   Wed Mar 13 09:29:02 2019 +1100
Branches: master
https://developer.blender.org/rB3ea7a5d8699c74ddf4ea7b359022145e44f62bc2

Revert "Fix T62436: New added Torus won't appear in Local View"

This reverts commit 9054b39b27c4198f436329f78af43fe3f3175508.

Using the region data to find the screen & space-data doesn't make sense
since local-view is space-data there is no reason to pass in a region
argument, then lookup the space-data.

There was no way to remove an object or check it's local view state
as there was in 2.7x.

This can be made closer to 2.7x API and simplified.

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

M	release/scripts/modules/bpy_extras/object_utils.py
M	source/blender/makesrna/intern/rna_space_api.c

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

diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index f020431c6bb..5f3d6fbc50f 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -133,11 +133,6 @@ def object_data_add(context, obdata, operator=None, name=None):
     obj_new.select_set(True)
     obj_new.matrix_world = add_object_align_init(context, operator)
 
-    space_data = context.space_data
-    if space_data.type == 'VIEW_3D':
-        if space_data.local_view:
-            space_data.region_3d.local_view_add(obj_new)
-
     if obj_act and obj_act.mode == 'EDIT' and obj_act.type == obj_new.type:
         bpy.ops.mesh.select_all(action='DESELECT')
         obj_act.select_set(True)
diff --git a/source/blender/makesrna/intern/rna_space_api.c b/source/blender/makesrna/intern/rna_space_api.c
index db5467d2802..947eff8c73b 100644
--- a/source/blender/makesrna/intern/rna_space_api.c
+++ b/source/blender/makesrna/intern/rna_space_api.c
@@ -26,8 +26,6 @@
 #ifdef RNA_RUNTIME
 
 #include "BKE_global.h"
-#include "BKE_layer.h"
-#include "BKE_report.h"
 
 #include "ED_screen.h"
 #include "ED_text.h"
@@ -59,54 +57,6 @@ static void rna_RegionView3D_update(ID *id, RegionView3D *rv3d, bContext *C)
 	}
 }
 
-static void rna_RegionView3D_local_view_add(
-        ID *id, RegionView3D *rv3d,
-        bContext *C,
-        ReportList *reports,
-        Object *ob)
-{
-	bScreen *sc = (bScreen *)id;
-
-	ScrArea *sa;
-	ARegion *ar;
-
-	area_region_from_regiondata(sc, rv3d, &sa, &ar);
-
-	if (sa && ar && sa->spacetype == SPACE_VIEW3D) {
-		View3D *v3d = sa->spacedata.first;
-
-		if (v3d->localvd == NULL) {
-			BKE_report(reports, RPT_ERROR, "3D Viewport not in local view");
-			return;
-		}
-
-		wmWindowManager *wm = CTX_wm_manager(C);
-		wmWindow *win;
-
-		for (win = wm->windows.first; win; win = win->next) {
-			if (WM_window_get_active_screen(win) == sc) {
-				Scene *scene = WM_window_get_active_scene(win);
-				ViewLayer *view_layer = WM_window_get_active_view_layer(win);
-
-				Base *base = BKE_view_layer_base_find(view_layer, ob);
-				if (base) {
-					base->local_view_bits |= v3d->local_view_uuid;
-					ED_area_tag_redraw(sa);
-					DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
-				}
-				else {
-					BKE_reportf(reports,
-					            RPT_WARNING,
-					            "Object %s not in view layer %s",
-					            ob->id.name + 2,
-					            view_layer->name);
-				}
-				break;
-			}
-		}
-	}
-}
-
 static void rna_SpaceTextEditor_region_location_from_cursor(
         ID *id, SpaceText *st,
         int line, int column, int r_pixel_pos[2])
@@ -125,17 +75,10 @@ static void rna_SpaceTextEditor_region_location_from_cursor(
 void RNA_api_region_view3d(StructRNA *srna)
 {
 	FunctionRNA *func;
-	PropertyRNA *parm;
 
 	func = RNA_def_function(srna, "update", "rna_RegionView3D_update");
 	RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_CONTEXT);
 	RNA_def_function_ui_description(func, "Recalculate the view matrices");
-
-	func = RNA_def_function(srna, "local_view_add", "rna_RegionView3D_local_view_add");
-	RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
-	parm = RNA_def_pointer(func, "object", "Object", "Object", "Object to add to current local view");
-	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-	RNA_def_function_ui_description(func, "Add object to viewport's local view");
 }
 
 void RNA_api_space_node(StructRNA *srna)



More information about the Bf-blender-cvs mailing list