Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_curve_handles.cc
| Show All 10 Lines | |||||
| namespace blender::nodes::node_geo_set_curve_handles_cc { | namespace blender::nodes::node_geo_set_curve_handles_cc { | ||||
| NODE_STORAGE_FUNCS(NodeGeometrySetCurveHandlePositions) | NODE_STORAGE_FUNCS(NodeGeometrySetCurveHandlePositions) | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_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().field_on_all(); | ||||
| b.add_input<decl::Vector>(N_("Position")).implicit_field([](const bNode &node, void *r_value) { | b.add_input<decl::Vector>(N_("Position")) | ||||
| const StringRef side = node_storage(node).mode == GEO_NODE_CURVE_HANDLE_LEFT ? "handle_left" : | .implicit_field_on_all([](const bNode &node, void *r_value) { | ||||
| const StringRef side = node_storage(node).mode == GEO_NODE_CURVE_HANDLE_LEFT ? | |||||
| "handle_left" : | |||||
| "handle_right"; | "handle_right"; | ||||
| new (r_value) ValueOrField<float3>(bke::AttributeFieldInput::Create<float3>(side)); | new (r_value) ValueOrField<float3>(bke::AttributeFieldInput::Create<float3>(side)); | ||||
| }); | }); | ||||
| 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)).field_on_all(); | ||||
| b.add_output<decl::Geometry>(N_("Curve")); | b.add_output<decl::Geometry>(N_("Curve")).propagate_all(); | ||||
| } | } | ||||
| static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, nullptr, ICON_NONE); | uiItemR(layout, ptr, "mode", UI_ITEM_R_EXPAND, nullptr, ICON_NONE); | ||||
| } | } | ||||
| static void node_init(bNodeTree * /*tree*/, bNode *node) | static void node_init(bNodeTree * /*tree*/, bNode *node) | ||||
| ▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines | |||||