From a305452275207a555d2812c3a5ea6647f0f594e4 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 12 Apr 2013 17:21:31 +0000 Subject: 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. --- source/blender/editors/space_buttons/buttons_context.c | 2 +- source/blender/editors/space_buttons/buttons_texture.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_buttons') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 072ea504b9f..564f0589b58 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -353,7 +353,7 @@ static int buttons_context_path_brush(ButsContextPath *path) scene = path->ptr[path->len - 1].data; if (scene) - br = paint_brush(paint_get_active(scene)); + br = BKE_paint_brush(BKE_paint_get_active(scene)); if (br) { RNA_id_pointer_create((ID *)br, &path->ptr[path->len]); diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 5a7d70d279c..c8a9fb9ac09 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -177,7 +177,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext * if (!(pinid || pinid == &scene->id)) { ob = (scene->basact) ? scene->basact->object : NULL; wrld = scene->world; - brush = paint_brush(paint_get_active_from_context(C)); + brush = BKE_paint_brush(BKE_paint_get_active_from_context(C)); } if (ob && ob->type == OB_LAMP && !la) -- cgit v1.2.3