Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/graph.cpp
| Show First 20 Lines • Show All 1,082 Lines • ▼ Show 20 Lines | else { | ||||
| /* already has a weight connected to it? add weights */ | /* already has a weight connected to it? add weights */ | ||||
| float weight_value = node->get_float(weight_in->socket_type); | float weight_value = node->get_float(weight_in->socket_type); | ||||
| if (weight_in->link || weight_value != 0.0f) { | if (weight_in->link || weight_value != 0.0f) { | ||||
| MathNode *math_node = new MathNode(); | MathNode *math_node = new MathNode(); | ||||
| add(math_node); | add(math_node); | ||||
| if (weight_in->link) | if (weight_in->link) | ||||
| connect(weight_in->link, math_node->input("Value1")); | connect(weight_in->link, math_node->input("A")); | ||||
| else | else | ||||
| math_node->value1 = weight_value; | math_node->a = weight_value; | ||||
| if (weight_out) | if (weight_out) | ||||
| connect(weight_out, math_node->input("Value2")); | connect(weight_out, math_node->input("B")); | ||||
| else | else | ||||
| math_node->value2 = 1.0f; | math_node->b = 1.0f; | ||||
| weight_out = math_node->output("Value"); | weight_out = math_node->output("Result"); | ||||
| if (weight_in->link) | if (weight_in->link) | ||||
| disconnect(weight_in); | disconnect(weight_in); | ||||
| } | } | ||||
| /* connected to closure mix weight */ | /* connected to closure mix weight */ | ||||
| if (weight_out) | if (weight_out) | ||||
| connect(weight_out, weight_in); | connect(weight_out, weight_in); | ||||
| else | else | ||||
| ▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines | |||||