[Bf-blender-cvs] [a6101cd] master: Cycles XML API: * Add Bump and Holdout Node * Add todo comments for various things. * SSS falloff now works.

Thomas Dinges noreply at git.blender.org
Mon Jun 1 16:57:09 CEST 2015


Commit: a6101cde06e433a45f3d7ff13bf745a442c4fecf
Author: Thomas Dinges
Date:   Thu May 21 21:56:42 2015 +0200
Branches: master
https://developer.blender.org/rBa6101cde06e433a45f3d7ff13bf745a442c4fecf

Cycles XML API: * Add Bump and Holdout Node * Add todo comments for various things. * SSS falloff now works.

===================================================================

M	intern/cycles/app/cycles_xml.cpp

===================================================================

diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 53262b9..eee6439 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -391,6 +391,10 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 	for(pugi::xml_node node = graph_node.first_child(); node; node = node.next_sibling()) {
 		ShaderNode *snode = NULL;
 
+		/* ToDo: Add missing nodes
+		 * RGBCurvesNode, VectorCurvesNode, RGBRampNode and ConvertNode (RGB -> BW).
+		 */
+
 		if(string_iequals(node.name(), "image_texture")) {
 			ImageTextureNode *img = new ImageTextureNode();
 
@@ -401,6 +405,8 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 			xml_read_enum(&img->projection, ImageTextureNode::projection_enum, node, "projection");
 			xml_read_float(&img->projection_blend, node, "projection_blend");
 
+			/* ToDo: Interpolation */
+
 			snode = img;
 		}
 		else if(string_iequals(node.name(), "environment_texture")) {
@@ -513,6 +519,11 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 			xml_read_float3(&normal->direction, node, "direction");
 			snode = normal;
 		}
+		else if(string_iequals(node.name(), "bump")) {
+			BumpNode *bump = new BumpNode();
+			xml_read_bool(&bump->invert, node, "invert");
+			snode = bump;
+		}
 		else if(string_iequals(node.name(), "mapping")) {
 			snode = new MappingNode();
 		}
@@ -567,6 +578,9 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 		else if(string_iequals(node.name(), "background")) {
 			snode = new BackgroundNode();
 		}
+		else if(string_iequals(node.name(), "holdout")) {
+			snode = new HoldoutNode();
+		}
 		else if(string_iequals(node.name(), "absorption_volume")) {
 			snode = new AbsorptionVolumeNode();
 		}
@@ -575,7 +589,14 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 		}
 		else if(string_iequals(node.name(), "subsurface_scattering")) {
 			SubsurfaceScatteringNode *sss = new SubsurfaceScatteringNode();
-			//xml_read_enum(&sss->falloff, SubsurfaceScatteringNode::falloff_enum, node, "falloff");
+
+			string falloff;
+			xml_read_string(&falloff, node, "falloff");
+			if(falloff == "cubic")
+				sss->closure = CLOSURE_BSSRDF_CUBIC_ID;
+			else
+				sss->closure = CLOSURE_BSSRDF_GAUSSIAN_ID;
+
 			snode = sss;
 		}
 		else if(string_iequals(node.name(), "geometry")) {
@@ -619,6 +640,7 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
 			snode = new InvertNode();
 		}
 		else if(string_iequals(node.name(), "mix")) {
+			/* ToDo: Tag Mix case for optimization */
 			MixNode *mix = new MixNode();
 			xml_read_enum(&mix->type, MixNode::type_enum, node, "type");
 			xml_read_bool(&mix->use_clamp, node, "use_clamp");




More information about the Bf-blender-cvs mailing list