Cleanup: de-duplicate paint access from object
authorCampbell Barton <ideasman42@gmail.com>
Mon, 30 Apr 2018 16:58:43 +0000 (18:58 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 30 Apr 2018 16:58:43 +0000 (18:58 +0200)
source/blender/blenkernel/intern/paint.c

index bee6e7d3df0129345299e1b3ab2fa6ad003f5c0a..144ec029db1e3741940da11d7e23e05259bd371b 100644 (file)
@@ -208,27 +208,8 @@ Paint *BKE_paint_get_active_from_context(const bContext *C)
                                return &ts->imapaint.paint;
                        }
                }
-               else if (obact) {
-                       switch (obact->mode) {
-                               case OB_MODE_SCULPT:
-                                       return &ts->sculpt->paint;
-                               case OB_MODE_VERTEX_PAINT:
-                                       return &ts->vpaint->paint;
-                               case OB_MODE_WEIGHT_PAINT:
-                                       return &ts->wpaint->paint;
-                               case OB_MODE_TEXTURE_PAINT:
-                                       return &ts->imapaint.paint;
-                               case OB_MODE_EDIT:
-                                       if (ts->use_uv_sculpt)
-                                               return &ts->uvsculpt->paint;
-                                       return &ts->imapaint.paint;
-                               default:
-                                       return &ts->imapaint.paint;
-                       }
-               }
                else {
-                       /* default to image paint */
-                       return &ts->imapaint.paint;
+                       return BKE_paint_get_active(sce);
                }
        }