Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_scale_elements.cc
| Show All 15 Lines | |||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_scale_elements_cc { | namespace blender::nodes::node_geo_scale_elements_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Geometry")).supported_type(GEO_COMPONENT_TYPE_MESH); | b.add_input<decl::Geometry>(N_("Geometry")).supported_type(GEO_COMPONENT_TYPE_MESH); | ||||
| 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_auto(); | ||||
| b.add_input<decl::Float>(N_("Scale"), "Scale").default_value(1.0f).min(0.0f).supports_field(); | b.add_input<decl::Float>(N_("Scale"), "Scale").default_value(1.0f).min(0.0f).field_on_auto(); | ||||
| b.add_input<decl::Vector>(N_("Center")) | b.add_input<decl::Vector>(N_("Center")) | ||||
| .subtype(PROP_TRANSLATION) | .subtype(PROP_TRANSLATION) | ||||
| .implicit_field(implicit_field_inputs::position) | .implicit_field_on_auto(implicit_field_inputs::position) | ||||
| .description(N_("Origin of the scaling for each element. If multiple elements are " | .description(N_("Origin of the scaling for each element. If multiple elements are " | ||||
| "connected, their center is averaged")); | "connected, their center is averaged")); | ||||
| b.add_input<decl::Vector>(N_("Axis")) | b.add_input<decl::Vector>(N_("Axis")) | ||||
| .default_value({1.0f, 0.0f, 0.0f}) | .default_value({1.0f, 0.0f, 0.0f}) | ||||
| .supports_field() | .field_on_auto() | ||||
| .description(N_("Direction in which to scale the element")) | .description(N_("Direction in which to scale the element")) | ||||
| .make_available([](bNode &node) { node.custom2 = GEO_NODE_SCALE_ELEMENTS_SINGLE_AXIS; }); | .make_available([](bNode &node) { node.custom2 = GEO_NODE_SCALE_ELEMENTS_SINGLE_AXIS; }); | ||||
| b.add_output<decl::Geometry>(N_("Geometry")); | b.add_output<decl::Geometry>(N_("Geometry")).propagate_from_auto(); | ||||
| }; | }; | ||||
| static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "domain", 0, "", ICON_NONE); | uiItemR(layout, ptr, "domain", 0, "", ICON_NONE); | ||||
| uiItemR(layout, ptr, "scale_mode", 0, "", ICON_NONE); | uiItemR(layout, ptr, "scale_mode", 0, "", ICON_NONE); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 430 Lines • Show Last 20 Lines | |||||