Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-03-10 10:55:38 +0300
committerAntonioya <blendergit@gmail.com>2019-03-10 10:55:38 +0300
commitb7bcc30329251f33f4b0b58689d5489f9c42299d (patch)
tree6ed7f21596bf63ec069d81e870aef8e21701ba32 /source/blender/editors/render
parent9ad156374f599aa585b3cc49b54a8d48f10c60d6 (diff)
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.
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r--source/blender/editors/render/render_shading.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index d1bed15872d..51edf6c835f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -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");