Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_vertex.c
| Show First 20 Lines • Show All 1,403 Lines • ▼ Show 20 Lines | static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op) | ||||
| * should re-deform). | * should re-deform). | ||||
| */ | */ | ||||
| DEG_id_tag_update(&me->id, 0); | DEG_id_tag_update(&me->id, 0); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); | WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); | ||||
| WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); | WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); | ||||
| WM_toolsystem_update_from_context_view3d(C); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static bool paint_mode_toggle_poll_test(bContext *C) | static bool paint_mode_toggle_poll_test(bContext *C) | ||||
| { | { | ||||
| Object *ob = CTX_data_active_object(C); | Object *ob = CTX_data_active_object(C); | ||||
| if (ob == NULL || ob->type != OB_MESH) { | if (ob == NULL || ob->type != OB_MESH) { | ||||
| return false; | return false; | ||||
| ▲ Show 20 Lines • Show All 1,210 Lines • ▼ Show 20 Lines | static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op) | ||||
| /* update modifier stack for mapping requirements */ | /* update modifier stack for mapping requirements */ | ||||
| DEG_id_tag_update(&me->id, 0); | DEG_id_tag_update(&me->id, 0); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); | WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); | ||||
| WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); | WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); | ||||
| WM_toolsystem_update_from_context_view3d(C); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot) | void PAINT_OT_vertex_paint_toggle(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Vertex Paint Mode"; | ot->name = "Vertex Paint Mode"; | ||||
| ot->idname = "PAINT_OT_vertex_paint_toggle"; | ot->idname = "PAINT_OT_vertex_paint_toggle"; | ||||
| ▲ Show 20 Lines • Show All 883 Lines • Show Last 20 Lines | |||||