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:
authorPhilipp Oeser <info@graphics-engineer.com>2018-12-29 20:26:04 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-01-04 17:51:46 +0300
commit2891043b585b4773b07c607b20befae35979dbb7 (patch)
tree8ee264376dc48f18bce36e97dcaf7dba1122c04c /source/blender/editors/mask
parent4053ed022b078e48858472b9e1b0e12fdb360865 (diff)
Outliner: better support for clips/masks ('Blender File' view)
- clips/masks were not showing an icon [both dont have a dedicated icon, took the ones used elsewhere] - masks hit an assert in outliner_add_element() - missing outliner update when adding a mask spotted while looking into T59939 Reviewers: mont29, brecht Differential Revision: https://developer.blender.org/D4142
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_add.c6
-rw-r--r--source/blender/editors/mask/mask_intern.h2
-rw-r--r--source/blender/editors/mask/mask_ops.c5
3 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index df07326c590..0cc608a56f1 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -765,7 +765,8 @@ static int create_primitive_from_points(bContext *C, wmOperator *op, const float
location[0] -= 0.5f * scale;
location[1] -= 0.5f * scale;
- mask_layer = ED_mask_layer_ensure(C);
+ bool added_mask = false;
+ mask_layer = ED_mask_layer_ensure(C, &added_mask);
mask = CTX_data_edit_mask(C);
ED_mask_select_toggle_all(mask, SEL_DESELECT);
@@ -801,6 +802,9 @@ static int create_primitive_from_points(bContext *C, wmOperator *op, const float
}
}
+ if (added_mask) {
+ WM_event_add_notifier(C, NC_MASK | NA_ADDED, NULL);
+ }
WM_event_add_notifier(C, NC_MASK | NA_EDITED, mask);
/* TODO: only update this spline */
diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h
index cb2bb953994..60acb430b20 100644
--- a/source/blender/editors/mask/mask_intern.h
+++ b/source/blender/editors/mask/mask_intern.h
@@ -59,7 +59,7 @@ void MASK_OT_primitive_square_add(struct wmOperatorType *ot);
/* mask_ops.c */
struct Mask *ED_mask_new(struct bContext *C, const char *name);
-struct MaskLayer *ED_mask_layer_ensure(struct bContext *C);
+struct MaskLayer *ED_mask_layer_ensure(struct bContext *C, bool *r_added_mask);
void MASK_OT_new(struct wmOperatorType *ot);
void MASK_OT_layer_new(struct wmOperatorType *ot);
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index cb90d0a4888..20fc403762d 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -340,7 +340,7 @@ Mask *ED_mask_new(bContext *C, const char *name)
}
/* Get ative layer. Will create mask/layer to be sure there's an active layer. */
-MaskLayer *ED_mask_layer_ensure(bContext *C)
+MaskLayer *ED_mask_layer_ensure(bContext *C, bool *r_added_mask)
{
Mask *mask = CTX_data_edit_mask(C);
MaskLayer *mask_layer;
@@ -348,6 +348,7 @@ MaskLayer *ED_mask_layer_ensure(bContext *C)
if (mask == NULL) {
/* If there's no active mask, create one. */
mask = ED_mask_new(C, NULL);
+ *r_added_mask = true;
}
mask_layer = BKE_mask_layer_active(mask);
@@ -367,6 +368,8 @@ static int mask_new_exec(bContext *C, wmOperator *op)
ED_mask_new(C, name);
+ WM_event_add_notifier(C, NC_MASK | NA_ADDED, NULL);
+
return OPERATOR_FINISHED;
}