diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-19 06:48:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-19 06:48:09 +0400 |
commit | 822d6ae037e0cce734916e88ed00fdbd811edae1 (patch) | |
tree | c3b37852984d864edae79696023a5bf1d6b2fd65 /source/blender/makesrna/intern/rna_space.c | |
parent | f3613be1fbfd764d829188b56ac17a3987161a77 (diff) |
- rename MovieTrackingMarker.enabled --> mute, to match constraints/nla/fcurves/sequencer
- report an error if an invalid BGpic arg is given to v3d.background_images.remove()
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 393ffa69cbc..a33622cf8a1 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -900,11 +900,15 @@ static BGpic *rna_BackgroundImage_new(View3D *v3d) return bgpic; } -static void rna_BackgroundImage_remove(View3D *v3d, BGpic *bgpic) +static void rna_BackgroundImage_remove(View3D *v3d, ReportList *reports, BGpic *bgpic) { - ED_view3D_background_image_remove(v3d, bgpic); - - WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + if (BLI_findindex(&v3d->bgpicbase, bgpic) == -1) { + BKE_report(reports, RPT_ERROR, "BackgroundImage can't be removed"); + } + else { + ED_view3D_background_image_remove(v3d, bgpic); + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D, v3d); + } } /* Space Node Editor */ @@ -1321,6 +1325,7 @@ static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "rna_BackgroundImage_remove"); RNA_def_function_ui_description(func, "Remove background image"); + RNA_def_function_flag(func, FUNC_USE_REPORTS); parm= RNA_def_pointer(func, "image", "BackgroundImage", "", "Image displayed as viewport background"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); } |