Rename the sculpt/paint unified flags for better consistency, no functional changes
authorNicholas Bishop <nicholasbishop@gmail.com>
Thu, 12 Jan 2012 18:08:07 +0000 (18:08 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Thu, 12 Jan 2012 18:08:07 +0000 (18:08 +0000)
source/blender/blenkernel/intern/brush.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_scene.c

index 7a235966bfd06e29749b7d4d49dfd65da205a509..b1aeea99b1bc926513e8e5a580114747d4130eee 100644 (file)
@@ -1374,7 +1374,7 @@ void brush_set_size(Brush *brush, int size)
 {
        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 @@ int brush_size(Brush *brush)
 {
        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 @@ int brush_use_locked_size(Brush *brush)
 {
        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 @@ void brush_set_use_size_pressure(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_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 @@ int brush_use_size_pressure(Brush *brush)
 {
        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 @@ void brush_set_use_alpha_pressure(Brush *brush, int value)
 {
        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 @@ int brush_use_alpha_pressure(Brush *brush)
 {
        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 @@ void brush_set_unprojected_radius(Brush *brush, float unprojected_radius)
 {
        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 @@ float brush_unprojected_radius(Brush *brush)
 {
        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 @@ void brush_set_alpha(Brush *brush, float alpha)
 {
        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 @@ float brush_alpha(Brush *brush)
 {
        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;
 }
index 9f3353078c24010f066f4f136b1602b9909b5bea..743458f62c8e1364224fab9f6034e72e6cc7b3a4 100644 (file)
@@ -835,15 +835,17 @@ typedef struct UnifiedPaintSettings {
 } 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;
 
 /* *************************************************************** */
index 61ced5bdada7c5bbc33ecff0ac89f86e6e9519b5..af0e8d58e1419f1439a36a6de2d26ccee951cf1f 100644 (file)
@@ -1628,12 +1628,12 @@ static void rna_def_unified_paint_settings(BlenderRNA  *brna)
        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");