diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-18 16:29:22 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-18 16:29:22 +0400 |
commit | b3c605e13923b372b2ff18b5970818e2aaae470a (patch) | |
tree | 29e3128462f5fc5e4309bb9710821e840a0c52d4 /source/blender/editors/mask/mask_add.c | |
parent | dd56cc0cddc0372d0db0678c38e56364cd26a54c (diff) |
Mask editor: create new mask when trying to create new vertex without active mask set
Diffstat (limited to 'source/blender/editors/mask/mask_add.c')
-rw-r--r-- | source/blender/editors/mask/mask_add.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index c929436bc82..e43c8a2b53b 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -46,6 +46,7 @@ #include "WM_types.h" #include "ED_mask.h" /* own include */ +#include "ED_screen.h" #include "RNA_access.h" #include "RNA_define.h" @@ -562,6 +563,11 @@ static int add_vertex_exec(bContext *C, wmOperator *op) float co[2]; + if (mask == NULL) { + /* if there's no active mask, create one */ + mask = ED_mask_new(C, NULL); + } + masklay = BKE_mask_layer_active(mask); if (masklay && masklay->restrictflag & (MASK_RESTRICT_VIEW | MASK_RESTRICT_SELECT)) { @@ -647,7 +653,7 @@ void MASK_OT_add_vertex(wmOperatorType *ot) /* api callbacks */ ot->exec = add_vertex_exec; ot->invoke = add_vertex_invoke; - ot->poll = ED_maskedit_mask_poll; + ot->poll = ED_operator_mask; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |