diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-07 12:53:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-07 12:53:39 +0300 |
commit | 89baa67a4023105dfad982c3f7616b731b2fb26a (patch) | |
tree | 538bfddb85ac310ff11ca0af4c7b8dd1c967b2d2 /source/blender/makesrna | |
parent | ed61900e5e5ccb972a5bf63c9301d0669f1e8941 (diff) |
Inverted the opacity setting for Background Images through RNA.
I was testing with a patched blender where this wasn't a problem else I'd have noticed.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 12b2f9970dd..e6f59a5e589 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -721,6 +721,18 @@ static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr) ED_sequencer_update_view(C, view); } +static float rna_BackgroundImage_opacity_get(PointerRNA *ptr) +{ + BGpic *bgpic= (BGpic *)ptr->data; + return 1.0f-bgpic->blend; +} + +static void rna_BackgroundImage_opacity_set(PointerRNA *ptr, float value) +{ + BGpic *bgpic= (BGpic *)ptr->data; + bgpic->blend = 1.0f - value; +} + #else static void rna_def_space(BlenderRNA *brna) @@ -958,6 +970,7 @@ static void rna_def_background_image(BlenderRNA *brna) prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blend"); + RNA_def_property_float_funcs(prop, "rna_BackgroundImage_opacity_get", "rna_BackgroundImage_opacity_set", NULL); RNA_def_property_ui_text(prop, "Opacity", "Image opacity to blend the image against the background color"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); |