[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58813] trunk/blender/source/blender: Some versioning changes/patching of the brush system:

Antony Riakiotakis kalast at gmail.com
Fri Aug 2 02:24:34 CEST 2013


Revision: 58813
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58813
Author:   psy-fi
Date:     2013-08-02 00:24:34 +0000 (Fri, 02 Aug 2013)
Log Message:
-----------
Some versioning changes/patching of the brush system:

* Change overlay alphas to 33 if not initialized. This should have been
done for 2.67 but better do it now to avoid frustration with overly
transparent overlays. For users that have set this low manually this
will reset the setting to 33 but I think it's less irritating than users
who unwillingly had the setting to 1 and saw nothing when activating the
overlay.

* Allow overlay alpha to be zero as well

* Reset old, now obsolete BRUSH_FIXED flag for brushes that still use
this. I am doing this here to avoid patching hell when the paint brush
is merged, since it's not possible to know the merged version
beforehand, and this flag will be used.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_blender.h
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/makesrna/intern/rna_brush.c

Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_blender.h	2013-08-01 23:07:53 UTC (rev 58812)
+++ trunk/blender/source/blender/blenkernel/BKE_blender.h	2013-08-02 00:24:34 UTC (rev 58813)
@@ -42,8 +42,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         268
-#define BLENDER_SUBVERSION      1
-
+#define BLENDER_SUBVERSION      2
 /* 262 was the last editmesh release but it has compatibility code for bmesh data */
 #define BLENDER_MINVERSION      262
 #define BLENDER_MINSUBVERSION   0

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2013-08-01 23:07:53 UTC (rev 58812)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2013-08-02 00:24:34 UTC (rev 58813)
@@ -9495,6 +9495,22 @@
 			brush->spacing = MAX2(1, brush->spacing);
 		}
 	}
+
+	if (!MAIN_VERSION_ATLEAST(main, 268, 2)) {
+		Brush *brush;
+		#define BRUSH_FIXED (1 << 6)
+		for (brush = main->brush.first; brush; brush = brush->id.next) {
+			brush->flag &= ~BRUSH_FIXED;
+
+			if(brush->cursor_overlay_alpha < 2)
+				brush->cursor_overlay_alpha = 33;
+			if(brush->texture_overlay_alpha < 2)
+				brush->texture_overlay_alpha = 33;
+			if(brush->mask_overlay_alpha <2)
+				brush->mask_overlay_alpha = 33;
+		}
+		#undef BRUSH_FIXED
+	}
 	
 	{
 		bScreen *sc;

Modified: trunk/blender/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_brush.c	2013-08-01 23:07:53 UTC (rev 58812)
+++ trunk/blender/source/blender/makesrna/intern/rna_brush.c	2013-08-02 00:24:34 UTC (rev 58813)
@@ -1086,19 +1086,19 @@
 
 	prop = RNA_def_property(srna, "texture_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
 	RNA_def_property_int_sdna(prop, NULL, "texture_overlay_alpha");
-	RNA_def_property_range(prop, 1, 100);
+	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Texture Overlay Alpha", "");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
 	prop = RNA_def_property(srna, "mask_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
 	RNA_def_property_int_sdna(prop, NULL, "mask_overlay_alpha");
-	RNA_def_property_range(prop, 1, 100);
+	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
 	prop = RNA_def_property(srna, "cursor_overlay_alpha", PROP_INT, PROP_PERCENTAGE);
 	RNA_def_property_int_sdna(prop, NULL, "cursor_overlay_alpha");
-	RNA_def_property_range(prop, 1, 100);
+	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Mask Texture Overlay Alpha", "");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 




More information about the Bf-blender-cvs mailing list