[Bf-blender-cvs] [e457dfe] master: Freestyle: Updated BKE_linestyle_default_shader() to include the UV Along Stroke shader node.
Tamito Kajiyama
noreply at git.blender.org
Tue Aug 12 03:18:08 CEST 2014
Commit: e457dfec32410fb65dcec2300041cb9fe26c9ec8
Author: Tamito Kajiyama
Date: Sun Jul 20 12:17:22 2014 +0900
Branches: master
https://developer.blender.org/rBe457dfec32410fb65dcec2300041cb9fe26c9ec8
Freestyle: Updated BKE_linestyle_default_shader() to include the UV Along Stroke shader node.
===================================================================
M source/blender/blenkernel/intern/linestyle.c
===================================================================
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index f0c582d..8fa6a30 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);
More information about the Bf-blender-cvs
mailing list