Paint refactoring commit, non-disruptive (in theory :p)
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 12 Apr 2013 17:21:31 +0000 (17:21 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 12 Apr 2013 17:21:31 +0000 (17:21 +0000)
commita305452275207a555d2812c3a5ea6647f0f594e4
tree991400d761e7895e84841bfe63c5b9f71078dc9e
parent8f658d42643b5edb03d4ae16ca8f9f611b1fbf74
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.
27 files changed:
release/scripts/startup/bl_ui/properties_paint_common.py
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/paint.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/render/render_update.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/makesrna/intern/rna_brush.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_texture.c
source/blender/nodes/texture/node_texture_tree.c
source/blender/windowmanager/intern/wm_operators.c