diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-07-20 07:17:22 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-08-12 05:10:41 +0400 |
commit | e457dfec32410fb65dcec2300041cb9fe26c9ec8 (patch) | |
tree | f37b3e6bc73a6b149d07a6579a9755c0b9b13fbf /source/blender/blenkernel/intern/linestyle.c | |
parent | 52d357a0b5f87e531a2860c2a97d2edb37c946ab (diff) |
Freestyle: Updated BKE_linestyle_default_shader() to include the UV Along Stroke shader node.
Diffstat (limited to 'source/blender/blenkernel/intern/linestyle.c')
-rw-r--r-- | source/blender/blenkernel/intern/linestyle.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c index f0c582d3485..8fa6a301ebf 100644 --- a/source/blender/blenkernel/intern/linestyle.c +++ b/source/blender/blenkernel/intern/linestyle.c @@ -1178,28 +1178,37 @@ bool BKE_linestyle_use_textures(FreestyleLineStyle *linestyle, const bool use_sh void BKE_linestyle_default_shader(const bContext *C, FreestyleLineStyle *linestyle) { Scene *scene = CTX_data_scene(C); - bNode *input_texure, *output_linestyle; + bNode *uv_along_stroke, *input_texure, *output_linestyle; bNodeSocket *fromsock, *tosock; bNodeTree *ntree; BLI_assert(linestyle->nodetree == NULL); - ntree = ntreeAddTree(NULL, "default_shader", "ShaderNodeTree"); + ntree = ntreeAddTree(NULL, "stroke_shader", "ShaderNodeTree"); linestyle->nodetree = ntree; + uv_along_stroke = nodeAddStaticNode(C, ntree, SH_NODE_UVALONGSTROKE); + uv_along_stroke->locx = 0.0f; + uv_along_stroke->locy = 300.0f; + uv_along_stroke->custom1 = 0; // use_tips + input_texure = nodeAddStaticNode(C, ntree, SH_NODE_TEX_IMAGE); - input_texure->locx = 10.0f; + input_texure->locx = 200.0f; input_texure->locy = 300.0f; output_linestyle = nodeAddStaticNode(C, ntree, SH_NODE_OUTPUT_LINESTYLE); - output_linestyle->locx = 300.0f; + output_linestyle->locx = 400.0f; output_linestyle->locy = 300.0f; output_linestyle->custom1 = MA_RAMP_BLEND; output_linestyle->custom2 = 0; // use_clamp nodeSetActive(ntree, input_texure); + fromsock = (bNodeSocket *)BLI_findlink(&uv_along_stroke->outputs, 0); // UV + tosock = (bNodeSocket *)BLI_findlink(&input_texure->inputs, 0); // UV + nodeAddLink(ntree, uv_along_stroke, fromsock, input_texure, tosock); + fromsock = (bNodeSocket *)BLI_findlink(&input_texure->outputs, 0); // Color tosock = (bNodeSocket *)BLI_findlink(&output_linestyle->inputs, 0); // Color nodeAddLink(ntree, input_texure, fromsock, output_linestyle, tosock); |