Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_switchview.cc
| Show All 22 Lines | |||||
| */ | */ | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "../node_composite_util.hh" | #include "../node_composite_util.hh" | ||||
| /* **************** SWITCH VIEW ******************** */ | /* **************** SWITCH VIEW ******************** */ | ||||
| namespace blender::nodes::node_cmp_switchview_cc { | |||||
| static bNodeSocketTemplate cmp_node_switch_view_out[] = { | static bNodeSocketTemplate cmp_node_switch_view_out[] = { | ||||
| {SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static bNodeSocket *ntreeCompositSwitchViewAddSocket(bNodeTree *ntree, | static bNodeSocket *ntreeCompositSwitchViewAddSocket(bNodeTree *ntree, | ||||
| bNode *node, | bNode *node, | ||||
| const char *name) | const char *name) | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (SceneRenderView *, srv, &rd->views) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* make sure there is always one socket */ | /* make sure there is always one socket */ | ||||
| cmp_node_switch_view_sanitycheck(ntree, node); | cmp_node_switch_view_sanitycheck(ntree, node); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_cmp_switchview_cc | |||||
| void register_node_type_cmp_switch_view(void) | void register_node_type_cmp_switch_view(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_cmp_switchview_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_SWITCH_VIEW, "Switch View", NODE_CLASS_CONVERTER, 0); | cmp_node_type_base(&ntype, CMP_NODE_SWITCH_VIEW, "Switch View", NODE_CLASS_CONVERTER, 0); | ||||
| node_type_socket_templates(&ntype, nullptr, cmp_node_switch_view_out); | node_type_socket_templates(&ntype, nullptr, file_ns::cmp_node_switch_view_out); | ||||
| ntype.initfunc_api = file_ns::init_switch_view; | |||||
| ntype.initfunc_api = init_switch_view; | node_type_update(&ntype, file_ns::cmp_node_switch_view_update); | ||||
| node_type_update(&ntype, cmp_node_switch_view_update); | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||