diff options
author | Antonioya <blendergit@gmail.com> | 2019-03-25 19:02:42 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-03-25 19:06:07 +0300 |
commit | 7021bd527380b4d87cf48057f0039509326b03dd (patch) | |
tree | 55126437da17d736a789d236c8a98d199a1e6260 /source/blender/editors/gpencil/gpencil_old.c | |
parent | 84240ebb3ebde58f6bfba256e49d37697fb6bc9f (diff) |
GPencil: Only brushes with pinned materials have materials
Using GP_BRUSH_MATERIAL_PINNED to switch between active material and brush material, instead of updating all brushes on active material changes. This will allow brushes to have no material and therefore to not inflate the user count.
This fix T62465.
Patch contributed by @matc
Reviewers: @brecht @antoniov @billreynish @mendio
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_old.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_old.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_old.c b/source/blender/editors/gpencil/gpencil_old.c index 5d6abb594ce..47654b69da4 100644 --- a/source/blender/editors/gpencil/gpencil_old.c +++ b/source/blender/editors/gpencil/gpencil_old.c @@ -112,9 +112,7 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op)) for (bGPDpalettecolor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) { /* create material slot */ - BKE_object_material_slot_add(bmain, ob); - Material *ma = BKE_material_add_gpencil(bmain, palcolor->info); - assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_USERPREF); + Material *ma = BKE_gpencil_handle_new_material(bmain, ob, palcolor->info, NULL); /* copy color settings */ MaterialGPencilStyle *gp_style = ma->gp_style; |