[Bf-blender-cvs] [1bf983c] soc-2013-paint: merge with master 19f7f9afab1b36ca
Antony Riakiotakis
noreply at git.blender.org
Wed Mar 5 20:40:10 CET 2014
Commit: 1bf983c48b753e32a8ca12b5c937ed5b44d2fc84
Author: Antony Riakiotakis
Date: Wed Mar 5 21:38:54 2014 +0200
https://developer.blender.org/rB1bf983c48b753e32a8ca12b5c937ed5b44d2fc84
merge with master 19f7f9afab1b36ca
===================================================================
===================================================================
diff --cc release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 91bc4a4,d331ddd..8033594
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@@ -18,7 -18,8 +18,8 @@@
# <pep8 compliant>
import bpy
-from bpy.types import Menu, Panel
+from bpy.types import Menu, Panel, UIList
+ from bl_ui.properties_grease_pencil_common import GreasePencilPanel
from bl_ui.properties_paint_common import (
UnifiedPaintPanel,
brush_texture_settings,
diff --cc source/blender/blenkernel/intern/paint.c
index 8085689,5a38445..4729d0b
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@@ -267,52 -264,8 +267,52 @@@ void BKE_paint_brush_set(Paint *p, Brus
}
}
+Palette *BKE_paint_palette(Paint *p)
+{
+ return p ? p->palette : NULL;
+}
+
+void BKE_paint_palette_set(Paint *p, Palette *palette)
+{
+ if (p) {
+ id_us_min((ID *)p->palette);
+ id_us_plus((ID *)palette);
+ p->palette = palette;
+ }
+}
+
+/* remove colour from palette. Must be certain colour is inside the palette! */
+void BKE_palette_remove_color (Palette *palette, PaletteColor *colour)
+{
+ BLI_remlink(&palette->colors, colour);
+ MEM_freeN(colour);
+}
+
+Palette *BKE_palette_add(Main *bmain, const char *name)
+{
+ Palette *palette;
+
+ palette = BKE_libblock_alloc(bmain, ID_PAL, name);
+
+ /* enable fake user by default */
+ palette->id.flag |= LIB_FAKEUSER;
+
+ return palette;
+}
+
+void BKE_free_palette (Palette *palette) {
+ BLI_freelistN(&palette->colors);
+}
+
+PaletteColor *BKE_palette_color_add(Palette *palette)
+{
+ PaletteColor *color = MEM_callocN(sizeof(*color), "Pallete Color");
+ BLI_addtail(&palette->colors, color);
+ return color;
+}
+
/* are we in vertex paint or weight pain face select mode? */
- bool paint_facesel_test(Object *ob)
+ bool BKE_paint_select_face_test(Object *ob)
{
return ( (ob != NULL) &&
(ob->type == OB_MESH) &&
diff --cc source/blender/editors/interface/interface_handlers.c
index c3a76d2,079b64f..5ff6439
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@@ -309,7 -308,8 +309,7 @@@ typedef struct uiAfterFunc
static bool ui_is_but_interactive(const uiBut *but, const bool labeledit);
static bool ui_but_contains_pt(uiBut *but, float mx, float my);
static bool ui_mouse_inside_button(ARegion *ar, uiBut *but, int x, int y);
- static uiBut *ui_but_find_mouse_over_ex(ARegion *ar, int x, int y, bool ctrl);
+ static uiBut *ui_but_find_mouse_over_ex(ARegion *ar, const int x, const int y, const bool labeledit);
-static uiBut *ui_but_find_mouse_over(ARegion *ar, const wmEvent *event);
static void button_activate_init(bContext *C, ARegion *ar, uiBut *but, uiButtonActivateType type);
static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState state);
static void button_activate_exit(bContext *C, uiBut *but, uiHandleButtonData *data,
diff --cc source/blender/editors/sculpt_paint/paint_image.c
index 740dce5,1b2e708..a5b1a60
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@@ -1258,8 -974,12 +1258,11 @@@ static int sample_color_invoke(bContex
WM_paint_cursor_tag_redraw(win, ar);
WM_redraw_windows(C);
+ RNA_int_set_array(op->ptr, "location", event->mval);
- paint_sample_color(C, ar, event->mval[0], event->mval[1]);
+ paint_sample_color(C, ar, event->mval[0], event->mval[1], mode == PAINT_TEXTURE_PROJECTIVE, false);
- WM_event_add_modal_handler(C, op);
+ WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
+
return OPERATOR_RUNNING_MODAL;
}
@@@ -1502,5 -1140,6 +1505,5 @@@ int vert_paint_poll(bContext *C
int mask_paint_poll(bContext *C)
{
- return paint_facesel_test(CTX_data_active_object(C)) || paint_vertsel_test(CTX_data_active_object(C));
+ return BKE_paint_select_elem_test(CTX_data_active_object(C));
}
-
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index 198e956,5d4037a..902d81d
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -705,7 -705,47 +705,6 @@@ static bool sculpt_brush_test_cyl(Sculp
/* ===== Sculpting =====
*
*/
-
-static float overlapped_curve(Brush *br, float x)
-{
- int i;
- const int n = 100 / br->spacing;
- const float h = br->spacing / 50.0f;
- const float x0 = x - 1;
-
- float sum;
-
- sum = 0;
- for (i = 0; i < n; i++) {
- float xx;
-
- xx = fabsf(x0 + i * h);
-
- if (xx < 1.0f)
- sum += BKE_brush_curve_strength(br, xx, 1);
- }
-
- return sum;
-}
-
-static float integrate_overlap(Brush *br)
-{
- int i;
- int m = 10;
- float g = 1.0f / m;
- float max;
-
- max = 0;
- for (i = 0; i < m; i++) {
- float overlap = overlapped_curve(br, i * g);
-
- if (overlap > max)
- max = overlap;
- }
-
- return max;
-}
--
static void flip_v3(float v[3], const char symm)
{
flip_v3_v3(v, v, symm);
@@@ -4432,11 -4481,10 +4432,10 @@@ static void sculpt_stroke_update_step(b
(float)sd->detail_size);
if (sculpt_stroke_dynamic_topology(ss, brush)) {
- do_symmetrical_brush_actions(sd, ob, sculpt_topology_update);
+ do_symmetrical_brush_actions(sd, ob, sculpt_topology_update, ups);
}
- if (BKE_paint_brush(&sd->paint)->sculpt_tool != SCULPT_TOOL_SIMPLIFY)
- do_symmetrical_brush_actions(sd, ob, do_brush_action, ups);
- do_symmetrical_brush_actions(sd, ob, do_brush_action);
++ do_symmetrical_brush_actions(sd, ob, do_brush_action, ups);
sculpt_combine_proxies(sd, ob);
diff --cc source/blender/editors/space_image/space_image.c
index 40d81da,5c9fd23..5cfc12c
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@@ -69,8 -69,8 +69,9 @@@
#include "WM_types.h"
#include "UI_resources.h"
+ #include "UI_interface.h"
#include "UI_view2d.h"
+#include "UI_interface.h"
#include "image_intern.h"
diff --cc source/blender/makesdna/DNA_brush_types.h
index 873bba5,86fa705..541ba2e
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@@ -90,11 -86,6 +90,11 @@@ typedef struct Brush
float plane_offset; /* offset for plane brushes (clay, flatten, fill, scrape) */
- float gravity_factor; /* gravity factor for sculpting */
++ float pad;
+ int gradient_spacing;
+ int gradient_stroke_mode; /* source for stroke color gradient application */
+ int gradient_fill_mode; /* source for fill tool color gradient application */
+
char sculpt_tool; /* active sculpt tool */
char vertexpaint_tool; /* active vertex/weight paint blend mode (poorly named) */
char imagepaint_tool; /* active image paint tool */
diff --cc source/blender/makesrna/intern/rna_brush.c
index 06050c7,34c4456..02df857
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@@ -948,14 -776,7 +948,7 @@@ static void rna_def_brush(BlenderRNA *b
RNA_def_property_ui_range(prop, 0.01f, 1.0f, 1, 3);
RNA_def_property_ui_text(prop, "Rate", "Interval between paints for Airbrush");
RNA_def_property_update(prop, 0, "rna_Brush_update");
-
+
- prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "gravity_factor");
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
- RNA_def_property_ui_text(prop, "Gravity", "Amount of gravity after each dab");
- RNA_def_property_update(prop, 0, "rna_Brush_update");
-
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_sdna(prop, NULL, "rgb");
More information about the Bf-blender-cvs
mailing list