Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-31 21:31:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-31 21:31:34 +0400
commit72a3fb15d71ad4b1a93b2d1cd96cd12cfac20a6d (patch)
tree51242a2c77a4f7f669dfe990ae1af8d7c9be1a29
parente597234cb52a0530f60f2e135536572416caf490 (diff)
changes to mask editing
- use Alt to modify all mask feather at once while dragging. - copying a multi-user mask from the interface works now. - show masks when UV editing isnt used, rather then checking editmode (would give some odd/annoying image space header). - add a fake mask user by default. - moving points with LMB drag no longer selects them.
-rw-r--r--source/blender/blenkernel/intern/library.c1
-rw-r--r--source/blender/blenkernel/intern/mask.c2
-rw-r--r--source/blender/editors/mask/mask_ops.c14
-rw-r--r--source/blender/editors/space_image/image_edit.c6
-rw-r--r--source/blender/editors/space_image/space_image.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
6 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 98133b936d5..e073cfdf76d 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -362,6 +362,7 @@ int id_copy(ID *id, ID **newid, int test)
return 0; /* not implemented */
case ID_MSK:
if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id);
+ return 1;
}
return 0;
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index bb6e4d82bd2..b3f146586a8 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1339,6 +1339,8 @@ static Mask *mask_alloc(const char *name)
mask = BKE_libblock_alloc(&G.main->mask, ID_MSK, name);
+ mask->id.flag |= LIB_FAKEUSER;
+
return mask;
}
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 7ee9eec34b5..1df1e5a66fe 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -526,6 +526,7 @@ static int slide_point_invoke(bContext *C, wmOperator *op, wmEvent *event)
WM_event_add_modal_handler(C, op);
+#if 0
if (slidedata->uw) {
if ((slidedata->uw->flag & SELECT) == 0) {
ED_mask_select_toggle_all(mask, SEL_DESELECT);
@@ -542,6 +543,7 @@ static int slide_point_invoke(bContext *C, wmOperator *op, wmEvent *event)
ED_mask_select_flush_all(mask);
}
+#endif
slidedata->masklay->act_spline = slidedata->spline;
slidedata->masklay->act_point = slidedata->point;
@@ -629,19 +631,19 @@ static int slide_point_modal(bContext *C, wmOperator *op, wmEvent *event)
float co[2], dco[2];
switch (event->type) {
- case LEFTCTRLKEY:
- case RIGHTCTRLKEY:
+ case LEFTALTKEY:
+ case RIGHTALTKEY:
case LEFTSHIFTKEY:
case RIGHTSHIFTKEY:
- if (ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY)) {
+ if (ELEM(event->type, LEFTALTKEY, RIGHTALTKEY)) {
if (data->action == SLIDE_ACTION_FEATHER)
- data->overall_feather = event->val == KM_PRESS;
+ data->overall_feather = (event->val == KM_PRESS);
else
- data->curvature_only = event->val == KM_PRESS;
+ data->curvature_only = (event->val == KM_PRESS);
}
if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
- data->accurate = event->val == KM_PRESS;
+ data->accurate = (event->val == KM_PRESS);
/* no break! update CV position */
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 899685d0dc2..c0b6dc656c2 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -95,6 +95,10 @@ void ED_space_image_set_mask(bContext *C, SpaceImage *sima, Mask *mask)
{
sima->mask_info.mask = mask;
+ /* weak, but same as image/space */
+ if (sima->mask_info.mask && sima->mask_info.mask->id.us == 0)
+ sima->mask_info.mask->id.us = 1;
+
if (C) {
WM_event_add_notifier(C, NC_MASK | NA_SELECTED, mask);
}
@@ -356,7 +360,7 @@ int ED_space_image_check_show_maskedit(Scene *scene, SpaceImage *sima)
{
/* check editmode - this is reserved for UV editing */
Object *ob = OBACT;
- if (ob && ob->mode & OB_MODE_EDIT) {
+ if (ob && ob->mode & OB_MODE_EDIT && ED_space_image_show_uvedit(sima, ob)) {
return FALSE;
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 1ef319c45e2..79cc1eba898 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -613,7 +613,7 @@ static void image_main_area_draw(const bContext *C, ARegion *ar)
draw_uvedit_main(sima, ar, scene, obedit, obact);
/* check for mask (delay draw) */
- if (obedit) {
+ if (ED_space_image_show_uvedit(sima, obedit)) {
/* pass */
}
else if (sima->mode == SI_MODE_MASK) {
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 74f6b16a111..6fd26e0f8c5 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -123,7 +123,7 @@ EnumPropertyItem clip_editor_mode_items[] = {
{SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction",
"Show tracking/reconstruction tools"},
{SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
- {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask editing", "Show mask editing tools"},
+ {SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
{0, NULL, 0, NULL, NULL}
};