diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index f49a7383715..762288acfab 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -4263,20 +4263,15 @@ static int background_image_remove_exec(bContext *C, wmOperator *op) BGpic *bgpic_rem = BLI_findlink(&v3d->bgpicbase, index); if (bgpic_rem) { - ED_view3D_background_image_remove(v3d, bgpic_rem); - if (bgpic_rem->source == V3D_BGPIC_IMAGE) { - Image *ima = bgpic_rem->ima; - if (ima) { - id_us_min(&ima->id); - } + id_us_min((ID *)bgpic_rem->ima); } else if (bgpic_rem->source == V3D_BGPIC_MOVIE) { - MovieClip *clip = bgpic_rem->clip; - if (clip) { - id_us_min(&clip->id); - } + id_us_min((ID *)bgpic_rem->clip); } + + ED_view3D_background_image_remove(v3d, bgpic_rem); + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); return OPERATOR_FINISHED; } |