diff options
author | Antonioya <blendergit@gmail.com> | 2018-12-10 18:54:49 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-12-10 22:18:22 +0300 |
commit | 33785baafee18cb1cfc2b8ec7b65736c44774769 (patch) | |
tree | 957be1652805fe3985e7acda53041054faad1674 /source/blender/editors/gpencil/gpencil_add_monkey.c | |
parent | 18d354a5eb4be975c11cedfab4b17f3ef6fd33ff (diff) |
GP: Set Brush default material when add new GP Object
Before the brush color was not set equal to object active color.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_add_monkey.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_add_monkey.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c index f2967190406..4bd4acfe830 100644 --- a/source/blender/editors/gpencil/gpencil_add_monkey.c +++ b/source/blender/editors/gpencil/gpencil_add_monkey.c @@ -35,6 +35,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "BKE_brush.h" #include "BKE_context.h" #include "BKE_gpencil.h" #include "BKE_main.h" @@ -1440,6 +1441,10 @@ void ED_gpencil_create_monkey(bContext *C, float mat[4][4]) /* set first color as active */ ob->actcol = color_Black + 1; + Material *ma = give_current_material(ob, ob->actcol); + if (ma != NULL) { + BKE_brush_update_material(bmain, ma, NULL); + } /* layers */ /* NOTE: For now, we just add new layers, to make it easier to separate out old/new instances */ |