Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-05-05 14:53:13 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-05-06 11:58:57 +0400
commita6f92cd29ad4585745dc0bb420cb79f1b97aeb1e (patch)
tree1935fbe4ba6eb14d5525e2a19cb4b968623c3654 /source/blender/editors/space_buttons/buttons_texture.c
parentfd7f5c423070f52d023e1c403c5c2543ec7fa3a6 (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/buttons_texture.c')
-rw-r--r--source/blender/editors/space_buttons/buttons_texture.c20
1 files changed, 18 insertions, 2 deletions
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),