diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-05 14:53:13 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-06 11:58:57 +0400 |
commit | a6f92cd29ad4585745dc0bb420cb79f1b97aeb1e (patch) | |
tree | 1935fbe4ba6eb14d5525e2a19cb4b968623c3654 /source/blender/editors/space_buttons | |
parent | fd7f5c423070f52d023e1c403c5c2543ec7fa3a6 (diff) |
Freestyle: added more conditions to be able to switch to the line style texture properties context.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 20 |
2 files changed, 26 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 4b37ac6b281..a00aac12fba 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -525,12 +525,20 @@ static int buttons_context_path_texture(ButsContextPath *path, ButsContextTextur static bool buttons_context_linestyle_pinnable(const bContext *C) { Scene *scene = CTX_data_scene(C); + SceneRenderLayer *actsrl; + FreestyleConfig *config; SpaceButs *sbuts; /* if Freestyle is disabled in the scene */ if ((scene->r.mode & R_EDGE_FRS) == 0) { return false; } + /* if Freestyle is not in the Parameter Editor mode */ + actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay); + config = &actsrl->freestyleConfig; + if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) { + return false; + } /* if the scene has already been pinned */ sbuts = CTX_wm_space_buts(C); if (sbuts->pinid && sbuts->pinid == &scene->id) { diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 4ba0ddaed50..7fb2d0fd538 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -61,6 +61,7 @@ #include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_scene.h" +#include "BKE_freestyle.h" #include "RNA_access.h" @@ -104,8 +105,23 @@ bool ED_texture_context_check_particles(const bContext *C) bool ED_texture_context_check_linestyle(const bContext *C) { Scene *scene = CTX_data_scene(C); - FreestyleLineStyle *ls = CTX_data_linestyle_from_scene(scene); - return (scene && (scene->r.mode & R_EDGE_FRS) && ls && (ls->flag & LS_TEXTURE)); + SceneRenderLayer *actsrl; + FreestyleConfig *config; + FreestyleLineSet *lineset; + FreestyleLineStyle *linestyle; + + if (scene && (scene->r.mode & R_EDGE_FRS)) { + actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay); + config = &actsrl->freestyleConfig; + if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) { + lineset = BKE_freestyle_lineset_get_active(config); + if (lineset) { + linestyle = lineset->linestyle; + return linestyle && (linestyle->flag & LS_TEXTURE); + } + } + } + return false; } static void texture_context_check_modifier_foreach(void *userData, Object *UNUSED(ob), ModifierData *UNUSED(md), |