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:
authorAntony Riakiotakis <kalast@gmail.com>2013-04-12 21:21:31 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-04-12 21:21:31 +0400
commita305452275207a555d2812c3a5ea6647f0f594e4 (patch)
tree991400d761e7895e84841bfe63c5b9f71078dc9e /source/blender/editors/sculpt_paint/paint_ops.c
parent8f658d42643b5edb03d4ae16ca8f9f611b1fbf74 (diff)
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews, * Expose alpha mask mapping to UI (still not functional but coming soon). * More overlay refactoring: Overlay now does minimal checking for texture refresh. Instead, we now have invalidation flags to set an aspect of the brush overlay as invalid. This is necessary because this way we will be able to separate and preview different brush attributes on the overlays, using different textures: These attributes/aspects are: Primary texture (main texture for sculpt, vertex, imapaint) Secondary texture (mask/alpha texture for imapaint) Cursor texture (cursor texture. It involves brush strength and curves) Modified the relevant RNA property update functions and C update callback functions to call the relevant cursor invalidation functions instead of checking every frame for multiple properties. Properties that affect this are: Image changes, if image is used by current brush, Texture slot changes, similarly Curve changes, Object mode change invalidates the cursor Paint tool change invalidates the cursor. These changes give slightly more invalidation cases than simply comparing the relevant properties each frame, but these do not occur in performance critical moments and it's a much more elegant system than adding more variables to check per frame each time we add something on the system.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index d5c5d9ee150..f1207aa5706 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -63,8 +63,8 @@
static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
{
/*int type = RNA_enum_get(op->ptr, "type");*/
- Paint *paint = paint_get_active_from_context(C);
- Brush *br = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *br = BKE_paint_brush(paint);
Main *bmain = CTX_data_main(C);
if (br)
@@ -72,7 +72,7 @@ static int brush_add_exec(bContext *C, wmOperator *UNUSED(op))
else
br = BKE_brush_add(bmain, "Brush");
- paint_brush_set(paint, br);
+ BKE_paint_brush_set(paint, br);
return OPERATOR_FINISHED;
}
@@ -95,8 +95,8 @@ static void BRUSH_OT_add(wmOperatorType *ot)
static int brush_scale_size_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- Paint *paint = paint_get_active_from_context(C);
- Brush *brush = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *brush = BKE_paint_brush(paint);
// Object *ob = CTX_data_active_object(C);
float scalar = RNA_float_get(op->ptr, "scalar");
@@ -177,8 +177,8 @@ static void PAINT_OT_vertex_color_set(wmOperatorType *ot)
static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op))
{
- Paint *paint = paint_get_active_from_context(C);
- Brush *brush = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *brush = BKE_paint_brush(paint);
Object *ob = CTX_data_active_object(C);
if (!ob || !brush) return OPERATOR_CANCELLED;
@@ -268,7 +268,7 @@ static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool,
const char *tool_name, int create_missing,
int toggle)
{
- Brush *brush, *brush_orig = paint_brush(paint);
+ Brush *brush, *brush_orig = BKE_paint_brush(paint);
if (toggle)
brush = brush_tool_toggle(bmain, brush_orig, tool, tool_offset, ob_mode);
@@ -283,7 +283,7 @@ static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool,
}
if (brush) {
- paint_brush_set(paint, brush);
+ BKE_paint_brush_set(paint, brush);
WM_main_add_notifier(NC_BRUSH | NA_EDITED, brush);
return OPERATOR_FINISHED;
}
@@ -475,8 +475,8 @@ typedef struct {
static int stencil_control_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
- Paint *paint = paint_get_active_from_context(C);
- Brush *br = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *br = BKE_paint_brush(paint);
float mdiff[2];
float mvalf[2] = {event->mval[0], event->mval[1]};
@@ -604,8 +604,8 @@ static int stencil_control_modal(bContext *C, wmOperator *op, const wmEvent *eve
static int stencil_control_poll(bContext *C)
{
- Paint *paint = paint_get_active_from_context(C);
- Brush *br = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *br = BKE_paint_brush(paint);
return (br && br->mtex.brush_map_mode == MTEX_MAP_MODE_STENCIL);
}
@@ -638,8 +638,8 @@ static void BRUSH_OT_stencil_control(wmOperatorType *ot)
static int stencil_fit_image_aspect_exec(bContext *C, wmOperator *UNUSED(op))
{
- Paint *paint = paint_get_active_from_context(C);
- Brush *br = paint_brush(paint);
+ Paint *paint = BKE_paint_get_active_from_context(C);
+ Brush *br = BKE_paint_brush(paint);
Tex *tex = (br)? br->mtex.tex : NULL;
if (tex && tex->type == TEX_IMAGE && tex->ima) {