diff options
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 782f45e6cb9..bb2916bcff9 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -160,6 +160,17 @@ void paint_update_brush_rake_rotation(struct UnifiedPaintSettings *ups, struct B void BKE_paint_stroke_get_average(struct Scene *scene, struct Object *ob, float stroke[3]); +/* Used for both vertex color and weight paint */ +struct SculptVertexPaintGeomMap { + int *vert_map_mem; + struct MeshElemMap *vert_to_loop; + int *poly_map_mem; + struct MeshElemMap *vert_to_poly; + + /* Runtime. */ + unsigned int *tot_loops_hit; +}; + /* Session data (mode-specific) */ typedef struct SculptSession { @@ -208,23 +219,36 @@ typedef struct SculptSession { union { struct { - int *vert_map_mem; - struct MeshElemMap *vert_to_loop; - int *poly_map_mem; - struct MeshElemMap *vert_to_poly; - - unsigned int (*total_color)[3]; - double *total_weight; - unsigned int *tot_loops_hit; - float *alpha_weight; - float *previous_weight; + struct SculptVertexPaintGeomMap gmap; + + /* For non-airbrush painting to re-apply from the original (MLoop aligned). */ unsigned int *previous_color; - bool building_vp_handle; - } vwpaint; + + /* For blur only (PBVH Node aligned). */ + unsigned int (*average_color)[3]; + } vpaint; + + struct { + struct SculptVertexPaintGeomMap gmap; + + /* Vertex aligned arrays of weights. */ + /* For non-airbrush painting to re-apply from the original. */ + float *previous_weight; + /* Keep track of how much each vertex has been painted (non-airbrush only). */ + float *alpha_weight; + + /* For blur only (PBVH Node aligned). */ + double *average_weight; + } wpaint; + //struct { //ToDo: identify sculpt-only fields //} sculpt; - } modes; + } mode; + int mode_type; + + /* This flag prevents PBVH from being freed when creating the vp_handle for texture paint. */ + bool building_vp_handle; } SculptSession; void BKE_sculptsession_free(struct Object *ob); |