From 30f626fe4cd62f406468ef0ff2169694424b1a29 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 27 Oct 2020 11:40:42 +0100 Subject: Revert "Cycles API: encapsulate Node socket members" This reverts commit 527f8b32b32187f754e5b176db6377736f9cb8ff. It is causing motion blur test failures and crashes in some renders, reverting until this is fixed. --- intern/cycles/render/graph.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'intern/cycles/render/graph.cpp') diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 1de48aa8b0d..485d6167ee3 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -273,8 +273,8 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to) if (to->type() == SocketType::CLOSURE) { EmissionNode *emission = create_node(); - emission->set_color(make_float3(1.0f, 1.0f, 1.0f)); - emission->set_strength(1.0f); + emission->color = make_float3(1.0f, 1.0f, 1.0f); + emission->strength = 1.0f; convert = add(emission); /* Connect float inputs to Strength to save an additional Falue->Color conversion. */ if (from->type() == SocketType::FLOAT) { @@ -586,7 +586,7 @@ void ShaderGraph::constant_fold(Scene *scene) */ if (has_displacement && !output()->input("Displacement")->link) { ColorNode *value = (ColorNode *)add(create_node()); - value->set_value(output()->get_displacement()); + value->value = output()->displacement; connect(value->output("Color"), output()->input("Displacement")); } @@ -1003,8 +1003,8 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) /* add bump node and connect copied graphs to it */ BumpNode *bump = (BumpNode *)add(create_node()); - bump->set_use_object_space(use_object_space); - bump->set_distance(1.0f); + bump->use_object_space = use_object_space; + bump->distance = 1.0f; ShaderOutput *out = displacement_in->link; ShaderOutput *out_center = nodes_center[out->parent]->output(out->name()); @@ -1016,9 +1016,9 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) VectorMathNode *dot_dx = (VectorMathNode *)add(create_node()); VectorMathNode *dot_dy = (VectorMathNode *)add(create_node()); - dot_center->set_math_type(NODE_VECTOR_MATH_DOT_PRODUCT); - dot_dx->set_math_type(NODE_VECTOR_MATH_DOT_PRODUCT); - dot_dy->set_math_type(NODE_VECTOR_MATH_DOT_PRODUCT); + dot_center->type = NODE_VECTOR_MATH_DOT_PRODUCT; + dot_dx->type = NODE_VECTOR_MATH_DOT_PRODUCT; + dot_dy->type = NODE_VECTOR_MATH_DOT_PRODUCT; GeometryNode *geom = (GeometryNode *)add(create_node()); connect(geom->output("Normal"), dot_center->input("Vector2")); @@ -1072,7 +1072,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight if (fin->link) connect(fin->link, fac_in); else - mix_node->set_fac(node->get_float(fin->socket_type)); + mix_node->fac = node->get_float(fin->socket_type); if (weight_out) connect(weight_out, weight_in); @@ -1107,12 +1107,12 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight if (weight_in->link) connect(weight_in->link, math_node->input("Value1")); else - math_node->set_value1(weight_value); + math_node->value1 = weight_value; if (weight_out) connect(weight_out, math_node->input("Value2")); else - math_node->set_value2(1.0f); + math_node->value2 = 1.0f; weight_out = math_node->output("Value"); if (weight_in->link) -- cgit v1.2.3