Differential D13330 Diff 45138 source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_uv_sphere.cc
| Show All 19 Lines | |||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "BKE_mesh.h" | #include "BKE_mesh.h" | ||||
| #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_mesh_primitive_uv_sphere_cc { | ||||
| static void geo_node_mesh_primitive_uv_shpere_declare(NodeDeclarationBuilder &b) | static void geo_node_mesh_primitive_uv_shpere_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Int>(N_("Segments")) | b.add_input<decl::Int>(N_("Segments")) | ||||
| .default_value(32) | .default_value(32) | ||||
| .min(3) | .min(3) | ||||
| .max(1024) | .max(1024) | ||||
| .description(N_("Horizontal resolution of the sphere")); | .description(N_("Horizontal resolution of the sphere")); | ||||
| ▲ Show 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | static void geo_node_mesh_primitive_uv_sphere_exec(GeoNodeExecParams params) | ||||
| } | } | ||||
| const float radius = params.extract_input<float>("Radius"); | const float radius = params.extract_input<float>("Radius"); | ||||
| Mesh *mesh = create_uv_sphere_mesh(radius, segments_num, rings_num); | Mesh *mesh = create_uv_sphere_mesh(radius, segments_num, rings_num); | ||||
| params.set_output("Mesh", GeometrySet::create_with_mesh(mesh)); | params.set_output("Mesh", GeometrySet::create_with_mesh(mesh)); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_mesh_primitive_uv_sphere_cc | ||||
| void register_node_type_geo_mesh_primitive_uv_sphere() | void register_node_type_geo_mesh_primitive_uv_sphere() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_mesh_primitive_uv_sphere_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base( | geo_node_type_base( | ||||
| &ntype, GEO_NODE_MESH_PRIMITIVE_UV_SPHERE, "UV Sphere", NODE_CLASS_GEOMETRY, 0); | &ntype, GEO_NODE_MESH_PRIMITIVE_UV_SPHERE, "UV Sphere", NODE_CLASS_GEOMETRY, 0); | ||||
| ntype.declare = blender::nodes::geo_node_mesh_primitive_uv_shpere_declare; | ntype.declare = file_ns::geo_node_mesh_primitive_uv_shpere_declare; | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_mesh_primitive_uv_sphere_exec; | ntype.geometry_node_execute = file_ns::geo_node_mesh_primitive_uv_sphere_exec; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||