diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/graph.cpp | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 5b81a2ccb9e..4767bbb4806 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -844,29 +844,59 @@ void ShaderGraph::dump_graph(const char *filename) fprintf(fd, "digraph shader_graph {\n"); fprintf(fd, "ranksep=1.5\n"); + fprintf(fd, "rankdir=LR\n"); fprintf(fd, "splines=false\n"); foreach(ShaderNode *node, nodes) { fprintf(fd, "// NODE: %p\n", node); - fprintf(fd, - "\"%p\" [shape=record,label=\"%s\"]\n", - node, - node->name.c_str()); + fprintf(fd, "\"%p\" [shape=record,label=\"{", node); + if(node->inputs.size()) { + fprintf(fd, "{"); + foreach(ShaderInput *socket, node->inputs) { + if(socket != node->inputs[0]) { + fprintf(fd, "|"); + } + fprintf(fd, "<IN_%p>%s", socket, socket->name); + } + fprintf(fd, "}|"); + } + fprintf(fd, "%s", node->name.c_str()); + if(node->bump == SHADER_BUMP_CENTER) { + fprintf(fd, " (bump:center)"); + } + else if(node->bump == SHADER_BUMP_DX) { + fprintf(fd, " (bump:dx)"); + } + else if(node->bump == SHADER_BUMP_DY) { + fprintf(fd, " (bump:dy)"); + } + if(node->outputs.size()) { + fprintf(fd, "|{"); + foreach(ShaderOutput *socket, node->outputs) { + if(socket != node->outputs[0]) { + fprintf(fd, "|"); + } + fprintf(fd, "<OUT_%p>%s", socket, socket->name); + } + fprintf(fd, "}"); + } + fprintf(fd, "}\"]"); } foreach(ShaderNode *node, nodes) { foreach(ShaderOutput *output, node->outputs) { foreach(ShaderInput *input, output->links) { fprintf(fd, - "// CONNECTION: %p->%p (%s:%s)\n", + "// CONNECTION: OUT_%p->IN_%p (%s:%s)\n", output, input, output->name, input->name); fprintf(fd, - "\"%p\":s -> \"%p\":n [label=\"%s:%s\"]\n", + "\"\%p\":\"OUT_%p\":e -> \"%p\":\"IN_%p\":w [label=\"\"]\n", output->parent, + output, input->parent, - output->name, input->name); + input); } } } |