Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_curves.cc
| Show All 36 Lines | |||||
| /* custom1 = start_frame, custom2 = end_frame */ | /* custom1 = start_frame, custom2 = end_frame */ | ||||
| static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->custom1 = 1; | node->custom1 = 1; | ||||
| node->custom2 = 250; | node->custom2 = 250; | ||||
| node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| void register_node_type_cmp_curve_time(void) | void register_node_type_cmp_curve_time() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, 0); | cmp_node_type_base(&ntype, CMP_NODE_TIME, "Time", NODE_CLASS_INPUT, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_time_declare; | ntype.declare = blender::nodes::cmp_node_time_declare; | ||||
| node_type_size(&ntype, 140, 100, 320); | node_type_size(&ntype, 140, 100, 320); | ||||
| node_type_init(&ntype, node_composit_init_curves_time); | node_type_init(&ntype, node_composit_init_curves_time); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| /* **************** CURVE VEC ******************** */ | /* **************** CURVE VEC ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_curve_vec_in[] = { | |||||
| {SOCK_VECTOR, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE}, | namespace blender::nodes { | ||||
| {-1, ""}, | |||||
| }; | static void cmp_node_curve_vec_declare(NodeDeclarationBuilder &b) | ||||
| { | |||||
| static bNodeSocketTemplate cmp_node_curve_vec_out[] = { | b.add_input<decl::Vector>(N_("Vector")).default_value({0.0f, 0.0f, 0.0f}).min(-1.0f).max(1.0f); | ||||
| {SOCK_VECTOR, N_("Vector")}, | b.add_output<decl::Vector>(N_("Vector")); | ||||
| {-1, ""}, | } | ||||
| }; | |||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->storage = BKE_curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); | node->storage = BKE_curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| void register_node_type_cmp_curve_vec(void) | void register_node_type_cmp_curve_vec() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_curve_vec_in, cmp_node_curve_vec_out); | ntype.declare = blender::nodes::cmp_node_curve_vec_declare; | ||||
| node_type_size(&ntype, 200, 140, 320); | node_type_size(&ntype, 200, 140, 320); | ||||
| node_type_init(&ntype, node_composit_init_curve_vec); | node_type_init(&ntype, node_composit_init_curve_vec); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| /* **************** CURVE RGB ******************** */ | /* **************** CURVE RGB ******************** */ | ||||
| Show All 12 Lines | |||||
| } // namespace blender::nodes | } // namespace blender::nodes | ||||
| static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); | node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f); | ||||
| } | } | ||||
| void register_node_type_cmp_curve_rgb(void) | void register_node_type_cmp_curve_rgb() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_rgbcurves_declare; | ntype.declare = blender::nodes::cmp_node_rgbcurves_declare; | ||||
| node_type_size(&ntype, 200, 140, 320); | node_type_size(&ntype, 200, 140, 320); | ||||
| node_type_init(&ntype, node_composit_init_curve_rgb); | node_type_init(&ntype, node_composit_init_curve_rgb); | ||||
| node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | node_type_storage(&ntype, "CurveMapping", node_free_curves, node_copy_curves); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||