diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-06-16 17:13:42 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-06-16 17:13:42 +0400 |
commit | a691487ed42796d48892a7a3be072a16bfc7d185 (patch) | |
tree | 5e069b80349066b71f30915e7693e9ebc9e85542 /source/blender/editors/space_buttons/buttons_header.c | |
parent | 29be97975876a1f298f4e6dab14c75aa9956f96a (diff) |
Complete fix for [#35769] The “show texture in texture tab” button in a modifier does not show up until the user manually shows the texture in the Texture tab (and better fix for [#35741] Material shows WORLD texture_context by default).
Simply recompute texture context on every redraw, like already done for sbuts->texuser (also called texture context :/ ).
Also allows simplification, buttons_check_texture_context can be merged back into set_texture_context...
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_header.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_header.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index f9742121e99..44c76d7a9a2 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -59,53 +59,6 @@ #define B_CONTEXT_SWITCH 101 -static void set_texture_context(const bContext *C, SpaceButs *sbuts) -{ - Scene *scene = CTX_data_scene(C); - - if (BKE_scene_use_new_shading_nodes(scene)) { - return; /* No texture context in new shading mode */ - } - - if ((sbuts->mainb == BCONTEXT_WORLD) && ED_texture_context_check_world(C)) { - sbuts->texture_context = SB_TEXC_WORLD; - } - else if ((sbuts->mainb == BCONTEXT_MATERIAL) && ED_texture_context_check_material(C)) { - sbuts->texture_context = SB_TEXC_MATERIAL; - } - else if ((sbuts->mainb == BCONTEXT_DATA) && ED_texture_context_check_lamp(C)) { - sbuts->texture_context = SB_TEXC_LAMP; - } - else if ((sbuts->mainb == BCONTEXT_PARTICLE) && ED_texture_context_check_particles(C)) { - sbuts->texture_context = SB_TEXC_PARTICLES; - } - else if ((ELEM(sbuts->mainb, BCONTEXT_MODIFIER, BCONTEXT_PHYSICS)) && ED_texture_context_check_others(C)) { - sbuts->texture_context = SB_TEXC_OTHER; - } - /* Second pass: sbuts->mainbuser still contains the previous button context. - * Useful e.g. when we switch to material, no material present, add a material, switch to texture. - * See #35741. */ - else if ((sbuts->mainbuser == BCONTEXT_WORLD) && ED_texture_context_check_world(C)) { - sbuts->texture_context = SB_TEXC_WORLD; - } - else if ((sbuts->mainbuser == BCONTEXT_MATERIAL) && ED_texture_context_check_material(C)) { - sbuts->texture_context = SB_TEXC_MATERIAL; - } - else if ((sbuts->mainbuser == BCONTEXT_DATA) && ED_texture_context_check_lamp(C)) { - sbuts->texture_context = SB_TEXC_LAMP; - } - else if ((sbuts->mainbuser == BCONTEXT_PARTICLE) && ED_texture_context_check_particles(C)) { - sbuts->texture_context = SB_TEXC_PARTICLES; - } - else if ((ELEM(sbuts->mainbuser, BCONTEXT_MODIFIER, BCONTEXT_PHYSICS)) && ED_texture_context_check_others(C)) { - sbuts->texture_context = SB_TEXC_OTHER; - } - /* Else, just be sure that current context is valid! */ - else { - buttons_check_texture_context(C, sbuts); - } -} - static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event) { SpaceButs *sbuts = CTX_wm_space_buts(C); @@ -117,8 +70,6 @@ static void do_buttons_buttons(bContext *C, void *UNUSED(arg), int event) case B_CONTEXT_SWITCH: ED_area_tag_redraw(CTX_wm_area(C)); - set_texture_context(C, sbuts); - sbuts->preview = 1; break; } |