23 int DebugInfo::file_index_ = 0;
26 std::string DebugInfo::current_node_name_;
27 std::string DebugInfo::current_op_name_;
32 std::string full_name =
typeid(*op).name();
34 size_t pos = full_name.find_last_of(
':');
36 return full_name.substr(
pos + 1);
41 NodeNameMap::const_iterator it = node_names_.find(
node);
42 if (it != node_names_.end()) {
50 OpNameMap::const_iterator it = op_names_.find(op);
51 if (it != op_names_.end()) {
65 std::string fillcolor =
"gainsboro";
69 fillcolor =
"lightskyblue1";
72 fillcolor =
"lightskyblue3";
76 fillcolor =
"dodgerblue1";
82 fillcolor =
"darkolivegreen3";
85 fillcolor =
"darkorange";
96 maxlen >
len ? maxlen -
len : 0,
97 " [fillcolor=%s,style=filled,shape=record,label=\"{",
101 if (totinputs != 0) {
103 for (
int k = 0; k < totinputs; k++) {
126 std::string op_node_name = operation->
get_name();
127 if (!op_node_name.empty()) {
129 str +
len, maxlen >
len ? maxlen -
len : 0,
"%s\\n", (op_node_name +
" Node").c_str());
134 maxlen >
len ? maxlen -
len : 0,
139 maxlen >
len ? maxlen -
len : 0,
140 "#%d (%i,%i) (%u,%u)",
148 if (totoutputs != 0) {
151 for (
int k = 0; k < totoutputs; k++) {
193 maxlen >
len ? maxlen -
len : 0,
194 "<TR><TD>%s</TD><TD BGCOLOR=\"%s\"></TD></TR>\r\n",
201 const char * ,
const char * ,
const char * ,
char *
str,
int maxlen)
210 const char *name,
const char *
color,
const char * ,
char *
str,
int maxlen)
214 maxlen >
len ? maxlen -
len : 0,
215 "<TR><TD>%s</TD><TD CELLPADDING=\"4\"><TABLE BORDER=\"1\" CELLBORDER=\"0\" "
216 "CELLSPACING=\"0\" CELLPADDING=\"0\"><TR><TD "
217 "BGCOLOR=\"%s\"></TD></TR></TABLE></TD></TR>\r\n",
228 if (has_execution_groups) {
232 str +
len, maxlen >
len ? maxlen -
len : 0,
"Legend [shape=none, margin=0, label=<\r\n");
236 maxlen >
len ? maxlen -
len : 0,
237 " <TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"4\">\r\n");
239 maxlen >
len ? maxlen -
len : 0,
240 "<TR><TD COLSPAN=\"2\"><B>Legend</B></TD></TR>\r\n");
243 "NodeOperation",
"gainsboro",
str +
len, maxlen >
len ? maxlen -
len : 0);
245 "Output",
"dodgerblue1",
str +
len, maxlen >
len ? maxlen -
len : 0);
247 "Viewer",
"lightskyblue3",
str +
len, maxlen >
len ? maxlen -
len : 0);
249 "Active Viewer",
"lightskyblue1",
str +
len, maxlen >
len ? maxlen -
len : 0);
250 if (has_execution_groups) {
252 "Write Buffer",
"darkorange",
str +
len, maxlen >
len ? maxlen -
len : 0);
254 "Read Buffer",
"darkolivegreen3",
str +
len, maxlen >
len ? maxlen -
len : 0);
257 "Input Value",
"khaki1",
str +
len, maxlen >
len ? maxlen -
len : 0);
259 if (has_execution_groups) {
262 "Group Waiting",
"white",
"dashed",
str +
len, maxlen >
len ? maxlen -
len : 0);
264 "Group Running",
"firebrick1",
"solid",
str +
len, maxlen >
len ? maxlen -
len : 0);
266 "Group Finished",
"chartreuse4",
"solid",
str +
len, maxlen >
len ? maxlen -
len : 0);
286 std::map<NodeOperation *, std::vector<std::string>> op_groups;
292 if (group_states_[group] ==
EG_WAIT) {
295 else if (group_states_[group] ==
EG_RUNNING) {
308 sprintf(strbuf,
"_%p", group);
309 op_groups[operation].push_back(std::string(strbuf));
312 system, operation, group,
str +
len, maxlen >
len ? maxlen -
len : 0);
321 if (op_groups.find(operation) != op_groups.end()) {
325 op_groups[operation].push_back(std::string(
""));
328 system, operation,
nullptr,
str +
len, maxlen >
len ? maxlen -
len : 0);
335 std::vector<std::string> &read_groups = op_groups[read];
336 std::vector<std::string> &write_groups = op_groups[write];
338 for (
int k = 0; k < write_groups.size(); k++) {
339 for (
int l = 0;
l < read_groups.size();
l++) {
341 maxlen >
len ? maxlen -
len : 0,
342 "\"O_%p%s\" -> \"O_%p%s\" [style=dotted]\r\n",
344 write_groups[k].c_str(),
346 read_groups[
l].c_str());
361 switch (
from->get_data_type()) {
375 std::vector<std::string> &from_groups = op_groups[from_op];
376 std::vector<std::string> &to_groups = op_groups[to_op];
379 maxlen >
len ? maxlen -
len : 0,
380 "// CONNECTION: %p.%p -> %p.%p\r\n",
385 for (
int k = 0; k < from_groups.size(); k++) {
386 for (
int l = 0;
l < to_groups.size();
l++) {
388 maxlen >
len ? maxlen -
len : 0,
389 R
"("O_%p%s":"OUT_%p":e -> "O_%p%s":"IN_%p":w)",
391 from_groups[k].c_str(),
394 to_groups[l].c_str(),
406 system->groups_.size() > 0;
411 return (
len < maxlen);
419 const int max_textlength = 1000000;
434 std::cout <<
"Writing compositor debug to: " << filepath <<
"\n";
472 for (
int i = 0; i < file_list_num; i++) {
File and directory operations.
eFileAttributes BLI_file_attributes(const char *path)
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define FILE_ATTR_ANY_LINK
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *file, bool dir, bool recursive) ATTR_NONNULL()
unsigned int BLI_filelist_dir_contents(const char *dir, struct direntry **r_filelist)
void BLI_filelist_free(struct direntry *filelist, unsigned int nrentries)
bool BLI_make_existing_file(const char *name)
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
Contains defines and structs used throughout the imbuf module.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
ATTR_WARN_UNUSED_RESULT const BMLoop * l
constexpr bool is_empty() const
bool is_rendering() const
get the rendering field of the context
eExecutionModel get_execution_model() const
bool can_get_constant_elem() const
virtual const float * get_constant_elem()=0
static std::string node_name(const Node *node)
static int graphviz_operation(const ExecutionSystem *system, NodeOperation *operation, const ExecutionGroup *group, char *str, int maxlen)
static void delete_operation_exports()
static int graphviz_legend(char *str, int maxlen, bool has_execution_groups)
static std::string operation_name(const NodeOperation *op)
static int graphviz_legend_line(const char *name, const char *color, const char *style, char *str, int maxlen)
static bool graphviz_system(const ExecutionSystem *system, char *str, int maxlen)
std::map< const Node *, std::string > NodeNameMap
static void export_operation(const NodeOperation *op, MemoryBuffer *render)
std::map< const NodeOperation *, std::string > OpNameMap
static int graphviz_legend_color(const char *name, const char *color, char *str, int maxlen)
std::map< const ExecutionGroup *, GroupState > GroupStateMap
static void graphviz(const ExecutionSystem *system, StringRefNull name="")
static int graphviz_legend_group(const char *name, const char *color, const char *style, char *str, int maxlen)
Class ExecutionGroup is a group of Operations that are executed as one. This grouping is used to comb...
the ExecutionSystem contains the whole compositor tree.
const CompositorContext & get_context() const
get the reference to the compositor context
a MemoryBuffer contains access to the data of a chunk
void copy_from(const MemoryBuffer *src, const rcti &area)
const rcti & get_rect() const
get the rect of this MemoryBuffer
uint8_t get_num_channels() const
const int get_width() const
get the width of this MemoryBuffer
const int get_height() const
get the height of this MemoryBuffer
WriteBufferOperation * get_write_buffer_operation() const
get the WriteBufferOperation that is responsible for writing to this MemoryProxy
DataType get_data_type() const
NodeOperation contains calculation logic.
unsigned int get_height() const
unsigned int get_number_of_output_sockets() const
virtual bool is_output_operation(bool) const
is_output_operation determines whether this operation is an output of the ExecutionSystem during rend...
const NodeOperationFlags get_flags() const
unsigned int get_number_of_input_sockets() const
unsigned int get_width() const
NodeOperationOutput * get_output_socket(unsigned int index=0)
const rcti & get_canvas() const
NodeOperationInput * get_input_socket(unsigned int index)
const std::string get_name() const
MemoryProxy * get_memory_proxy() const
bool is_active_viewer_output() const override
is this operation the active viewer output user can select an ViewerNode to be active (the result of ...
NodeOperation to write to a tile.
static char * basename(char *string)
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
@ Vector
Vector data type.
void * BKE_tempdir_session
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
static constexpr bool COM_EXPORT_GRAPHVIZ
static std::string get_operations_export_dir()
static std::string operation_class_name(const NodeOperation *op)
static constexpr bool COM_GRAPHVIZ_SHOW_NODE_NAME
std::string to_string(const T &n)
bool is_write_buffer_operation
bool is_constant_operation
bool is_read_buffer_operation