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-07-16 17:25:37 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-08-12 05:10:27 +0400
commit722951ecebc24063bd6d8e59ded6a61e05bd4b46 (patch)
treeb4f96a0fb6c30f0be861f4b7eb7d87ab30bb2163
parent833353b25e56a36bd890b80e48a313d48f43d549 (diff)
Freestyle: Added "blend_type" and "use_clamp" options to the Output Line Style shader node.
-rw-r--r--source/blender/blenkernel/intern/linestyle.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c15
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp3
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c6
-rw-r--r--source/blender/nodes/NOD_static_types.h2
5 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 2080007075b..1d6790856bb 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -1174,6 +1174,8 @@ void BKE_linestyle_default_shader(const bContext *C, FreestyleLineStyle *linesty
output_linestyle = nodeAddStaticNode(C, ntree, SH_NODE_OUTPUT_LINESTYLE);
output_linestyle->locx = 300.0f;
output_linestyle->locy = 300.0f;
+ output_linestyle->custom1 = MA_RAMP_BLEND;
+ output_linestyle->custom2 = 0; // use_clamp
nodeSetActive(ntree, input_texure);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 6fa9290c732..c517ae753c4 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1000,6 +1000,18 @@ static void node_shader_buts_script_ex(uiLayout *layout, bContext *C, PointerRNA
#endif
}
+static void node_buts_output_linestyle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+{
+ uiLayout *row, *col;
+
+ bNodeTree *ntree = (bNodeTree *)ptr->id.data;
+
+ col = uiLayoutColumn(layout, false);
+ row = uiLayoutRow(col, true);
+ uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
+ uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
+}
+
/* only once called */
static void node_shader_set_butfunc(bNodeType *ntype)
{
@@ -1126,6 +1138,9 @@ static void node_shader_set_butfunc(bNodeType *ntype)
case SH_NODE_UVMAP:
ntype->draw_buttons = node_shader_buts_uvmap;
break;
+ case SH_NODE_OUTPUT_LINESTYLE:
+ ntype->draw_buttons = node_buts_output_linestyle;
+ break;
}
}
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 86bba6fd329..6587680ce5a 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -296,6 +296,9 @@ Material* BlenderStrokeRenderer::GetStrokeShader(bContext *C, Main *bmain, Frees
bNodeSocket *outsock;
bNodeLink *link;
+ color_mix_rgb->custom1 = output_linestyle->custom1; // blend_type
+ color_mix_rgb->custom2 = output_linestyle->custom2; // use_clamp
+
outsock = (bNodeSocket *)BLI_findlink(&output_linestyle->inputs, 0); // Color
tosock = (bNodeSocket *)BLI_findlink(&color_mix_rgb->inputs, 2); // Color2
link = (bNodeLink *)BLI_findptr(&ntree->links, outsock, offsetof(bNodeLink, tosock));
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 8a177c6e2f9..c975f6cfe90 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3172,6 +3172,12 @@ static void def_sh_output(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+static void def_sh_output_linestyle(StructRNA *srna)
+{
+ def_sh_output(srna);
+ def_mix_rgb(srna);
+}
+
static void def_sh_material(StructRNA *srna)
{
PropertyRNA *prop;
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index 4cb3756c2c6..76e309c5bae 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -69,7 +69,7 @@ DefNode( ShaderNode, SH_NODE_HUE_SAT, 0, "HUE_S
DefNode( ShaderNode, SH_NODE_OUTPUT_MATERIAL, def_sh_output, "OUTPUT_MATERIAL", OutputMaterial, "Material Output", "" )
DefNode( ShaderNode, SH_NODE_OUTPUT_LAMP, def_sh_output, "OUTPUT_LAMP", OutputLamp, "Lamp Output", "" )
DefNode( ShaderNode, SH_NODE_OUTPUT_WORLD, def_sh_output, "OUTPUT_WORLD", OutputWorld, "World Output", "" )
-DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output, "OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" )
+DefNode( ShaderNode, SH_NODE_OUTPUT_LINESTYLE, def_sh_output_linestyle,"OUTPUT_LINESTYLE", OutputLineStyle, "Line Style Output", "" )
DefNode( ShaderNode, SH_NODE_FRESNEL, 0, "FRESNEL", Fresnel, "Fresnel", "" )
DefNode( ShaderNode, SH_NODE_LAYER_WEIGHT, 0, "LAYER_WEIGHT", LayerWeight, "Layer Weight", "" )
DefNode( ShaderNode, SH_NODE_MIX_SHADER, 0, "MIX_SHADER", MixShader, "Mix Shader", "" )