From 7b48e04b6e5949c87d37cb0a425ab1067c770d8c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 24 Jan 2019 19:05:45 +0100 Subject: Fix T59650: adding texture paint slot image shows wrong color. --- source/blender/editors/sculpt_paint/paint_image_proj.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index c6584a01c17..80133db906e 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -6083,8 +6083,12 @@ static void get_default_texture_layer_name_for_object(Object *ob, int texture_ty static int texture_paint_add_texture_paint_slot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { + /* Get material and default color to display in the popup. */ Object *ob = ED_object_active_context(C); + Material *ma = get_or_create_current_material(C, ob); + int type = get_texture_layer_type(op, "type"); + proj_paint_default_color(op, type, ma); char imagename[MAX_ID_NAME - 2]; get_default_texture_layer_name_for_object(ob, type, (char *)&imagename, sizeof(imagename)); -- cgit v1.2.3