Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc
| Show All 24 Lines | |||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_task.hh" | #include "BLI_task.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_string_to_curves_cc { | ||||
| static void geo_node_string_to_curves_declare(NodeDeclarationBuilder &b) | static void geo_node_string_to_curves_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::String>(N_("String")); | b.add_input<decl::String>(N_("String")); | ||||
| b.add_input<decl::Float>(N_("Size")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE); | b.add_input<decl::Float>(N_("Size")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE); | ||||
| b.add_input<decl::Float>(N_("Character Spacing")) | b.add_input<decl::Float>(N_("Character Spacing")) | ||||
| .default_value(1.0f) | .default_value(1.0f) | ||||
| .min(0.0f) | .min(0.0f) | ||||
| ▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | static void geo_node_string_to_curves_exec(GeoNodeExecParams params) | ||||
| InstancesComponent &instances = geometry_set_out.get_component_for_write<InstancesComponent>(); | InstancesComponent &instances = geometry_set_out.get_component_for_write<InstancesComponent>(); | ||||
| Map<int, int> char_handles = create_curve_instances( | Map<int, int> char_handles = create_curve_instances( | ||||
| params, layout.final_font_size, char_codes, instances); | params, layout.final_font_size, char_codes, instances); | ||||
| add_instances_from_handles(instances, char_handles, char_codes, layout.positions); | add_instances_from_handles(instances, char_handles, char_codes, layout.positions); | ||||
| params.set_output("Curves", std::move(geometry_set_out)); | params.set_output("Curves", std::move(geometry_set_out)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_string_to_curves_cc | ||||
| void register_node_type_geo_string_to_curves() | void register_node_type_geo_string_to_curves() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_string_to_curves_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_STRING_TO_CURVES, "String to Curves", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_STRING_TO_CURVES, "String to Curves", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.declare = blender::nodes::geo_node_string_to_curves_declare; | ntype.declare = file_ns::geo_node_string_to_curves_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_string_to_curves_exec; | ntype.geometry_node_execute = file_ns::geo_node_string_to_curves_exec; | ||||
| node_type_init(&ntype, blender::nodes::geo_node_string_to_curves_init); | node_type_init(&ntype, file_ns::geo_node_string_to_curves_init); | ||||
| node_type_update(&ntype, blender::nodes::geo_node_string_to_curves_update); | node_type_update(&ntype, file_ns::geo_node_string_to_curves_update); | ||||
| node_type_size(&ntype, 190, 120, 700); | node_type_size(&ntype, 190, 120, 700); | ||||
| node_type_storage(&ntype, | node_type_storage(&ntype, | ||||
| "NodeGeometryStringToCurves", | "NodeGeometryStringToCurves", | ||||
| node_free_standard_storage, | node_free_standard_storage, | ||||
| node_copy_standard_storage); | node_copy_standard_storage); | ||||
| ntype.draw_buttons = blender::nodes::geo_node_string_to_curves_layout; | ntype.draw_buttons = file_ns::geo_node_string_to_curves_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||