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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-30 10:07:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-30 10:07:26 +0400
commit03136f06807bff9c08ac7dc6584fb5cdb7bffa51 (patch)
tree5f08f7f3368ce7856f796774cad4b6b845ef6b5d /source
parent766307e3119fb805c7050a7c1d363ec26e564a21 (diff)
mask object hide/reveal - access from H/Alt+H/Shift+H and eye icon in listview.
added alpha setting though its not used for rendering yet.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/mask.c12
-rw-r--r--source/blender/editors/interface/interface_templates.c12
-rw-r--r--source/blender/editors/mask/mask_draw.c6
-rw-r--r--source/blender/editors/mask/mask_editor.c12
-rw-r--r--source/blender/editors/mask/mask_intern.h5
-rw-r--r--source/blender/editors/mask/mask_ops.c135
-rw-r--r--source/blender/editors/mask/mask_relationships.c8
-rw-r--r--source/blender/editors/mask/mask_select.c58
-rwxr-xr-xsource/blender/editors/mask/mask_shapekey.c8
-rw-r--r--source/blender/editors/space_clip/space_clip.c1
-rw-r--r--source/blender/makesdna/DNA_mask_types.h13
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_mask.c26
13 files changed, 271 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index be7fa2fbd74..1e2d65c4dd7 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -94,9 +94,12 @@ MaskObject *BKE_mask_object_new(Mask *mask, const char *name)
mask->tot_maskobj++;
+ maskobj->alpha = 1.0f;
+
return maskobj;
}
+/* note: may still be hidden, caller needs to check */
MaskObject *BKE_mask_object_active(Mask *mask)
{
return BLI_findlink(&mask->maskobjs, mask->act_maskobj);
@@ -104,12 +107,7 @@ MaskObject *BKE_mask_object_active(Mask *mask)
void BKE_mask_object_active_set(Mask *mask, MaskObject *maskobj)
{
- int index = BLI_findindex(&mask->maskobjs, maskobj);
-
- if (index >= 0)
- mask->act_maskobj = index;
- else
- mask->act_maskobj = 0;
+ mask->act_maskobj = BLI_findindex(&mask->maskobjs, maskobj);
}
void BKE_mask_object_remove(Mask *mask, MaskObject *maskobj)
@@ -1171,7 +1169,7 @@ void BKE_mask_spline_ensure_deform(MaskSpline *spline)
spline->points_deform = MEM_mallocN(sizeof(*spline->points_deform) * spline->tot_point, __func__);
}
else {
- printf("alloc spline done\n");
+ // printf("alloc spline done\n");
}
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 78835192574..54b87fd4509 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2241,6 +2241,18 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiItemL(split, name, ICON_OBJECT_DATA);
}
}
+ else if (itemptr->type == &RNA_MaskObject) {
+ split = uiLayoutSplit(sub, 0.5f, 0);
+
+ uiItemL(split, name, icon);
+
+ uiBlockSetEmboss(block, UI_EMBOSSN);
+ row = uiLayoutRow(split, 1);
+ uiItemR(row, itemptr, "alpha", 0, "", ICON_NONE);
+ uiItemR(row, itemptr, "hide", 0, "", 0);
+
+ uiBlockSetEmboss(block, UI_EMBOSS);
+ }
/* There is a last chance to display custom controls (in addition to the name/label):
* If the given item property group features a string property named as prop_list,
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index fe11ded64f4..ae64294fd3e 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -267,9 +267,11 @@ static void draw_maskobjs(Mask *mask)
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskSpline *spline;
- for (spline = maskobj->splines.first; spline; spline = spline->next) {
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
-// BKE_mask_spline_ensure_deform(spline);
+ for (spline = maskobj->splines.first; spline; spline = spline->next) {
/* draw curve itself first... */
draw_spline_curve(maskobj, spline);
diff --git a/source/blender/editors/mask/mask_editor.c b/source/blender/editors/mask/mask_editor.c
index 990f668af8d..5968c80b270 100644
--- a/source/blender/editors/mask/mask_editor.c
+++ b/source/blender/editors/mask/mask_editor.c
@@ -203,6 +203,10 @@ void ED_operatortypes_mask(void)
WM_operatortype_append(MASK_OT_select_border);
WM_operatortype_append(MASK_OT_select_lasso);
+ /* hide/reveal */
+ WM_operatortype_append(MASK_OT_hide_view_clear);
+ WM_operatortype_append(MASK_OT_hide_view_set);
+
/* shape */
WM_operatortype_append(MASK_OT_slide_point);
WM_operatortype_append(MASK_OT_cyclic_toggle);
@@ -255,6 +259,14 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "MASK_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_SHIFT | KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "deselect", TRUE);
+ /* hide/reveal */
+ WM_keymap_add_item(keymap, "MASK_OT_hide_view_clear", HKEY, KM_PRESS, KM_ALT, 0);
+ kmi = WM_keymap_add_item(keymap, "MASK_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+
+ kmi = WM_keymap_add_item(keymap, "MASK_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+
/* select clip while in maker view,
* this matches View3D functionality where you can select an
* object while in editmode to allow vertex parenting */
diff --git a/source/blender/editors/mask/mask_intern.h b/source/blender/editors/mask/mask_intern.h
index 28560e4e292..b17d7e7173a 100644
--- a/source/blender/editors/mask/mask_intern.h
+++ b/source/blender/editors/mask/mask_intern.h
@@ -51,6 +51,9 @@ void MASK_OT_slide_point(struct wmOperatorType *ot);
void MASK_OT_delete(struct wmOperatorType *ot);
+void MASK_OT_hide_view_clear(struct wmOperatorType *ot);
+void MASK_OT_hide_view_set(struct wmOperatorType *ot);
+
void MASK_OT_handle_type_set(struct wmOperatorType *ot);
int ED_mask_feather_find_nearest(
@@ -76,8 +79,10 @@ void MASK_OT_select_lasso(struct wmOperatorType *ot);
void MASK_OT_select_circle(struct wmOperatorType *ot);
int ED_mask_spline_select_check(struct MaskSplinePoint *points, int tot_point);
+int ED_mask_object_select_check(struct MaskObject *maskobj);
int ED_mask_select_check(struct Mask *mask);
+void ED_mask_object_select_set(struct MaskObject *maskobj, int select);
void ED_mask_select_toggle_all(struct Mask *mask, int action);
void ED_mask_select_flush_all(struct Mask *mask);
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 44932cab4df..5e547d9dec4 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -143,6 +143,10 @@ MaskSplinePoint *ED_mask_point_find_nearest(bContext *C, Mask *mask, float norma
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskSpline *spline;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -241,6 +245,10 @@ int ED_mask_feather_find_nearest(bContext *C, Mask *mask, float normal_co[2], in
int i, tot_feather_point;
float *feather_points, *fp;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
feather_points = fp = BKE_mask_spline_feather_points(spline, &tot_feather_point);
for (i = 0; i < spline->tot_point; i++) {
@@ -328,6 +336,10 @@ static int find_nearest_diff_point(bContext *C, Mask *mask, const float normal_c
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskSpline *spline;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
int i;
@@ -1204,6 +1216,10 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
maskobj = BKE_mask_object_active(mask);
+ if (maskobj && maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ maskobj = NULL;
+ }
+
RNA_float_get_array(op->ptr, "location", co);
if (maskobj && maskobj->act_point && MASKPOINT_ISSEL(maskobj->act_point)) {
@@ -1360,6 +1376,10 @@ static int cyclic_toggle_exec(bContext *C, wmOperator *UNUSED(op))
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskSpline *spline;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
if (ED_mask_spline_select_check(spline->points, spline->tot_point)) {
spline->flag ^= MASK_SPLINE_CYCLIC;
@@ -1432,7 +1452,13 @@ static int delete_exec(bContext *C, wmOperator *UNUSED(op))
int mask_object_shape_ofs = 0;
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
- MaskSpline *spline = maskobj->splines.first;
+ MaskSpline *spline;
+
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
+ spline = maskobj->splines.first;
while (spline) {
const int tot_point_orig = spline->tot_point;
@@ -1537,6 +1563,10 @@ static int set_handle_type_exec(bContext *C, wmOperator *op)
MaskSpline *spline;
int i;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
@@ -1581,3 +1611,106 @@ void MASK_OT_handle_type_set(wmOperatorType *ot)
/* properties */
ot->prop = RNA_def_enum(ot->srna, "type", editcurve_handle_type_items, 1, "Type", "Spline type");
}
+
+
+/* ********* clear/set restrict view *********/
+static int mask_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ Mask *mask = CTX_data_edit_mask(C);
+ MaskObject *maskobj;
+ int changed = FALSE;
+
+ for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
+
+ if (maskobj->restrictflag & OB_RESTRICT_VIEW) {
+ ED_mask_object_select_set(maskobj, TRUE);
+ maskobj->restrictflag &= ~OB_RESTRICT_VIEW;
+ changed = 1;
+ }
+ }
+
+ if (changed) {
+ WM_event_add_notifier(C, NC_MASK | ND_DRAW, mask);
+ DAG_id_tag_update(&mask->id, 0);
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+}
+
+void MASK_OT_hide_view_clear(wmOperatorType *ot)
+{
+
+ /* identifiers */
+ ot->name = "Clear Restrict View";
+ ot->description = "Reveal the object by setting the hide flag";
+ ot->idname = "MASK_OT_hide_view_clear";
+
+ /* api callbacks */
+ ot->exec = mask_hide_view_clear_exec;
+ ot->poll = ED_maskediting_mask_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+static int mask_hide_view_set_exec(bContext *C, wmOperator *op)
+{
+ Mask *mask = CTX_data_edit_mask(C);
+ MaskObject *maskobj;
+ const int unselected = RNA_boolean_get(op->ptr, "unselected");
+ int changed = FALSE;
+
+ for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
+ if (!unselected) {
+ if (ED_mask_object_select_check(maskobj)) {
+ ED_mask_object_select_set(maskobj, FALSE);
+
+ maskobj->restrictflag |= OB_RESTRICT_VIEW;
+ changed = 1;
+ if (maskobj == BKE_mask_object_active(mask)) {
+ BKE_mask_object_active_set(mask, NULL);
+ }
+ }
+ }
+ else {
+ if (!ED_mask_object_select_check(maskobj)) {
+ maskobj->restrictflag |= OB_RESTRICT_VIEW;
+ changed = 1;
+ if (maskobj == BKE_mask_object_active(mask)) {
+ BKE_mask_object_active_set(mask, NULL);
+ }
+ }
+ }
+ }
+
+ if (changed) {
+ WM_event_add_notifier(C, NC_MASK | ND_DRAW, mask);
+ DAG_id_tag_update(&mask->id, 0);
+
+ return OPERATOR_FINISHED;
+ }
+ else {
+ return OPERATOR_CANCELLED;
+ }
+}
+
+void MASK_OT_hide_view_set(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Set Restrict View";
+ ot->description = "Hide the object by setting the hide flag";
+ ot->idname = "MASK_OT_hide_view_set";
+
+ /* api callbacks */
+ ot->exec = mask_hide_view_set_exec;
+ ot->poll = ED_maskediting_mask_poll;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+
+ RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects");
+
+}
diff --git a/source/blender/editors/mask/mask_relationships.c b/source/blender/editors/mask/mask_relationships.c
index 4d08e2fa439..2d2c527d961 100644
--- a/source/blender/editors/mask/mask_relationships.c
+++ b/source/blender/editors/mask/mask_relationships.c
@@ -66,6 +66,10 @@ static int mask_parent_clear_exec(bContext *C, wmOperator *UNUSED(op))
MaskSpline *spline;
int i;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
@@ -132,6 +136,10 @@ static int mask_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
MaskSpline *spline;
int i;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
for (i = 0; i < spline->tot_point; i++) {
MaskSplinePoint *point = &spline->points[i];
diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c
index 1286565df73..482abbe5818 100644
--- a/source/blender/editors/mask/mask_select.c
+++ b/source/blender/editors/mask/mask_select.c
@@ -71,23 +71,52 @@ int ED_mask_spline_select_check(MaskSplinePoint *points, int tot_point)
return FALSE;
}
+int ED_mask_object_select_check(MaskObject *maskobj)
+{
+ MaskSpline *spline;
+
+ for (spline = maskobj->splines.first; spline; spline = spline->next) {
+ if (ED_mask_spline_select_check(spline->points, spline->tot_point)) {
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
int ED_mask_select_check(Mask *mask)
{
MaskObject *maskobj;
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
- MaskSpline *spline;
-
- for (spline = maskobj->splines.first; spline; spline = spline->next) {
- if (ED_mask_spline_select_check(spline->points, spline->tot_point)) {
- return TRUE;
- }
+ if (ED_mask_object_select_check(maskobj)) {
+ return TRUE;
}
}
return FALSE;
}
+void ED_mask_object_select_set(MaskObject *maskobj, int select)
+{
+ MaskSpline *spline;
+
+ for (spline = maskobj->splines.first; spline; spline = spline->next) {
+ int i;
+
+ if (select)
+ spline->flag |= SELECT;
+ else
+ spline->flag &= ~SELECT;
+
+ for (i = 0; i < spline->tot_point; i++) {
+ MaskSplinePoint *point = &spline->points[i];
+
+ BKE_mask_point_select_set(point, select);
+ }
+ }
+}
+
void ED_mask_select_toggle_all(Mask *mask, int action)
{
MaskObject *maskobj;
@@ -100,17 +129,12 @@ void ED_mask_select_toggle_all(Mask *mask, int action)
}
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
- MaskSpline *spline;
- for (spline = maskobj->splines.first; spline; spline = spline->next) {
- int i;
-
- for (i = 0; i < spline->tot_point; i++) {
- MaskSplinePoint *point = &spline->points[i];
-
- BKE_mask_point_select_set(point, (action == SEL_SELECT) ? TRUE : FALSE);
- }
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
}
+
+ ED_mask_object_select_set(maskobj, (action == SEL_SELECT) ? TRUE : FALSE);
}
}
@@ -121,6 +145,10 @@ void ED_mask_select_flush_all(Mask *mask)
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskSpline *spline;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
for (spline = maskobj->splines.first; spline; spline = spline->next) {
int i;
diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c
index 7a91fbeed13..71b10ae0da3 100755
--- a/source/blender/editors/mask/mask_shapekey.c
+++ b/source/blender/editors/mask/mask_shapekey.c
@@ -67,6 +67,10 @@ static int mask_shape_key_insert_exec(bContext *C, wmOperator *UNUSED(op))
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskObjectShape *maskobj_shape;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
maskobj_shape = BKE_mask_object_shape_varify_frame(maskobj, frame);
BKE_mask_object_shape_from_mask(maskobj, maskobj_shape);
change = TRUE;
@@ -109,6 +113,10 @@ static int mask_shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op))
for (maskobj = mask->maskobjs.first; maskobj; maskobj = maskobj->next) {
MaskObjectShape *maskobj_shape;
+ if (maskobj->restrictflag & MASK_RESTRICT_VIEW) {
+ continue;
+ }
+
maskobj_shape = BKE_mask_object_shape_find_frame(maskobj, frame);
if (maskobj_shape) {
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index c6d35b03468..f952d6bbe47 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -369,6 +369,7 @@ static void clip_listener(ScrArea *sa, wmNotifier *wmn)
switch(wmn->data) {
case ND_SELECT:
case ND_DATA:
+ case ND_DRAW:
ED_area_tag_redraw(sa);
break;
}
diff --git a/source/blender/makesdna/DNA_mask_types.h b/source/blender/makesdna/DNA_mask_types.h
index cf3f5e77544..65707725a53 100644
--- a/source/blender/makesdna/DNA_mask_types.h
+++ b/source/blender/makesdna/DNA_mask_types.h
@@ -44,7 +44,7 @@ typedef struct Mask {
ID id;
struct AnimData *adt;
ListBase maskobjs; /* mask objects */
- int act_maskobj; /* index of active mask object */
+ int act_maskobj; /* index of active mask object (-1 == None) */
int tot_maskobj; /* total number of mask objects */
} Mask;
@@ -107,12 +107,18 @@ typedef struct MaskObject {
struct MaskSpline *act_spline; /* active spline */
struct MaskSplinePoint *act_point; /* active point */
+
+ float alpha;
+ //char flag; /* not used yet */
+ char restrictflag; /* matching 'Object' flag of the same name - eventually use in the outliner */
+ char pad[3];
} MaskObject;
/* MaskParent->flag */
#define MASK_PARENT_ACTIVE (1 << 0)
/* MaskSpline->flag */
+/* reserve (1 << 0) for SELECT */
#define MASK_SPLINE_CYCLIC (1 << 1)
/* MaskSpline->weight_interp */
@@ -121,4 +127,9 @@ typedef struct MaskObject {
#define MASK_OBJECT_SHAPE_ELEM_SIZE 8 /* 3x 2D points + weight + radius == 8 */
+/* ob->restrictflag */
+#define MASK_RESTRICT_VIEW 1
+#define MASK_RESTRICT_SELECT 2
+#define MASK_RESTRICT_RENDER 4
+
#endif // __DNA_MASK_TYPES_H__
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 532f971ad0a..9c465619b95 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -306,6 +306,7 @@ extern StructRNA RNA_MaterialSubsurfaceScattering;
extern StructRNA RNA_MaterialTextureSlot;
extern StructRNA RNA_MaterialVolume;
extern StructRNA RNA_Mask;
+extern StructRNA RNA_MaskObject;
extern StructRNA RNA_Menu;
extern StructRNA RNA_Mesh;
extern StructRNA RNA_MeshColor;
diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c
index 1345011cd7e..393ca5f3244 100644
--- a/source/blender/makesrna/intern/rna_mask.c
+++ b/source/blender/makesrna/intern/rna_mask.c
@@ -533,6 +533,32 @@ static void rna_def_mask_object(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "MaskSpline");
RNA_def_property_ui_text(prop, "Splines", "Collection of splines which defines this object");
RNA_def_property_srna(prop, "MaskSplines");
+
+ /* restrict */
+ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_VIEW);
+ RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1);
+ RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);
+
+ prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_SELECT);
+ RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1);
+ RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);
+
+ prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_RENDER);
+ RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability");
+ RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1);
+ RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);
+
+ /* render settings */
+ prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "alpha");
+ RNA_def_property_range(prop, 0.0, 1.0f);
+ RNA_def_property_ui_text(prop, "Opacity", "Render Opacity");
+ RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL);
}
static void rna_def_maskobjects(BlenderRNA *brna, PropertyRNA *cprop)