diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-11-30 01:05:18 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-11-30 01:05:18 +0400 |
commit | 5763e6ce8518bf878aa9212b5196fd0503f466d2 (patch) | |
tree | 0b30ff5bf4879b5cc92471dd4aa046c039da5294 /source/blender | |
parent | 8bff75697446a98d42a643aa8f65fa663d967765 (diff) |
option to disable/enable individual background images
*** use-case:
"I have 10 reference images that overlap each other and every time I want to see one, I need to change the transparency of all the others.
therefore it would be nice to have a little button by each menu to allow enable/disabling individual background images"
To avoid subversioning bump I created a define that is negative (DISABLED) and of course a rna that is a boolean_negative.
Talked with Campbell and he actually prefers this way over do_version, so there it goes.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 5dfb9cfb5b6..9899d2e5fa4 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1506,6 +1506,10 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) (bgpic->view & (1<<rv3d->view)) || /* check agaist flags */ (rv3d->persp==RV3D_CAMOB && bgpic->view == (1<<RV3D_VIEW_CAMERA)) ) { + /* disable individual images */ + if((bgpic->flag&V3D_BGPIC_DISABLED)) + continue; + freeibuf= NULL; if(bgpic->source==V3D_BGPIC_IMAGE) { ima= bgpic->ima; diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 93f4b209712..50136fdcc99 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -308,6 +308,7 @@ typedef struct View3D { /* may want to use 1 for select ?*/ #define V3D_BGPIC_EXPANDED 2 #define V3D_BGPIC_CAMERACLIP 4 +#define V3D_BGPIC_DISABLED 8 /* BGPic->source */ /* may want to use 1 for select ?*/ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 495a83f4bbe..02eaddaecb6 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1311,6 +1311,11 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_BGPIC_CAMERACLIP); RNA_def_property_ui_text(prop, "Camera Clip", "Use movie clip from active scene camera"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + + prop= RNA_def_property(srna, "show_background_image", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_BGPIC_DISABLED); + RNA_def_property_ui_text(prop, "Show Background Image", "Show this image as background"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_backgroundImages(BlenderRNA *brna, PropertyRNA *cprop) |