diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 17:29:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 18:17:03 +0300 |
commit | 3b5eac548fe13e2a93ae6a8dedd4c632edf950a0 (patch) | |
tree | c28c557c2d39c0b87a34df786df036ddae661287 | |
parent | 44f09c93d1e2b627c30186a446eee8d39f45ccbc (diff) |
Fix depth-eyedropper crashing outside 3d view
Also set the eyedropper operators as internal.
-rw-r--r-- | source/blender/editors/interface/interface_eyedropper.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index f5b24f49f98..aabb8e29fa9 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -370,10 +370,11 @@ void UI_OT_eyedropper_color(wmOperatorType *ot) ot->poll = eyedropper_poll; /* flags */ - ot->flag = OPTYPE_BLOCKING; + ot->flag = OPTYPE_BLOCKING | OPTYPE_INTERNAL; /* properties */ } + /** \} */ @@ -641,13 +642,14 @@ void UI_OT_eyedropper_id(wmOperatorType *ot) ot->poll = datadropper_poll; /* flags */ - ot->flag = OPTYPE_BLOCKING; + ot->flag = OPTYPE_BLOCKING | OPTYPE_INTERNAL; /* properties */ } /** \} */ + /* -------------------------------------------------------------------- */ /* Depth Dropper * @@ -696,7 +698,7 @@ static int depthdropper_init(bContext *C, wmOperator *op) /* fallback to the active camera's dof */ if (ddr->prop == NULL) { RegionView3D *rv3d = CTX_wm_region_view3d(C); - if (rv3d->persp == RV3D_CAMOB) { + if (rv3d && rv3d->persp == RV3D_CAMOB) { View3D *v3d = CTX_wm_view3d(C); if (v3d->camera && v3d->camera->data && (((ID *)v3d->camera->data)->lib == NULL)) { RNA_id_pointer_create(v3d->camera->data, &ddr->ptr); @@ -946,7 +948,7 @@ void UI_OT_eyedropper_depth(wmOperatorType *ot) ot->poll = depthdropper_poll; /* flags */ - ot->flag = OPTYPE_BLOCKING; + ot->flag = OPTYPE_BLOCKING | OPTYPE_INTERNAL; /* properties */ } |