Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc
| Show All 15 Lines | |||||
| #include "BKE_spline.hh" | #include "BKE_spline.hh" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_geo_set_curve_handles_cc { | ||||
| static void geo_node_set_curve_handles_declare(NodeDeclarationBuilder &b) | static void geo_node_set_curve_handles_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Curve")).supported_type(GEO_COMPONENT_TYPE_CURVE); | b.add_input<decl::Geometry>(N_("Curve")).supported_type(GEO_COMPONENT_TYPE_CURVE); | ||||
| b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | ||||
| b.add_input<decl::Vector>(N_("Position")).implicit_field(); | b.add_input<decl::Vector>(N_("Position")).implicit_field(); | ||||
| b.add_input<decl::Vector>(N_("Offset")).default_value(float3(0.0f, 0.0f, 0.0f)).supports_field(); | b.add_input<decl::Vector>(N_("Offset")).default_value(float3(0.0f, 0.0f, 0.0f)).supports_field(); | ||||
| b.add_output<decl::Geometry>(N_("Curve")); | b.add_output<decl::Geometry>(N_("Curve")); | ||||
| ▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | static void geo_node_set_curve_handles_exec(GeoNodeExecParams params) | ||||
| }); | }); | ||||
| if (!has_bezier) { | if (!has_bezier) { | ||||
| params.error_message_add(NodeWarningType::Info, | params.error_message_add(NodeWarningType::Info, | ||||
| TIP_("The input geometry does not contain a Bezier spline")); | TIP_("The input geometry does not contain a Bezier spline")); | ||||
| } | } | ||||
| params.set_output("Curve", std::move(geometry_set)); | params.set_output("Curve", std::move(geometry_set)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_set_curve_handles_cc | ||||
| void register_node_type_geo_set_curve_handles() | void register_node_type_geo_set_curve_handles() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_set_curve_handles_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_SET_CURVE_HANDLES, "Set Handle Positions", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_SET_CURVE_HANDLES, "Set Handle Positions", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_set_curve_handles_exec; | ntype.geometry_node_execute = file_ns::geo_node_set_curve_handles_exec; | ||||
| ntype.declare = blender::nodes::geo_node_set_curve_handles_declare; | ntype.declare = file_ns::geo_node_set_curve_handles_declare; | ||||
| ntype.minwidth = 100.0f; | ntype.minwidth = 100.0f; | ||||
| node_type_init(&ntype, blender::nodes::geo_node_set_curve_handles_init); | node_type_init(&ntype, file_ns::geo_node_set_curve_handles_init); | ||||
| node_type_storage(&ntype, | node_type_storage(&ntype, | ||||
| "NodeGeometrySetCurveHandlePositions", | "NodeGeometrySetCurveHandlePositions", | ||||
| node_free_standard_storage, | node_free_standard_storage, | ||||
| node_copy_standard_storage); | node_copy_standard_storage); | ||||
| ntype.draw_buttons = blender::nodes::geo_node_set_curve_handles_layout; | ntype.draw_buttons = file_ns::geo_node_set_curve_handles_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||