diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-27 00:23:26 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-27 00:23:26 +0400 |
commit | 03dbae07d346dcfb5cdaeeeea3585f642cd90d31 (patch) | |
tree | 866db44539cf778c636cd774f524970d434c77d3 /source/blender/editors/uvedit/uvedit_ops.c | |
parent | 11aa7a76fab53809f891ab8ff7898a2dd70005b8 (diff) |
Mask primitives
Currently only circle and square, might be easily
extended in the future.
New primitives are creating at cursor location.
This also implied adding 2d cursor to space clip.
Also fix set 2D cursor location which didn't work
in image editor's mask mode since 2.67.
TODO: draw_image_cursor better be moved to some
more generic file, but it's not so much
important for now and might be solved later.
Thanks Campbell for the review!
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 0b514e3f6fd..8c299cccbc2 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3823,6 +3823,12 @@ static void UV_OT_reveal(wmOperatorType *ot) /******************** set 3d cursor operator ********************/ +static int uv_set_2d_cursor_poll(bContext *C) +{ + return ED_operator_uvedit_space_image(C) || + ED_space_image_maskedit_poll(C); +} + static int uv_set_2d_cursor_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); @@ -3858,7 +3864,7 @@ static void UV_OT_cursor_set(wmOperatorType *ot) /* api callbacks */ ot->exec = uv_set_2d_cursor_exec; ot->invoke = uv_set_2d_cursor_invoke; - ot->poll = ED_operator_uvedit_space_image; + ot->poll = uv_set_2d_cursor_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |