Files
test/source/blender/depsgraph/DEG_depsgraph_debug.hh
Jacques Lucke 54a13d462f Debug: support getting dot graphs from Python
This allows building tools that simplify Blender core development.

The depsgraph already exposed the dot graph using the `debug_relations_graphviz`
method. This has been extended to return the data as a string. The filepath is
optional now.

Similar functions have been added for node trees. Note that these should be used
on evaluated node trees.
2024-09-14 17:10:33 +02:00

68 lines
2.1 KiB
C++

/* SPDX-FileCopyrightText: 2014 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup depsgraph
*
* Public API for Querying and Filtering Depsgraph
*/
#pragma once
#include <cstdio>
#include "BLI_string_ref.hh"
struct Depsgraph;
struct Main;
struct Scene;
struct ViewLayer;
/* ------------------------------------------------ */
/* NOTE: Those flags are same bit-mask as #G.debug_flags */
void DEG_debug_flags_set(Depsgraph *depsgraph, int flags);
int DEG_debug_flags_get(const Depsgraph *depsgraph);
void DEG_debug_name_set(Depsgraph *depsgraph, const char *name);
const char *DEG_debug_name_get(Depsgraph *depsgraph);
/* ------------------------------------------------ */
/**
* Obtain simple statistics about the complexity of the depsgraph.
* \param[out] r_outer: The number of outer nodes in the graph.
* \param[out] r_operations: The number of operation nodes in the graph.
* \param[out] r_relations: The number of relations between (executable) nodes in the graph.
*/
void DEG_stats_simple(const Depsgraph *graph,
size_t *r_outer,
size_t *r_operations,
size_t *r_relations);
/* ************************************************ */
/* Diagram-Based Graph Debugging */
std::string DEG_debug_graph_to_dot(const Depsgraph &graph, blender::StringRef label);
void DEG_debug_stats_gnuplot(const Depsgraph *graph,
FILE *fp,
const char *label,
const char *output_filename);
/* ************************************************ */
/** Compare two dependency graphs. */
bool DEG_debug_compare(const Depsgraph *graph1, const Depsgraph *graph2);
/** Check that dependencies in the graph are really up to date. */
bool DEG_debug_graph_relations_validate(Depsgraph *graph,
Main *bmain,
Scene *scene,
ViewLayer *view_layer);
/** Perform consistency check on the graph. */
bool DEG_debug_consistency_check(Depsgraph *graph);