[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58262] trunk/blender/source/blender/ editors/space_image/image_ops.c: Fix #36145: Error in inverting channels in the UV/Image Editor

Sergey Sharybin sergey.vfx at gmail.com
Mon Jul 15 12:44:17 CEST 2013


Revision: 58262
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58262
Author:   nazgul
Date:     2013-07-15 10:44:17 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
Fix #36145: Error in inverting channels in the UV/Image Editor

Issue was caused by operator redo saving values for previous
inverted channels, meaning the same channels will be inverted
next time operator runs.

Don't think it's useful to save operator values here, since
you don;t have visual feedback about which channels were
inverted. So marked all this properties as SKIP_SAVE. Gives
much more predictable results.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_ops.c

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2013-07-15 09:10:51 UTC (rev 58261)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2013-07-15 10:44:17 UTC (rev 58262)
@@ -1898,6 +1898,8 @@
 
 void IMAGE_OT_invert(wmOperatorType *ot)
 {
+	PropertyRNA *prop;
+
 	/* identifiers */
 	ot->name = "Invert Channels";
 	ot->idname = "IMAGE_OT_invert";
@@ -1908,10 +1910,14 @@
 	ot->poll = image_invert_poll;
 	
 	/* properties */
-	RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel");
-	RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel");
-	RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel");
-	RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel");
+	prop = RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 	
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;




More information about the Bf-blender-cvs mailing list