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:
authorCampbell Barton <ideasman42@gmail.com>2017-10-17 06:06:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-17 06:06:49 +0300
commit0ffa64a45f7d961cb079a56629bcff105c81eb56 (patch)
tree238bdd23687e6b54c1f75a35e5497837e8662bea /source/blender/editors/sculpt_paint
parentdd91d7d09d9994bc20bdbfb501d5101044ac99c8 (diff)
parent99520e3f92e14eb3b7fab3f7decd0914a3da1360 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_curve.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h16
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c22
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c2
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
8 files changed, 41 insertions, 41 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 2d2d5fa33c9..e1e90506299 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -249,12 +249,12 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
TexSnapshot *target;
MTex *mtex = (primary) ? &br->mtex : &br->mask_mtex;
- OverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags();
+ eOverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags();
GLubyte *buffer = NULL;
int size;
bool refresh;
- OverlayControlFlags invalid = (primary) ? (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY) :
+ eOverlayControlFlags invalid = (primary) ? (overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_PRIMARY) :
(overlay_flags & PAINT_INVALID_OVERLAY_TEXTURE_SECONDARY);
target = (primary) ? &primary_snap : &secondary_snap;
@@ -397,7 +397,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
{
bool init;
- OverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags();
+ eOverlayControlFlags overlay_flags = BKE_paint_get_overlay_flags();
GLubyte *buffer = NULL;
int size;
@@ -778,11 +778,11 @@ static void paint_draw_cursor_overlay(UnifiedPaintSettings *ups, Brush *brush,
}
static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
- ViewContext *vc, int x, int y, float zoom, PaintMode mode)
+ ViewContext *vc, int x, int y, float zoom, ePaintMode mode)
{
/* color means that primary brush texture is colured and secondary is used for alpha/mask control */
bool col = ELEM(mode, ePaintTextureProjective, ePaintTexture2D, ePaintVertex) ? true : false;
- OverlayControlFlags flags = BKE_paint_get_overlay_flags();
+ eOverlayControlFlags flags = BKE_paint_get_overlay_flags();
gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT);
/* coloured overlay should be drawn separately */
@@ -997,7 +997,7 @@ static void paint_cursor_on_hit(UnifiedPaintSettings *ups, Brush *brush, ViewCon
}
}
-static bool ommit_cursor_drawing(Paint *paint, PaintMode mode, Brush *brush)
+static bool ommit_cursor_drawing(Paint *paint, ePaintMode mode, Brush *brush)
{
if (paint->flags & PAINT_SHOW_BRUSH) {
if (ELEM(mode, ePaintTexture2D, ePaintTextureProjective) && brush->imagepaint_tool == PAINT_TOOL_FILL) {
@@ -1014,7 +1014,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
Paint *paint = BKE_paint_get_active_from_context(C);
Brush *brush = BKE_paint_brush(paint);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
/* check that brush drawing is enabled */
if (ommit_cursor_drawing(paint, mode, brush))
diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c
index 9704db9d035..0ee78d61fb8 100644
--- a/source/blender/editors/sculpt_paint/paint_curve.c
+++ b/source/blender/editors/sculpt_paint/paint_curve.c
@@ -128,7 +128,7 @@ static void paintcurve_undo_delete(ListBase *lb)
static void paintcurve_undo_begin(bContext *C, wmOperator *op, PaintCurve *pc)
{
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
ListBase *lb = NULL;
int undo_stack_id;
UndoCurve *uc;
@@ -733,7 +733,7 @@ void PAINTCURVE_OT_slide(wmOperatorType *ot)
static int paintcurve_draw_exec(bContext *C, wmOperator *UNUSED(op))
{
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
const char *name;
switch (mode) {
@@ -774,7 +774,7 @@ void PAINTCURVE_OT_draw(wmOperatorType *ot)
static int paintcurve_cursor_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
switch (mode) {
case ePaintTexture2D:
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index e324f2b89f0..580e42e5974 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -511,7 +511,7 @@ BlurKernel *paint_new_blur_kernel(Brush *br, bool proj)
BlurKernel *kernel = MEM_mallocN(sizeof(BlurKernel), "blur kernel");
float radius;
int side;
- BlurKernelType type = br->blur_mode;
+ eBlurKernelType type = br->blur_mode;
if (proj) {
radius = 0.5f;
@@ -625,13 +625,13 @@ static int image_paint_2d_clone_poll(bContext *C)
}
/************************ paint operator ************************/
-typedef enum TexPaintMode {
+typedef enum eTexPaintMode {
PAINT_MODE_2D,
PAINT_MODE_3D_PROJECT
-} TexPaintMode;
+} eTexPaintMode;
typedef struct PaintOperation {
- TexPaintMode mode;
+ eTexPaintMode mode;
void *custom_paint;
@@ -1208,7 +1208,7 @@ static int sample_color_exec(bContext *C, wmOperator *op)
{
Paint *paint = BKE_paint_get_active_from_context(C);
Brush *brush = BKE_paint_brush(paint);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
ARegion *ar = CTX_wm_region(C);
wmWindow *win = CTX_wm_window(C);
const bool show_cursor = ((paint->flags & PAINT_SHOW_BRUSH) != 0);
@@ -1260,7 +1260,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event
RNA_int_set_array(op->ptr, "location", event->mval);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
const bool use_sample_texture = (mode == ePaintTextureProjective) && !RNA_boolean_get(op->ptr, "merged");
paint_sample_color(C, ar, event->mval[0], event->mval[1], use_sample_texture, false);
@@ -1296,7 +1296,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_FINISHED;
}
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
const bool use_sample_texture = (mode == ePaintTextureProjective) && !RNA_boolean_get(op->ptr, "merged");
switch (event->type) {
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index b3b7d40391a..28d9dfe13b0 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -54,7 +54,7 @@ struct wmOperator;
struct wmOperatorType;
struct wmWindowManager;
struct DMCoNo;
-enum PaintMode;
+enum ePaintMode;
/* paint_stroke.c */
typedef bool (*StrokeGetLocation)(struct bContext *C, float location[3], const float mouse[2]);
@@ -69,12 +69,12 @@ struct PaintStroke *paint_stroke_new(struct bContext *C, struct wmOperator *op,
StrokeDone done, int event_type);
void paint_stroke_data_free(struct wmOperator *op);
-bool paint_space_stroke_enabled(struct Brush *br, enum PaintMode mode);
-bool paint_supports_dynamic_size(struct Brush *br, enum PaintMode mode);
-bool paint_supports_dynamic_tex_coords(struct Brush *br, enum PaintMode mode);
-bool paint_supports_smooth_stroke(struct Brush *br, enum PaintMode mode);
-bool paint_supports_texture(enum PaintMode mode);
-bool paint_supports_jitter(enum PaintMode mode);
+bool paint_space_stroke_enabled(struct Brush *br, enum ePaintMode mode);
+bool paint_supports_dynamic_size(struct Brush *br, enum ePaintMode mode);
+bool paint_supports_dynamic_tex_coords(struct Brush *br, enum ePaintMode mode);
+bool paint_supports_smooth_stroke(struct Brush *br, enum ePaintMode mode);
+bool paint_supports_texture(enum ePaintMode mode);
+bool paint_supports_jitter(enum ePaintMode mode);
struct wmKeyMap *paint_stroke_modal_keymap(struct wmKeyConfig *keyconf);
int paint_stroke_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
@@ -335,7 +335,7 @@ typedef struct {
int pixel_len; /* pixels around center that kernel is wide */
} BlurKernel;
-enum BlurKernelType;
+enum eBlurKernelType;
/* can be extended to other blur kernels later */
BlurKernel *paint_new_blur_kernel(struct Brush *br, bool proj);
void paint_delete_blur_kernel(BlurKernel *);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 2899cfeedcf..d3dcf283052 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -66,7 +66,7 @@ static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
Paint *paint = BKE_paint_get_active_from_context(C);
Brush *br = BKE_paint_brush(paint);
Main *bmain = CTX_data_main(C);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
if (br)
br = BKE_brush_copy(bmain, br);
@@ -195,7 +195,7 @@ static int palette_color_add_exec(bContext *C, wmOperator *UNUSED(op))
Scene *scene = CTX_data_scene(C);
Paint *paint = BKE_paint_get_active_from_context(C);
Brush *brush = paint->brush;
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
Palette *palette = paint->palette;
PaletteColor *color;
@@ -776,7 +776,7 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
static int stencil_control_poll(bContext *C)
{
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
Paint *paint;
Brush *br;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index d92afd414f8..dacaea6a96e 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -201,7 +201,7 @@ static void paint_draw_line_cursor(bContext *C, int x, int y, void *customdata)
glDisable(GL_LINE_SMOOTH);
}
-static bool paint_tool_require_location(Brush *brush, PaintMode mode)
+static bool paint_tool_require_location(Brush *brush, ePaintMode mode)
{
switch (mode) {
case ePaintSculpt:
@@ -223,7 +223,7 @@ static bool paint_tool_require_location(Brush *brush, PaintMode mode)
/* Initialize the stroke cache variants from operator properties */
static bool paint_brush_update(bContext *C,
Brush *brush,
- PaintMode mode,
+ ePaintMode mode,
struct PaintStroke *stroke,
const float mouse_init[2],
float mouse[2], float pressure,
@@ -405,7 +405,7 @@ static bool paint_brush_update(bContext *C,
return location_success;
}
-static bool paint_stroke_use_jitter(PaintMode mode, Brush *brush, bool invert)
+static bool paint_stroke_use_jitter(ePaintMode mode, Brush *brush, bool invert)
{
bool use_jitter = (brush->flag & BRUSH_ABSOLUTE_JITTER) ?
(brush->jitter_absolute != 0) : (brush->jitter != 0);
@@ -425,7 +425,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
{
Scene *scene = CTX_data_scene(C);
Paint *paint = BKE_paint_get_active_from_context(C);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
Brush *brush = BKE_paint_brush(paint);
PaintStroke *stroke = op->customdata;
UnifiedPaintSettings *ups = stroke->ups;
@@ -500,7 +500,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
/* Returns zero if no sculpt changes should be made, non-zero otherwise */
static bool paint_smooth_stroke(
- PaintStroke *stroke, const PaintSample *sample, PaintMode mode,
+ PaintStroke *stroke, const PaintSample *sample, ePaintMode mode,
float r_mouse[2], float *r_pressure)
{
if (paint_supports_smooth_stroke(stroke->brush, mode)) {
@@ -766,7 +766,7 @@ static void stroke_done(struct bContext *C, struct wmOperator *op)
}
/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */
-bool paint_space_stroke_enabled(Brush *br, PaintMode mode)
+bool paint_space_stroke_enabled(Brush *br, ePaintMode mode)
{
return (br->flag & BRUSH_SPACE) && paint_supports_dynamic_size(br, mode);
}
@@ -781,7 +781,7 @@ static bool sculpt_is_grab_tool(Brush *br)
}
/* return true if the brush size can change during paint (normally used for pressure) */
-bool paint_supports_dynamic_size(Brush *br, PaintMode mode)
+bool paint_supports_dynamic_size(Brush *br, ePaintMode mode)
{
if (br->flag & BRUSH_ANCHORED)
return false;
@@ -807,7 +807,7 @@ bool paint_supports_dynamic_size(Brush *br, PaintMode mode)
return true;
}
-bool paint_supports_smooth_stroke(Brush *br, PaintMode mode)
+bool paint_supports_smooth_stroke(Brush *br, ePaintMode mode)
{
if (!(br->flag & BRUSH_SMOOTH_STROKE) ||
(br->flag & (BRUSH_ANCHORED | BRUSH_DRAG_DOT | BRUSH_LINE)))
@@ -826,14 +826,14 @@ bool paint_supports_smooth_stroke(Brush *br, PaintMode mode)
return true;
}
-bool paint_supports_texture(PaintMode mode)
+bool paint_supports_texture(ePaintMode mode)
{
/* omit: PAINT_WEIGHT, PAINT_SCULPT_UV, PAINT_INVALID */
return ELEM(mode, ePaintSculpt, ePaintVertex, ePaintTextureProjective, ePaintTexture2D);
}
/* return true if the brush size can change during paint (normally used for pressure) */
-bool paint_supports_dynamic_tex_coords(Brush *br, PaintMode mode)
+bool paint_supports_dynamic_tex_coords(Brush *br, ePaintMode mode)
{
if (br->flag & BRUSH_ANCHORED)
return false;
@@ -1095,7 +1095,7 @@ static void paint_stroke_line_constrain(PaintStroke *stroke, float mouse[2])
int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
Paint *p = BKE_paint_get_active_from_context(C);
- PaintMode mode = BKE_paintmode_get_active_from_context(C);
+ ePaintMode mode = BKE_paintmode_get_active_from_context(C);
PaintStroke *stroke = op->customdata;
Brush *br = stroke->brush;
PaintSample sample_average;
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index e9d82c24b13..b5a17055c1d 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -282,7 +282,7 @@ static void imapaint_pick_uv(EvaluationContext *eval_ctx, Scene *scene, Object *
float p[2], w[3], absw, minabsw;
float matrix[4][4], proj[4][4];
GLint view[4];
- const ImagePaintMode mode = scene->toolsettings->imapaint.mode;
+ const eImageePaintMode mode = scene->toolsettings->imapaint.mode;
const MLoopTri *lt = dm->getLoopTriArray(dm);
const MPoly *mpoly = dm->getPolyArray(dm);
const MLoop *mloop = dm->getLoopArray(dm);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index dff536f91f2..ca5d0f53ea4 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -3920,7 +3920,7 @@ static const char *sculpt_tool_name(Sculpt *sd)
{
Brush *brush = BKE_paint_brush(&sd->paint);
- switch ((BrushSculptTool)brush->sculpt_tool) {
+ switch ((eBrushSculptTool)brush->sculpt_tool) {
case SCULPT_TOOL_DRAW:
return "Draw Brush";
case SCULPT_TOOL_SMOOTH: