Cleanup: de-duplicate paint access from object

This commit is contained in:
Campbell Barton 2018-04-30 18:58:43 +02:00
parent e76a65e359
commit 188c4a22c9
1 changed files with 1 additions and 20 deletions

View 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);
}
}