Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2015-09-21 13:16:30 +0300
committerLukas Tönne <lukas.toenne@gmail.com>2015-09-21 13:16:30 +0300
commit1ee9c5d6a3a24d733dc7eee8e61b9f37dda65e03 (patch)
treebd99dd25e96513a8663f45d30f308217d0b4cdf5
parentff3c7460e5e0865b63f964f10ffe4f47e627674e (diff)
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
-rw-r--r--source/blender/depsgraph/intern/depsgraph_debug.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 59351495df0..1a266ccb283 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