Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.c
| Context not available. | |||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_paint.h" | |||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_texture.h" | #include "BKE_texture.h" | ||||
| Context not available. | |||||
| if (!ob) | if (!ob) | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| object_add_material_slot(ob); | |||||
| if (ob->mode & OB_MODE_TEXTURE_PAINT) { | object_add_material_slot(ob); | ||||
| 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); | |||||
| } | |||||
| WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob); | ||||
| WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, ob); | WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_PREVIEW, ob); | ||||
| Context not available. | |||||
| BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode"); | BKE_report(op->reports, RPT_ERROR, "Unable to remove material slot in edit mode"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| object_remove_material_slot(ob); | |||||
| if (ob->mode & OB_MODE_TEXTURE_PAINT) { | object_remove_material_slot(ob); | ||||
| 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); | |||||
| } | |||||
| DAG_id_tag_update(&ob->id, OB_RECALC_DATA); | DAG_id_tag_update(&ob->id, OB_RECALC_DATA); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob); | WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob); | ||||
| Context not available. | |||||