diff options
author | Omar Emara <mail@OmarEmara.dev> | 2022-08-10 11:36:57 +0300 |
---|---|---|
committer | Omar Emara <mail@OmarEmara.dev> | 2022-08-10 11:36:57 +0300 |
commit | fad112be1c6a06f6412b7c19379032008c733563 (patch) | |
tree | ade70fab5d3433c6c9c2796c700e92b3c0e71a70 /source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc | |
parent | 40c45985a924e2e2310d5c51cf399150d557792c (diff) |
Realtime Compositor: Add stub unsupported nodes
This patch adds a stub implementation for all unsupported nodes. The
inputs are passed through to the outputs where it make sense, while
other outputs will be allocated a single zero value.
This seems to be preferred by users as opposed to stopping execution and
displaying an error message.
Differential Revision: https://developer.blender.org/D15464
Reviewed By: Clement Foucault
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc index ad4a1f701d6..66a321eb088 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc +++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.cc @@ -8,6 +8,8 @@ #include "UI_interface.h" #include "UI_resources.h" +#include "COM_node_operation.hh" + #include "node_composite_util.hh" /* **************** BILATERALBLUR ******************** */ @@ -42,6 +44,23 @@ static void node_composit_buts_bilateralblur(uiLayout *layout, uiItemR(col, ptr, "sigma_space", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); } +using namespace blender::realtime_compositor; + +class BilateralBlurOperation : public NodeOperation { + public: + using NodeOperation::NodeOperation; + + void execute() override + { + get_input("Image").pass_through(get_result("Image")); + } +}; + +static NodeOperation *get_compositor_operation(Context &context, DNode node) +{ + return new BilateralBlurOperation(context, node); +} + } // namespace blender::nodes::node_composite_bilateralblur_cc void register_node_type_cmp_bilateralblur() @@ -56,6 +75,7 @@ void register_node_type_cmp_bilateralblur() node_type_init(&ntype, file_ns::node_composit_init_bilateralblur); node_type_storage( &ntype, "NodeBilateralBlurData", node_free_standard_storage, node_copy_standard_storage); + ntype.get_compositor_operation = file_ns::get_compositor_operation; nodeRegisterType(&ntype); } |