25 .description(
"Side length along each axis");
30 .
description(
"Number of vertices for the X side of the shape");
35 .
description(
"Number of vertices for the Y side of the shape");
40 .
description(
"Number of vertices for the Z side of the shape");
49 const std::optional<StringRef> &uv_map_id)
51 const int dimensions = (verts_x - 1 > 0) + (verts_y - 1 > 0) + (verts_z - 1 > 0);
52 if (dimensions == 0) {
55 if (dimensions == 1) {
59 start = {-size.x / 2.0f, 0, 0};
60 delta = {size.x / (verts_x - 1), 0, 0};
62 else if (verts_y > 1) {
63 start = {0, -size.y / 2.0f, 0};
64 delta = {0, size.y / (verts_y - 1), 0};
67 start = {0, 0, -size.z / 2.0f};
68 delta = {0, 0, size.z / (verts_z - 1)};
73 if (dimensions == 2) {
96 const int verts_x =
params.extract_input<
int>(
"Vertices X");
97 const int verts_y =
params.extract_input<
int>(
"Vertices Y");
98 const int verts_z =
params.extract_input<
int>(
"Vertices Z");
99 if (verts_x < 1 || verts_y < 1 || verts_z < 1) {
100 params.error_message_add(NodeWarningType::Info,
TIP_(
"Vertices must be at least 1"));
101 params.set_default_remaining_outputs();
105 std::optional<std::string> uv_map_id =
params.get_output_anonymous_attribute_id_if_needed(
General operations, lookup, etc. for materials.
void BKE_id_material_eval_ensure_default_slot(struct ID *id)
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Mesh * create_grid_mesh(int verts_x, int verts_y, float size_x, float size_y, const std::optional< StringRef > &uv_map_id)
void transform_mesh(Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale)
Mesh * create_cuboid_mesh(const float3 &size, int verts_x, int verts_y, int verts_z, const std::optional< StringRef > &uv_id)
Mesh * create_line_mesh(float3 start, float3 delta, int count)
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
static Mesh * create_cube_mesh(const float3 size, const int verts_x, const int verts_y, const int verts_z, const std::optional< StringRef > &uv_map_id)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare