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
path: root/intern
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-02-13 23:37:21 +0400
committerThomas Dinges <blender@dingto.org>2014-02-13 23:37:41 +0400
commit0da132198521fab0c5c03fbd9a6ac759121ae7b4 (patch)
tree234d975cf3f8d85e92736a7e61fe8b47e7e6a1a6 /intern
parent727ef0dfdeecc45d9e9a14c2fbff3cfd47bf2841 (diff)
Cycles Standalone: More updates for the Node XML API.
Should be almost complete now, apart from Ramp Nodes (Color Ramp, RGB Curves...).
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/app/cycles_xml.cpp58
-rw-r--r--intern/cycles/render/nodes.cpp3
2 files changed, 54 insertions, 7 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index efd7e5ec66e..14fe43115d5 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -369,6 +369,10 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_string(&img->filename, node, "src");
img->filename = path_join(state.base, img->filename);
+
+ xml_read_enum(&img->color_space, ImageTextureNode::color_space_enum, node, "color_space");
+ xml_read_enum(&img->projection, ImageTextureNode::projection_enum, node, "projection");
+ xml_read_float(&img->projection_blend, node, "projection_blend");
snode = img;
}
@@ -377,6 +381,9 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_string(&env->filename, node, "src");
env->filename = path_join(state.base, env->filename);
+
+ xml_read_enum(&env->color_space, EnvironmentTextureNode::color_space_enum, node, "color_space");
+ xml_read_enum(&env->projection, EnvironmentTextureNode::projection_enum, node, "projection");
snode = env;
}
@@ -423,7 +430,14 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
snode = new CheckerTextureNode();
}
else if(string_iequals(node.name(), "brick_texture")) {
- snode = new BrickTextureNode();
+ BrickTextureNode *brick = new BrickTextureNode();
+
+ xml_read_float(&brick->offset, node, "offset");
+ xml_read_int(&brick->offset_frequency, node, "offset_frequency");
+ xml_read_float(&brick->squash, node, "squash");
+ xml_read_int(&brick->squash_frequency, node, "squash_frequency");
+
+ snode = brick;
}
else if(string_iequals(node.name(), "gradient_texture")) {
GradientTextureNode *blend = new GradientTextureNode();
@@ -455,7 +469,9 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
snode = wave;
}
else if(string_iequals(node.name(), "normal")) {
- snode = new NormalNode();
+ NormalNode *normal = new NormalNode();
+ xml_read_float3(&normal->direction, node, "direction");
+ snode = normal;
}
else if(string_iequals(node.name(), "mapping")) {
snode = new MappingNode();
@@ -495,6 +511,11 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_enum(&diel->distribution, RefractionBsdfNode::distribution_enum, node, "distribution");
snode = diel;
}
+ else if(string_iequals(node.name(), "hair_bsdf")) {
+ HairBsdfNode *hair = new HairBsdfNode();
+ xml_read_enum(&hair->component, HairBsdfNode::component_enum, node, "component");
+ snode = hair;
+ }
else if(string_iequals(node.name(), "emission")) {
EmissionNode *emission = new EmissionNode();
xml_read_bool(&emission->total_power, node, "total_power");
@@ -523,12 +544,21 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
else if(string_iequals(node.name(), "texture_coordinate")) {
snode = new TextureCoordinateNode();
}
- else if(string_iequals(node.name(), "lightPath")) {
+ else if(string_iequals(node.name(), "light_path")) {
snode = new LightPathNode();
}
- else if(string_iequals(node.name(), "lightFalloff")) {
+ else if(string_iequals(node.name(), "light_falloff")) {
snode = new LightFalloffNode();
}
+ else if(string_iequals(node.name(), "object_info")) {
+ snode = new ObjectInfoNode();
+ }
+ else if(string_iequals(node.name(), "particle_info")) {
+ snode = new ParticleInfoNode();
+ }
+ else if(string_iequals(node.name(), "hair_info")) {
+ snode = new HairInfoNode();
+ }
else if(string_iequals(node.name(), "value")) {
ValueNode *value = new ValueNode();
xml_read_float(&value->value, node, "value");
@@ -600,6 +630,19 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_bool(&wire->use_pixel_size, node, "use_pixel_size");
snode = wire;
}
+ else if(string_iequals(node.name(), "normal_map")) {
+ NormalMapNode *nmap = new NormalMapNode;
+ xml_read_ustring(&nmap->attribute, node, "attribute");
+ xml_read_enum(&nmap->space, NormalMapNode::space_enum, node, "space");
+ snode = nmap;
+ }
+ else if(string_iequals(node.name(), "tangent")) {
+ TangentNode *tangent = new TangentNode;
+ xml_read_ustring(&tangent->attribute, node, "attribute");
+ xml_read_enum(&tangent->direction_type, TangentNode::direction_type_enum, node, "direction_type");
+ xml_read_enum(&tangent->axis, TangentNode::axis_enum, node, "axis");
+ snode = tangent;
+ }
else if(string_iequals(node.name(), "math")) {
MathNode *math = new MathNode();
xml_read_enum(&math->type, MathNode::type_enum, node, "type");
@@ -611,6 +654,13 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_enum(&vmath->type, VectorMathNode::type_enum, node, "type");
snode = vmath;
}
+ else if(string_iequals(node.name(), "vector_transform")) {
+ VectorTransformNode *vtransform = new VectorTransformNode();
+ xml_read_enum(&vtransform->type, VectorTransformNode::type_enum, node, "type");
+ xml_read_enum(&vtransform->convert_from, VectorTransformNode::convert_space_enum, node, "convert_from");
+ xml_read_enum(&vtransform->convert_to, VectorTransformNode::convert_space_enum, node, "convert_to");
+ snode = vtransform;
+ }
else if(string_iequals(node.name(), "connect")) {
/* connect nodes */
vector<string> from_tokens, to_tokens;
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 7bd370f6b26..af6fca29ab0 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2041,7 +2041,6 @@ static ShaderEnum hair_component_init()
enm.insert("Reflection", CLOSURE_BSDF_HAIR_REFLECTION_ID);
enm.insert("Transmission", CLOSURE_BSDF_HAIR_TRANSMISSION_ID);
-
return enm;
}
@@ -2055,7 +2054,6 @@ HairBsdfNode::HairBsdfNode()
add_input("Offset", SHADER_SOCKET_FLOAT);
add_input("RoughnessU", SHADER_SOCKET_FLOAT);
add_input("RoughnessV", SHADER_SOCKET_FLOAT);
-
}
void HairBsdfNode::compile(SVMCompiler& compiler)
@@ -2070,7 +2068,6 @@ void HairBsdfNode::compile(OSLCompiler& compiler)
compiler.parameter("component", component);
compiler.add(this, "node_hair_bsdf");
-
}
/* Geometry */