Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-22 22:56:46 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-22 22:56:46 +0400
commit3b5b761a56424987790bd1aad6fcb9ac1f0a281b (patch)
treeb0b8c51df20dc3613ab265858c0ca072151e83ea /source/blender/makesrna/intern/rna_brush.c
parent528cce431380d53176ce7a9f5835612e2536566a (diff)
== Sculpt/Paint Fixes ==
* Fix: unify strength and size did work consistently with other paint modes * Fix: If [ and ] keys were used to resize a brush it was not possible to increase the size of the brush if it went under 10 pixels * Fix: Made interpretation of brush size consistent across all modes, Texture/Image paint interpreted brush size as the diameter while all the other modes interpret it as radius * Fix: The default spacing for vertex paint brushes was 3%, should be 10% * Fix: due to fixes to unified strength, re-enabled 'Unify Size' by default * Fix: Unified size and strength were stored in UserPrefs, moved this to ToolSettings * Fix: The setting of pressure sensitivity was not unified when strength or size were unified. Now the appropriate pressure sensitivity setting is also unified across all brushes when corresponding unification option is selected * Fix: When using [ and ] to resize the brush it didn't immediately redraw * Fix: fkey resizing/"re-strength-ing" was not working consistently accross all paint modes due to only sculpt mode having full support for unified size and strength, now it works properly. * Fix: other paint modes did expose the ability to have a custom brush colors, so I added the small bit of code to allow it. Note: I made all of the other paint mode brushes white. Note2: Actually, probably want to make the paint modes use the selected color for painting instead of a constant brush color. * I had removed OPTYPE_REGISTER from some Sculpt/Paint operators but in this commit I add them back. I'm not completely sure what this option does so I don't want to disturb it for now.
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c87
1 files changed, 83 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 491819441e2..1da8986fd4c 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -52,6 +52,7 @@ static void rna_Brush_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Brush *br= (Brush*)ptr->data;
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
+ WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, NULL);
}
static int rna_Brush_is_sculpt_brush(Brush *me, bContext *C)
@@ -120,6 +121,78 @@ static void rna_Brush_icon_update(Main *bmain, Scene *scene, PointerRNA *ptr)
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
}
+static void rna_Brush_set_size(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_size(me, value);
+}
+
+static int rna_Brush_get_size(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_size(me);
+}
+
+static void rna_Brush_set_use_locked_size(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_locked_size(me, value);
+}
+
+static int rna_Brush_get_use_locked_size(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_locked_size(me);
+}
+
+static void rna_Brush_set_use_size_pressure(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_size_pressure(me, value);
+}
+
+static int rna_Brush_get_use_size_pressure(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_size_pressure(me);
+}
+
+static void rna_Brush_set_use_alpha_pressure(PointerRNA *ptr, int value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_use_alpha_pressure(me, value);
+}
+
+static int rna_Brush_get_use_alpha_pressure(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_use_alpha_pressure(me);
+}
+
+static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_unprojected_radius(me, value);
+}
+
+static float rna_Brush_get_unprojected_radius(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_unprojected_radius(me);
+}
+
+static void rna_Brush_set_alpha(PointerRNA *ptr, float value)
+{
+ Brush* me = (Brush*)(ptr->data);
+ brush_set_alpha(me, value);
+}
+
+static float rna_Brush_get_alpha(PointerRNA *ptr)
+{
+ Brush* me = (Brush*)(ptr->data);
+ return brush_alpha(me);
+}
+
#else
static void rna_def_brush_texture_slot(BlenderRNA *brna)
@@ -415,15 +488,17 @@ static void rna_def_brush(BlenderRNA *brna)
/* number values */
prop= RNA_def_property(srna, "size", PROP_INT, PROP_DISTANCE);
+ RNA_def_property_int_funcs(prop, "rna_Brush_get_size", "rna_Brush_set_size", NULL);
RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS*10);
RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, 0);
RNA_def_property_ui_text(prop, "Size", "Radius of the brush in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "unprojected_radius", PROP_FLOAT, PROP_DISTANCE);
- RNA_def_property_range(prop, 0, FLT_MAX);
- RNA_def_property_ui_range(prop, 0, 1, 0, 0);
- RNA_def_property_ui_text(prop, "Surface Size", "Radius of brush in Blender units");
+ RNA_def_property_float_funcs(prop, "rna_Brush_get_unprojected_radius", "rna_Brush_set_unprojected_radius", NULL);
+ RNA_def_property_range(prop, 0.001, FLT_MAX);
+ RNA_def_property_ui_range(prop, 0.001, 1, 0, 0);
+ RNA_def_property_ui_text(prop, "Unprojected Radius", "Radius of brush in Blender units");
RNA_def_property_update(prop, 0, "rna_Brush_update");
prop= RNA_def_property(srna, "jitter", PROP_FLOAT, PROP_NONE);
@@ -464,6 +539,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
+ RNA_def_property_float_funcs(prop, "rna_Brush_get_alpha", "rna_Brush_set_alpha", NULL);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 0.001);
@@ -532,6 +608,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_alpha_pressure", "rna_Brush_set_use_alpha_pressure");
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength");
RNA_def_property_update(prop, 0, "rna_Brush_update");
@@ -544,6 +621,7 @@ static void rna_def_brush(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_size_pressure", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SIZE_PRESSURE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_size_pressure", "rna_Brush_set_use_size_pressure");
RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0);
RNA_def_property_ui_text(prop, "Size Pressure", "Enable tablet pressure sensitivity for size");
RNA_def_property_update(prop, 0, "rna_Brush_update");
@@ -622,7 +700,8 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Adaptive Spacing", "Space daubs according to surface orientation instead of screen space");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop= RNA_def_property(srna, "lock_brush_size", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Brush_get_use_locked_size", "rna_Brush_set_use_locked_size");
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE);
RNA_def_property_ui_text(prop, "Use Blender Units", "When locked brush stays same size relative to object; when unlocked brush size is given in pixels");
RNA_def_property_update(prop, 0, "rna_Brush_update");