bugfix [#24812] Cannot change top/left/front views in quad view after camera change
authorCampbell Barton <ideasman42@gmail.com>
Fri, 19 Nov 2010 17:16:25 +0000 (17:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 19 Nov 2010 17:16:25 +0000 (17:16 +0000)
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_view.c

index 3bfe4fa604a1809807da56068530163f4fcadc06..594537073615064eaf0432a9a0631a4d6d78ade7 100644 (file)
@@ -2030,6 +2030,14 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
 
        return OPERATOR_FINISHED;
 }
+
+int region3d_unlocked_poll(bContext *C)
+{
+       RegionView3D *rv3d= CTX_wm_region_view3d(C);
+       return (rv3d && rv3d->viewlock==0);
+}
+
+
 void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
 {
        /* identifiers */
@@ -2039,7 +2047,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
 
        /* api callbacks */
        ot->exec= viewnumpad_exec;
-       ot->poll= ED_operator_region_view3d_active;
+       ot->poll= region3d_unlocked_poll;
 
        /* flags */
        ot->flag= 0;
index 92167f0f45eea4f724b390bdd17b0072607c98ba..b77c68b27352f4a2a0b5bbcae1ebec74a86377e5 100644 (file)
@@ -91,6 +91,7 @@ void VIEW3D_OT_drawtype(struct wmOperatorType *ot);
 
 void view3d_boxview_copy(ScrArea *sa, ARegion *ar);
 void view3d_persp_mat4(struct RegionView3D *rv3d, float mat[][4]);
+int region3d_unlocked_poll(struct bContext *C);
 
 /* view3d_fly.c */
 void view3d_keymap(struct wmKeyConfig *keyconf);
index d0d4c9ee5c8f451d00e3e88e286a3c7a3b70bba6..123c15bdb5b7abd2dfc4873720f21413821d5dfa 100644 (file)
@@ -479,7 +479,7 @@ void VIEW3D_OT_object_as_camera(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= view3d_setobjectascamera_exec;        
-       ot->poll= ED_operator_region_view3d_active;
+       ot->poll= region3d_unlocked_poll;
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;