Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_outliner/outliner_dragdrop.c
| Show First 20 Lines • Show All 635 Lines • ▼ Show 20 Lines | static int material_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) | ||||
| /* only drop grease pencil material on grease pencil objects */ | /* only drop grease pencil material on grease pencil objects */ | ||||
| if ((ma->gp_style != NULL) && (ob->type != OB_GPENCIL)) { | if ((ma->gp_style != NULL) && (ob->type != OB_GPENCIL)) { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| BKE_object_material_assign(bmain, ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); | BKE_object_material_assign(bmain, ob, ma, ob->totcol + 1, BKE_MAT_ASSIGN_USERPREF); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_OB_SHADING, ob); | |||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); | WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, CTX_wm_view3d(C)); | ||||
| WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma); | WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, ma); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void OUTLINER_OT_material_drop(wmOperatorType *ot) | void OUTLINER_OT_material_drop(wmOperatorType *ot) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 854 Lines • Show Last 20 Lines | |||||