[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32911] trunk/blender/source/blender/ makesrna/intern/rna_space.c: Inverted the opacity setting for Background Images through RNA.

Campbell Barton ideasman42 at gmail.com
Sun Nov 7 10:53:40 CET 2010


Revision: 32911
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32911
Author:   campbellbarton
Date:     2010-11-07 10:53:39 +0100 (Sun, 07 Nov 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-11-07 09:33:10 UTC (rev 32910)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-11-07 09:53:39 UTC (rev 32911)
@@ -721,6 +721,18 @@
 	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 @@
 	
 	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);





More information about the Bf-blender-cvs mailing list