GPencil: Set brush material after copying a material

This change updates the brush material in the topbar when a new material is created using copy button.

Related to task T62384

Thanks to @matc for suggesting the fix.

Still pending a problem whith user number.
This commit is contained in:
2019-03-10 08:55:38 +01:00
parent 9ad156374f
commit b7bcc30329

View File

@@ -43,6 +43,7 @@
#include "BLT_translation.h"
#include "BKE_animsys.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_editmesh.h"
@@ -530,6 +531,11 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
Material *new_ma = NULL;
BKE_id_copy_ex(bmain, &ma->id, (ID **)&new_ma, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS);
ma = new_ma;
if (ob != NULL && ob->type == OB_GPENCIL) {
BKE_brush_update_material(bmain, new_ma, NULL);
}
}
else {
const char *name = DATA_("Material");