Commit: a740cc53ea1061fde58ca0a36986fc04bfe1dad7
Author: Campbell Barton
Date:   Thu Nov 29 15:19:29 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBa740cc53ea1061fde58ca0a36986fc04bfe1dad7

Fix paint initialization, incorrect pointer checks

===================================================================

M       source/blender/blenkernel/intern/paint.c

===================================================================

diff --git a/source/blender/blenkernel/intern/paint.c 
b/source/blender/blenkernel/intern/paint.c
index 9445981538e..8b44bbfa15f 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -664,11 +664,13 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct 
Paint **r_paint)
                return true;
        }
 
-       if (ELEM(*r_paint, &ts->vpaint->paint, &ts->wpaint->paint)) {
+       if (((VPaint **)r_paint == &ts->vpaint) ||
+           ((VPaint **)r_paint == &ts->wpaint))
+       {
                VPaint *data = MEM_callocN(sizeof(*data), __func__);
                paint = &data->paint;
        }
-       else if (*r_paint == &ts->sculpt->paint) {
+       else if ((Sculpt **)r_paint == &ts->sculpt) {
                Sculpt *data = MEM_callocN(sizeof(*data), __func__);
                paint = &data->paint;
 
@@ -678,11 +680,11 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct 
Paint **r_paint)
                /* Make sure at least dyntopo subdivision is enabled */
                data->flags |= SCULPT_DYNTOPO_SUBDIVIDE | 
SCULPT_DYNTOPO_COLLAPSE;
        }
-       else if (*r_paint == &ts->gp_paint->paint) {
+       else if ((GpPaint **)r_paint == &ts->gp_paint) {
                GpPaint *data = MEM_callocN(sizeof(*data), __func__);
                paint = &data->paint;
        }
-       else if (*r_paint == &ts->uvsculpt->paint) {
+       else if ((UvSculpt **)r_paint == &ts->uvsculpt) {
                UvSculpt *data = MEM_callocN(sizeof(*data), __func__);
                paint = &data->paint;
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to