Commit: aa6adab1fc9a39b96c9221fa20517b89c2650a65
Author: Julian Eisel
Date:   Sat Aug 6 02:44:29 2016 +0200
Branches: temp_localview_split
https://developer.blender.org/rBaa6adab1fc9a39b96c9221fa20517b89c2650a65

Add security check for View3D.lay behavior

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

M       source/blender/editors/space_view3d/view3d_view.c
M       source/blender/makesdna/DNA_screen_types.h
M       source/blender/makesdna/DNA_view3d_types.h

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

diff --git a/source/blender/editors/space_view3d/view3d_view.c 
b/source/blender/editors/space_view3d/view3d_view.c
index da1d13f..dd99fe4 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1262,6 +1262,9 @@ static void 
view3d_localview_area_data_init(LocalViewAreaData *localviewd, View3
        localviewd->far = v3d->far;
        localviewd->drawtype = v3d->drawtype;
        localviewd->camera = v3d->camera;
+#ifndef NDEBUG
+       localviewd->v3d_lay = v3d->lay;
+#endif
 }
 
 static void view3d_localview_region_data_init(LocalViewRegionData *localviewd, 
RegionView3D *rv3d)
@@ -1444,6 +1447,7 @@ static bool view3d_localview_exit(
        LocalViewInfo localview = v3d->localviewd->info; /* store for use after 
v3d local view data is reset */
 
        BLI_assert(sa->spacetype == SPACE_VIEW3D && v3d->localviewd);
+       BLI_assert(v3d->localviewd->v3d_lay == v3d->lay);
 
        view3d_localviewdata_restore(wm, win, bmain, scene, sa, smooth_viewtx);
 
@@ -1458,7 +1462,6 @@ static bool view3d_localview_exit(
                /* local view used to work with object/base bitfields, check 
updates didn't break anything */
                BLI_assert(base->lay > 0 && base->lay == base->object->lay);
        }
-       BLI_assert(!v3d->scenelock || v3d->lay == scene->lay);
 
        DAG_on_visible_update(bmain, false);
 
diff --git a/source/blender/makesdna/DNA_screen_types.h 
b/source/blender/makesdna/DNA_screen_types.h
index 28458ea..3d85603 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -220,6 +220,8 @@ typedef struct LocalViewAreaData {
        float near, far;
        short drawtype, pad;
        struct Object *camera;
+       /* Debug only: View3D.lay shouldn't change while in local view, store 
initial one for BLI_assert check */
+       unsigned int v3d_lay, pad2;
 } LocalViewAreaData;
 
 /**
diff --git a/source/blender/makesdna/DNA_view3d_types.h 
b/source/blender/makesdna/DNA_view3d_types.h
index ef21abd..0a6a7f7 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -181,10 +181,11 @@ typedef struct View3D {
        struct LocalViewAreaData *localviewd;
 
        char ob_centre_bone[64];                /* optional string for armature 
bone to define center, MAXBONENAME */
-       
+
+       /* Object layers - Shouldn't change while in local view (there's an 
assert in view3d_localview_exit) */
        unsigned int lay;
        int layact;
-       
+
        /**
         * The drawing mode for the 3d display. Set to OB_BOUNDBOX, OB_WIRE, 
OB_SOLID,
         * OB_TEXTURE, OB_MATERIAL or OB_RENDER */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to