[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43329] trunk/blender/source/blender: Rename the sculpt/paint unified flags for better consistency, no functional changes

Nicholas Bishop nicholasbishop at gmail.com
Thu Jan 12 19:08:16 CET 2012


Revision: 43329
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43329
Author:   nicholasbishop
Date:     2012-01-12 18:08:07 +0000 (Thu, 12 Jan 2012)
Log Message:
-----------
Rename the sculpt/paint unified flags for better consistency, no functional changes

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/brush.c
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesrna/intern/rna_scene.c

Modified: trunk/blender/source/blender/blenkernel/intern/brush.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/brush.c	2012-01-12 17:22:32 UTC (rev 43328)
+++ trunk/blender/source/blender/blenkernel/intern/brush.c	2012-01-12 18:08:07 UTC (rev 43329)
@@ -1374,7 +1374,7 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE)
+	if (us_flag & UNIFIED_PAINT_SIZE)
 		set_unified_size(brush, size);
 	else
 		brush->size= size;
@@ -1386,15 +1386,15 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ? unified_size(brush) : brush->size;
+	return (us_flag & UNIFIED_PAINT_SIZE) ? unified_size(brush) : brush->size;
 }
 
 void brush_set_use_locked_size(Brush *brush, int value)
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) {
-		set_unified_settings(brush, SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE, value);
+	if (us_flag & UNIFIED_PAINT_SIZE) {
+		set_unified_settings(brush, UNIFIED_PAINT_BRUSH_LOCK_SIZE, value);
 	}
 	else {
 		if (value)
@@ -1410,8 +1410,8 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
-	        (us_flag & SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE) :
+	return (us_flag & UNIFIED_PAINT_SIZE) ?
+	        (us_flag & UNIFIED_PAINT_BRUSH_LOCK_SIZE) :
 	        (brush->flag & BRUSH_LOCK_SIZE);
 }
 
@@ -1419,8 +1419,8 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) {
-		set_unified_settings(brush, SCULPT_PAINT_UNIFIED_SIZE_PRESSURE, value);
+	if (us_flag & UNIFIED_PAINT_SIZE) {
+		set_unified_settings(brush, UNIFIED_PAINT_BRUSH_SIZE_PRESSURE, value);
 	}
 	else {
 		if (value)
@@ -1436,8 +1436,8 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
-	        (us_flag & SCULPT_PAINT_UNIFIED_SIZE_PRESSURE) :
+	return (us_flag & UNIFIED_PAINT_SIZE) ?
+	        (us_flag & UNIFIED_PAINT_BRUSH_SIZE_PRESSURE) :
 	        (brush->flag & BRUSH_SIZE_PRESSURE);
 }
 
@@ -1445,8 +1445,8 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) {
-		set_unified_settings(brush, SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE, value);
+	if (us_flag & UNIFIED_PAINT_ALPHA) {
+		set_unified_settings(brush, UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE, value);
 	}
 	else {
 		if (value)
@@ -1462,8 +1462,8 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ?
-	        (us_flag & SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE) :
+	return (us_flag & UNIFIED_PAINT_ALPHA) ?
+	        (us_flag & UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE) :
 	        (brush->flag & BRUSH_ALPHA_PRESSURE);
 }
 
@@ -1471,7 +1471,7 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE)
+	if (us_flag & UNIFIED_PAINT_SIZE)
 		set_unified_unprojected_radius(brush, unprojected_radius);
 	else
 		brush->unprojected_radius= unprojected_radius;
@@ -1483,7 +1483,7 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_SIZE) ?
+	return (us_flag & UNIFIED_PAINT_SIZE) ?
 	        unified_unprojected_radius(brush) :
 	        brush->unprojected_radius;
 }
@@ -1492,7 +1492,7 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	if (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA)
+	if (us_flag & UNIFIED_PAINT_ALPHA)
 		set_unified_alpha(brush, alpha);
 	else
 		brush->alpha= alpha;
@@ -1504,7 +1504,7 @@
 {
 	const short us_flag = unified_settings(brush);
 
-	return (us_flag & SCULPT_PAINT_USE_UNIFIED_ALPHA) ?
+	return (us_flag & UNIFIED_PAINT_ALPHA) ?
 	        unified_alpha(brush) :
 	        brush->alpha;
 }

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2012-01-12 17:22:32 UTC (rev 43328)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2012-01-12 18:08:07 UTC (rev 43329)
@@ -835,15 +835,17 @@
 } UnifiedPaintSettings;
 
 typedef enum {
-	SCULPT_PAINT_USE_UNIFIED_SIZE        = (1<<0),
-	SCULPT_PAINT_USE_UNIFIED_ALPHA       = (1<<1),
+	UNIFIED_PAINT_SIZE  = (1<<0),
+	UNIFIED_PAINT_ALPHA = (1<<1),
 
-	/* only used if unified size is enabled */
-	SCULPT_PAINT_UNIFIED_LOCK_BRUSH_SIZE = (1<<2),
-	SCULPT_PAINT_UNIFIED_SIZE_PRESSURE   = (1<<3),
+	/* only used if unified size is enabled, mirros the brush flags
+	   BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
+	UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2),
+	UNIFIED_PAINT_BRUSH_SIZE_PRESSURE   = (1<<3),
 
-	/* only used if unified alpha is enabled */
-	SCULPT_PAINT_UNIFIED_ALPHA_PRESSURE  = (1<<4)
+	/* only used if unified alpha is enabled, mirrors the brush flag
+	   BRUSH_ALPHA_PRESSURE */
+	UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE  = (1<<4)
 } UnifiedPaintSettingsFlags;
 
 /* *************************************************************** */

Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c	2012-01-12 17:22:32 UTC (rev 43328)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c	2012-01-12 18:08:07 UTC (rev 43329)
@@ -1628,12 +1628,12 @@
 	RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings");
 
 	prop= RNA_def_property(srna, "use_unified_size", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", SCULPT_PAINT_USE_UNIFIED_SIZE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_SIZE);
 	RNA_def_property_ui_text(prop, "Use Unified Radius",
 	                         "Instead of per-brush radius, the radius is shared across brushes");
 
 	prop= RNA_def_property(srna, "use_unified_strength", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", SCULPT_PAINT_USE_UNIFIED_ALPHA);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", UNIFIED_PAINT_ALPHA);
 	RNA_def_property_ui_text(prop, "Use Unified Strength",
 	                         "Instead of per-brush strength, the strength is shared across brushes");
 




More information about the Bf-blender-cvs mailing list