Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_edit.c
| Show First 20 Lines • Show All 4,655 Lines • ▼ Show 20 Lines | static int background_image_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) | ||||
| /* may be NULL, continue anyway */ | /* may be NULL, continue anyway */ | ||||
| bgpic = BKE_camera_background_image_new(cam); | bgpic = BKE_camera_background_image_new(cam); | ||||
| bgpic->ima = ima; | bgpic->ima = ima; | ||||
| cam->flag |= CAM_SHOW_BG_IMAGE; | cam->flag |= CAM_SHOW_BG_IMAGE; | ||||
| WM_event_add_notifier(C, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, cam); | WM_event_add_notifier(C, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, cam); | ||||
| DEG_id_tag_update(&cam->id, ID_RECALC_COPY_ON_WRITE); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| static bool background_image_add_poll(bContext *C) | static bool background_image_add_poll(bContext *C) | ||||
| { | { | ||||
| return background_image_camera_from_context(C) != NULL; | return background_image_camera_from_context(C) != NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | if (bgpic_rem) { | ||||
| } | } | ||||
| else if (bgpic_rem->source == CAM_BGIMG_SOURCE_MOVIE) { | else if (bgpic_rem->source == CAM_BGIMG_SOURCE_MOVIE) { | ||||
| id_us_min((ID *)bgpic_rem->clip); | id_us_min((ID *)bgpic_rem->clip); | ||||
| } | } | ||||
| BKE_camera_background_image_remove(cam, bgpic_rem); | BKE_camera_background_image_remove(cam, bgpic_rem); | ||||
| WM_event_add_notifier(C, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, cam); | WM_event_add_notifier(C, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, cam); | ||||
| DEG_id_tag_update(&cam->id, ID_RECALC_COPY_ON_WRITE); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| else { | else { | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| } | } | ||||
| void VIEW3D_OT_background_image_remove(wmOperatorType *ot) | void VIEW3D_OT_background_image_remove(wmOperatorType *ot) | ||||
| ▲ Show 20 Lines • Show All 502 Lines • Show Last 20 Lines | |||||