diff options
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 222e0e20dff..270ba2a7947 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -99,7 +99,6 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) { - const WorkSpace *workspace = CTX_wm_workspace(C); Object *ob = ED_object_context(C); if (!ob) @@ -107,7 +106,7 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) BKE_object_material_slot_add(ob); - if (workspace->object_mode & OB_MODE_TEXTURE_PAINT) { + if (ob->mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); @@ -137,7 +136,6 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot) static int material_slot_remove_exec(bContext *C, wmOperator *op) { - const WorkSpace *workspace = CTX_wm_workspace(C); Object *ob = ED_object_context(C); if (!ob) @@ -151,7 +149,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op) BKE_object_material_slot_remove(ob); - if (workspace->object_mode & OB_MODE_TEXTURE_PAINT) { + if (ob->mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); |