diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-24 13:56:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-24 16:39:09 +0300 |
commit | a028575c4a613b5d87ec26434f8c846c60861cfe (patch) | |
tree | c3329089d9a357d9dc0ee81d6845e0fccbef3a68 /source/blender/nodes | |
parent | 54e6413d672ffab49f2c8e04382389a9f5b5e706 (diff) |
Compositor: Allow using debug pass output in the compositor
Currently only works correct with single float output, RGBA and vector are not
supported so if one need to use this passes he'll need to wait a bit still.
It is coming, don't worry.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/nodes/SConscript | 3 | ||||
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_image.c | 17 |
3 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 3fd1241f3fa..13dede8877a 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -288,4 +288,8 @@ if(WITH_FREESTYLE) add_definitions(-DWITH_FREESTYLE) endif() +if(WITH_CYCLES AND WITH_CYCLES_DEBUG) + add_definitions(-DWITH_CYCLES_DEBUG) +endif() + blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript index aed846355c3..9c2cc825f14 100644 --- a/source/blender/nodes/SConscript +++ b/source/blender/nodes/SConscript @@ -75,6 +75,9 @@ if env['WITH_BF_COMPOSITOR']: if env['WITH_BF_FREESTYLE']: defs.append('WITH_FREESTYLE') +if env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_DEBUG']: + defs.append('WITH_CYCLES_DEBUG') + env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [190,105] ) env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] ) env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] ) diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 19e93447608..1985037c5ce 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -73,6 +73,9 @@ static bNodeSocketTemplate cmp_node_rlayers_out[] = { { SOCK_RGBA, 0, N_("Subsurface Direct"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 0, N_("Subsurface Indirect"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { SOCK_RGBA, 0, N_("Subsurface Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, +#ifdef WITH_CYCLES_DEBUG + { SOCK_FLOAT, 0, N_("Debug"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, +#endif { -1, 0, "" } }; @@ -160,6 +163,10 @@ static void cmp_node_image_add_render_pass_outputs(bNodeTree *ntree, bNode *node cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_SUBSURFACE_INDIRECT, RRES_OUT_SUBSURFACE_INDIRECT); if (passflag & SCE_PASS_SUBSURFACE_COLOR) cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_SUBSURFACE_COLOR, RRES_OUT_SUBSURFACE_COLOR); + +#ifdef WITH_CYCLES_DEBUG + cmp_node_image_add_render_pass_output(ntree, node, SCE_PASS_DEBUG, RRES_OUT_DEBUG); +#endif } static void cmp_node_image_add_multilayer_outputs(bNodeTree *ntree, bNode *node, RenderLayer *rl) @@ -380,8 +387,12 @@ void register_node_type_cmp_image(void) static void set_output_visible(bNode *node, int passflag, int index, int pass) { bNodeSocket *sock = BLI_findlink(&node->outputs, index); + bool pass_enabled = ((passflag & pass) != 0); +#ifdef WITH_CYCLES_DEBUG + pass_enabled |= (pass == SCE_PASS_DEBUG); +#endif /* clear the SOCK_HIDDEN flag as well, in case a socket was hidden before */ - if (passflag & pass) + if (pass_enabled) sock->flag &= ~(SOCK_HIDDEN | SOCK_UNAVAIL); else sock->flag |= SOCK_UNAVAIL; @@ -440,6 +451,10 @@ void node_cmp_rlayers_force_hidden_passes(bNode *node) set_output_visible(node, passflag, RRES_OUT_SUBSURFACE_DIRECT, SCE_PASS_SUBSURFACE_DIRECT); set_output_visible(node, passflag, RRES_OUT_SUBSURFACE_INDIRECT, SCE_PASS_SUBSURFACE_INDIRECT); set_output_visible(node, passflag, RRES_OUT_SUBSURFACE_COLOR, SCE_PASS_SUBSURFACE_COLOR); + +#ifdef WITH_CYCLES_DEBUG + set_output_visible(node, passflag, RRES_OUT_DEBUG, SCE_PASS_DEBUG); +#endif } static void node_composit_init_rlayers(const bContext *C, PointerRNA *ptr) |