diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-01-31 14:17:50 +0300 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-01-31 14:17:50 +0300 |
commit | 48fc6f569811bc29011d21e82f76c4152692ecf4 (patch) | |
tree | dcd7405cb69bb5a70915f1985b8c301654bdcedf /source/blender/makesrna | |
parent | e5cbc0307a3b3a5e5c922bf07eaf71000440b4ab (diff) |
Added transparency feature to node editor backdrop, similar to image editor. Alpha blending can be enabled by a button when "Use Backdrop" is selected.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8b3734a7c46..8cf0d94d03e 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2267,7 +2267,13 @@ static void rna_def_space_node(BlenderRNA *brna) {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World"}, {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush"}, {0, NULL, 0, NULL, NULL}}; - + + static EnumPropertyItem backdrop_channels_items[] = { + {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"}, + {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"}, + {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceNode"); RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data"); @@ -2317,6 +2323,12 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Backdrop Y", "Backdrop Y offset"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); + + prop= RNA_def_property(srna, "backdrop_channels", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, backdrop_channels_items); + RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); } static void rna_def_space_logic(BlenderRNA *brna) |