diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-04-12 21:21:31 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-04-12 21:21:31 +0400 |
commit | a305452275207a555d2812c3a5ea6647f0f594e4 (patch) | |
tree | 991400d761e7895e84841bfe63c5b9f71078dc9e /source/blender/editors/sculpt_paint/paint_image.c | |
parent | 8f658d42643b5edb03d4ae16ca8f9f611b1fbf74 (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_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index e1988215fc1..fbc71d90a93 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -343,7 +343,7 @@ static Brush *image_paint_brush(bContext *C) Scene *scene = CTX_data_scene(C); ToolSettings *settings = scene->toolsettings; - return paint_brush(&settings->imapaint.paint); + return BKE_paint_brush(&settings->imapaint.paint); } static int image_paint_poll(bContext *C) @@ -487,7 +487,7 @@ static void paint_stroke_update_step(bContext *C, struct PaintStroke *stroke, Po { PaintOperation *pop = paint_stroke_mode_data(stroke); Scene *scene = CTX_data_scene(C); - Brush *brush = paint_brush(&scene->toolsettings->imapaint.paint); + Brush *brush = BKE_paint_brush(&scene->toolsettings->imapaint.paint); /* initial brush values. Maybe it should be considered moving these to stroke system */ float startsize = BKE_brush_size_get(scene, brush); @@ -652,8 +652,8 @@ void brush_drawcursor_texpaint_uvsculpt(bContext *C, int x, int y, void *UNUSED( Scene *scene = CTX_data_scene(C); //Brush *brush = image_paint_brush(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); if (paint && brush && paint->flags & PAINT_SHOW_BRUSH) { float zoomx, zoomy; |