diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-12 18:09:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-12 18:09:05 +0400 |
commit | d7983e3638896e5742fcf1bafe49c49a6b0aa08f (patch) | |
tree | 99470c4aa0896751b9955b5bdb3d3979db73aa91 /source/blender/makesrna/intern/rna_space.c | |
parent | f0dcff9aa982d32bcb91e594df49a780ac376b5b (diff) |
Option to overlay mask over the footage
Currently supports only two modes:
- Show alpha channel of the mask
- Multiply footage by the mask, which will give
you final-looking combined image.
TODO: Currently rasterization happens on every
redraw, need to cache rasterized mask
somewhere to make redraw more realtime.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index aee6b060221..41ea74ebb8c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1336,6 +1336,12 @@ static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *m { PropertyRNA *prop; + static EnumPropertyItem overlay_mode_items[] = { + {MASK_OVERLAY_ALPHACHANNEL, "ALPHACHANNEL", ICON_NONE, "Alpha Channel", "Show alpha channel of the mask"}, + {MASK_OVERLAY_COMBINED, "COMBINED", ICON_NONE, "Combined", "Combine space background image with the mask"}, + {0, NULL, 0, NULL, NULL} + }; + prop = RNA_def_property(srna, "mask", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mask_info.mask"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1354,6 +1360,17 @@ static void rna_def_space_mask_info(StructRNA *srna, int noteflag, const char *m RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_SMOOTH); RNA_def_property_ui_text(prop, "Draw Smooth Splines", ""); RNA_def_property_update(prop, noteflag, NULL); + + prop = RNA_def_property(srna, "show_mask_overlay", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mask_info.draw_flag", MASK_DRAWFLAG_OVERLAY); + RNA_def_property_ui_text(prop, "Show Mask Overlay", ""); + RNA_def_property_update(prop, noteflag, NULL); + + prop = RNA_def_property(srna, "mask_overlay_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "mask_info.overlay_mode"); + RNA_def_property_enum_items(prop, overlay_mode_items); + RNA_def_property_ui_text(prop, "Overlay Mode", "Overlay mode of rasterized mask"); + RNA_def_property_update(prop, noteflag, NULL); } static void rna_def_space_image_uv(BlenderRNA *brna) |