Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_bokehimage.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2006 Blender Foundation. | * The Original Code is Copyright (C) 2006 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "UI_interface.h" | |||||
| #include "UI_resources.h" | |||||
| #include "../node_composite_util.hh" | #include "../node_composite_util.hh" | ||||
| /* **************** Bokeh image Tools ******************** */ | /* **************** Bokeh image Tools ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void cmp_node_bokehimage_declare(NodeDeclarationBuilder &b) | static void cmp_node_bokehimage_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| static void node_composit_init_bokehimage(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_bokehimage(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeBokehImage *data = (NodeBokehImage *)MEM_callocN(sizeof(NodeBokehImage), "NodeBokehImage"); | NodeBokehImage *data = (NodeBokehImage *)MEM_callocN(sizeof(NodeBokehImage), "NodeBokehImage"); | ||||
| data->angle = 0.0f; | data->angle = 0.0f; | ||||
| data->flaps = 5; | data->flaps = 5; | ||||
| data->rounding = 0.0f; | data->rounding = 0.0f; | ||||
| data->catadioptric = 0.0f; | data->catadioptric = 0.0f; | ||||
| data->lensshift = 0.0f; | data->lensshift = 0.0f; | ||||
| node->storage = data; | node->storage = data; | ||||
| } | } | ||||
| static void node_composit_buts_bokehimage(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | |||||
| { | |||||
| uiItemR(layout, ptr, "flaps", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | |||||
| uiItemR(layout, ptr, "angle", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | |||||
| uiItemR( | |||||
| layout, ptr, "rounding", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | |||||
| uiItemR(layout, | |||||
| ptr, | |||||
| "catadioptric", | |||||
| UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, | |||||
| nullptr, | |||||
| ICON_NONE); | |||||
| uiItemR(layout, ptr, "shift", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE); | |||||
| } | |||||
| void register_node_type_cmp_bokehimage() | void register_node_type_cmp_bokehimage() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_BOKEHIMAGE, "Bokeh Image", NODE_CLASS_INPUT, NODE_PREVIEW); | cmp_node_type_base(&ntype, CMP_NODE_BOKEHIMAGE, "Bokeh Image", NODE_CLASS_INPUT, NODE_PREVIEW); | ||||
| ntype.declare = blender::nodes::cmp_node_bokehimage_declare; | ntype.declare = blender::nodes::cmp_node_bokehimage_declare; | ||||
| ntype.draw_buttons = node_composit_buts_bokehimage; | |||||
| node_type_init(&ntype, node_composit_init_bokehimage); | node_type_init(&ntype, node_composit_init_bokehimage); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeBokehImage", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeBokehImage", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||