Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_movieclip.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2011 Blender Foundation. | * The Original Code is Copyright (C) 2011 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | |||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "RNA_access.h" | |||||
| #include "UI_interface.h" | |||||
| #include "UI_resources.h" | |||||
| #include "node_composite_util.hh" | |||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void cmp_node_movieclip_declare(NodeDeclarationBuilder &b) | static void cmp_node_movieclip_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| b.add_output<decl::Float>(N_("Alpha")); | b.add_output<decl::Float>(N_("Alpha")); | ||||
| b.add_output<decl::Float>(N_("Offset X")); | b.add_output<decl::Float>(N_("Offset X")); | ||||
| b.add_output<decl::Float>(N_("Offset Y")); | b.add_output<decl::Float>(N_("Offset Y")); | ||||
| Show All 11 Lines | MovieClipUser *user = (MovieClipUser *)MEM_callocN(sizeof(MovieClipUser), | ||||
| "node movie clip user"); | "node movie clip user"); | ||||
| node->id = (ID *)scene->clip; | node->id = (ID *)scene->clip; | ||||
| id_us_plus(node->id); | id_us_plus(node->id); | ||||
| node->storage = user; | node->storage = user; | ||||
| user->framenr = 1; | user->framenr = 1; | ||||
| } | } | ||||
| static void node_composit_buts_movieclip(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| uiTemplateID(layout, | |||||
| C, | |||||
| ptr, | |||||
| "clip", | |||||
| nullptr, | |||||
| "CLIP_OT_open", | |||||
| nullptr, | |||||
| UI_TEMPLATE_ID_FILTER_ALL, | |||||
| false, | |||||
| nullptr); | |||||
| } | |||||
| static void node_composit_buts_movieclip_ex(uiLayout *layout, bContext *C, PointerRNA *ptr) | |||||
| { | |||||
| bNode *node = (bNode *)ptr->data; | |||||
| PointerRNA clipptr; | |||||
| uiTemplateID(layout, | |||||
| C, | |||||
| ptr, | |||||
| "clip", | |||||
| nullptr, | |||||
| "CLIP_OT_open", | |||||
| nullptr, | |||||
| UI_TEMPLATE_ID_FILTER_ALL, | |||||
| false, | |||||
| nullptr); | |||||
| if (!node->id) { | |||||
| return; | |||||
| } | |||||
| clipptr = RNA_pointer_get(ptr, "clip"); | |||||
| uiTemplateColorspaceSettings(layout, &clipptr, "colorspace_settings"); | |||||
| } | |||||
| void register_node_type_cmp_movieclip() | void register_node_type_cmp_movieclip() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW); | cmp_node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW); | ||||
| ntype.declare = blender::nodes::cmp_node_movieclip_declare; | ntype.declare = blender::nodes::cmp_node_movieclip_declare; | ||||
| ntype.draw_buttons = node_composit_buts_movieclip; | |||||
| ntype.draw_buttons_ex = node_composit_buts_movieclip_ex; | |||||
| ntype.initfunc_api = init; | ntype.initfunc_api = init; | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage); | &ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||