Differential D13466 Diff 46668 source/blender/nodes/composite/nodes/node_composite_planetrackdeform.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_planetrackdeform.cc
| Show All 22 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_planetrackdeform_cc { | ||||
| static void cmp_node_planetrackdeform_declare(NodeDeclarationBuilder &b) | static void cmp_node_planetrackdeform_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Color>(N_("Image")); | b.add_input<decl::Color>(N_("Image")); | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| b.add_output<decl::Float>(N_("Plane")); | b.add_output<decl::Float>(N_("Plane")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void init(bNodeTree *UNUSED(ntree), bNode *node) | static void init(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodePlaneTrackDeformData *data = MEM_cnew<NodePlaneTrackDeformData>(__func__); | NodePlaneTrackDeformData *data = MEM_cnew<NodePlaneTrackDeformData>(__func__); | ||||
| data->motion_blur_samples = 16; | data->motion_blur_samples = 16; | ||||
| data->motion_blur_shutter = 0.5f; | data->motion_blur_shutter = 0.5f; | ||||
| node->storage = data; | node->storage = data; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | static void node_composit_buts_planetrackdeform(uiLayout *layout, bContext *C, PointerRNA *ptr) | ||||
| uiItemR(layout, ptr, "use_motion_blur", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "use_motion_blur", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) { | if (data->flag & CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR) { | ||||
| uiItemR(layout, ptr, "motion_blur_samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "motion_blur_samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| uiItemR(layout, ptr, "motion_blur_shutter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "motion_blur_shutter", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_planetrackdeform_cc | |||||
| void register_node_type_cmp_planetrackdeform() | void register_node_type_cmp_planetrackdeform() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_planetrackdeform_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_PLANETRACKDEFORM, "Plane Track Deform", NODE_CLASS_DISTORT); | cmp_node_type_base(&ntype, CMP_NODE_PLANETRACKDEFORM, "Plane Track Deform", NODE_CLASS_DISTORT); | ||||
| ntype.declare = blender::nodes::cmp_node_planetrackdeform_declare; | ntype.declare = file_ns::cmp_node_planetrackdeform_declare; | ||||
| ntype.draw_buttons = node_composit_buts_planetrackdeform; | ntype.draw_buttons = file_ns::node_composit_buts_planetrackdeform; | ||||
| node_type_init(&ntype, init); | node_type_init(&ntype, file_ns::init); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodePlaneTrackDeformData", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodePlaneTrackDeformData", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||