Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/intern/derived_node_tree.cc
| Show First 20 Lines • Show All 338 Lines • ▼ Show 20 Lines | this->foreach_node([&](DNode node) { | ||||
| } | } | ||||
| dot::Cluster *cluster = get_dot_cluster_for_context(digraph, node.context(), dot_clusters); | dot::Cluster *cluster = get_dot_cluster_for_context(digraph, node.context(), dot_clusters); | ||||
| dot::Node &dot_node = digraph.new_node(""); | dot::Node &dot_node = digraph.new_node(""); | ||||
| dot_node.set_parent_cluster(cluster); | dot_node.set_parent_cluster(cluster); | ||||
| dot_node.set_background_color("white"); | dot_node.set_background_color("white"); | ||||
| Vector<std::string> input_names; | dot::NodeWithSockets dot_node_with_sockets; | ||||
| Vector<std::string> output_names; | |||||
| for (const bNodeSocket *socket : node->input_sockets()) { | for (const bNodeSocket *socket : node->input_sockets()) { | ||||
| if (socket->is_available()) { | if (socket->is_available()) { | ||||
| input_names.append(socket->name); | dot_node_with_sockets.add_input(socket->name); | ||||
| } | } | ||||
| } | } | ||||
| for (const bNodeSocket *socket : node->output_sockets()) { | for (const bNodeSocket *socket : node->output_sockets()) { | ||||
| if (socket->is_available()) { | if (socket->is_available()) { | ||||
| output_names.append(socket->name); | dot_node_with_sockets.add_output(socket->name); | ||||
| } | } | ||||
| } | } | ||||
| dot::NodeWithSocketsRef dot_node_with_sockets = dot::NodeWithSocketsRef( | dot::NodeWithSocketsRef dot_node_with_sockets_ref = dot::NodeWithSocketsRef( | ||||
| dot_node, node->name, input_names, output_names); | dot_node, dot_node_with_sockets); | ||||
| int input_index = 0; | int input_index = 0; | ||||
| for (const bNodeSocket *socket : node->input_sockets()) { | for (const bNodeSocket *socket : node->input_sockets()) { | ||||
| if (socket->is_available()) { | if (socket->is_available()) { | ||||
| dot_input_sockets.add_new(DInputSocket{node.context(), socket}, | dot_input_sockets.add_new(DInputSocket{node.context(), socket}, | ||||
| dot_node_with_sockets.input(input_index)); | dot_node_with_sockets_ref.input(input_index)); | ||||
| input_index++; | input_index++; | ||||
| } | } | ||||
| } | } | ||||
| int output_index = 0; | int output_index = 0; | ||||
| for (const bNodeSocket *socket : node->output_sockets()) { | for (const bNodeSocket *socket : node->output_sockets()) { | ||||
| if (socket->is_available()) { | if (socket->is_available()) { | ||||
| dot_output_sockets.add_new(DOutputSocket{node.context(), socket}, | dot_output_sockets.add_new(DOutputSocket{node.context(), socket}, | ||||
| dot_node_with_sockets.output(output_index)); | dot_node_with_sockets_ref.output(output_index)); | ||||
| output_index++; | output_index++; | ||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||
| /* Floating inputs are used for example to visualize unlinked group node inputs. */ | /* Floating inputs are used for example to visualize unlinked group node inputs. */ | ||||
| Map<DSocket, dot::Node *> dot_floating_inputs; | Map<DSocket, dot::Node *> dot_floating_inputs; | ||||
| Show All 29 Lines | |||||