[Bf-blender-cvs] [1ee9c5d] master: Some minor tweaks to depsgraph debug graphviz output.
Lukas Tönne
noreply at git.blender.org
Mon Sep 21 12:19:05 CEST 2015
Commit: 1ee9c5d6a3a24d733dc7eee8e61b9f37dda65e03
Author: Lukas Tönne
Date: Mon Sep 21 12:16:30 2015 +0200
Branches: master
https://developer.blender.org/rB1ee9c5d6a3a24d733dc7eee8e61b9f37dda65e03
Some minor tweaks to depsgraph debug graphviz output.
- Removed relation labels, since these mostly just reflect connected nodes, and also appear too far off the edge lines
- Draw cyclic links in dark red
- Slightly thicker edges and larger margins
===================================================================
M source/blender/depsgraph/intern/depsgraph_debug.cc
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 5935149..1a266cc 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -345,9 +345,11 @@ static void deg_debug_graphviz_node_fillcolor(const DebugContext &ctx,
#endif
static void deg_debug_graphviz_relation_color(const DebugContext &ctx,
- const DepsRelation *UNUSED(rel))
+ const DepsRelation *rel)
{
- const char *defaultcolor = "black";
+ const char *color_default = "black";
+ const char *color_error = "red4";
+ const char *color = color_default;
#if 0 /* disabled for now, edge colors are hardly distinguishable */
int color = deg_debug_relation_type_color_index(rel->type);
if (color < 0) {
@@ -357,7 +359,10 @@ static void deg_debug_graphviz_relation_color(const DebugContext &ctx,
deg_debug_fprintf(ctx, "\"%s\"", deg_debug_colors_dark[color % deg_debug_max_colors]);
}
#else
- deg_debug_fprintf(ctx, "%s", defaultcolor);
+ if (rel->flag & DEPSREL_FLAG_CYCLIC)
+ color = color_error;
+
+ deg_debug_fprintf(ctx, "%s", color);
#endif
}
@@ -439,6 +444,7 @@ static void deg_debug_graphviz_node_cluster_begin(const DebugContext &ctx,
deg_debug_fprintf(ctx, "label=<%s>;" NL, name.c_str());
deg_debug_fprintf(ctx, "fontname=\"%s\";" NL, deg_debug_graphviz_fontname);
deg_debug_fprintf(ctx, "fontsize=%f;" NL, deg_debug_graphviz_node_label_size);
+ deg_debug_fprintf(ctx, "margin=\"%d\";" NL, 16);
deg_debug_fprintf(ctx, "style="); deg_debug_graphviz_node_style(ctx, node); deg_debug_fprintf(ctx, ";" NL);
deg_debug_fprintf(ctx, "color="); deg_debug_graphviz_node_color(ctx, node); deg_debug_fprintf(ctx, ";" NL);
deg_debug_fprintf(ctx, "fillcolor="); deg_debug_graphviz_node_fillcolor(ctx, node); deg_debug_fprintf(ctx, ";" NL);
@@ -592,6 +598,8 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx,
{
DEPSNODE_RELATIONS_ITER_BEGIN(node->inlinks, rel)
{
+ float penwidth = 2.0f;
+
const DepsNode *tail = rel->to; /* same as node */
const DepsNode *head = rel->from;
deg_debug_fprintf(ctx, "// %s -> %s\n",
@@ -602,9 +610,20 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx,
deg_debug_fprintf(ctx, "\"node_%p\"", tail);
deg_debug_fprintf(ctx, "[");
+ /* XXX labels on relations are not very helpful:
+ * - they tend to appear too far away to be associated with the edge lines
+ * - names are mostly redundant, reflecting simply their from/to nodes
+ * - no behavior or typing of relations themselves to justify labels
+ */
+#if 0
deg_debug_fprintf(ctx, "label=\"%s\"", rel->name);
deg_debug_fprintf(ctx, ",fontname=\"%s\"", deg_debug_graphviz_fontname);
+#else
+ /* Note: some dummy label seems to be necessary or dot gets confused for some reason ... */
+ deg_debug_fprintf(ctx, "label=\" \"");
+#endif
deg_debug_fprintf(ctx, ",color="); deg_debug_graphviz_relation_color(ctx, rel);
+ deg_debug_fprintf(ctx, ",penwidth=\"%f\"", penwidth);
/* NOTE: edge from node to own cluster is not possible and gives graphviz
* warning, avoid this here by just linking directly to the invisible
* placeholder node
More information about the Bf-blender-cvs
mailing list