27 .description(
"Side length along each axis");
32 .
description(
"Number of vertices for the X side of the shape");
37 .
description(
"Number of vertices for the Y side of the shape");
42 .
description(
"Number of vertices for the Z side of the shape");
51 const std::optional<StringRef> &uv_map_id)
53 const int dimensions = (verts_x - 1 > 0) + (verts_y - 1 > 0) + (verts_z - 1 > 0);
54 if (dimensions == 0) {
57 if (dimensions == 1) {
61 start = {-
size.x / 2.0f, 0, 0};
62 delta = {
size.x / (verts_x - 1), 0, 0};
64 else if (verts_y > 1) {
65 start = {0, -
size.y / 2.0f, 0};
66 delta = {0,
size.y / (verts_y - 1), 0};
69 start = {0, 0, -
size.z / 2.0f};
70 delta = {0, 0,
size.z / (verts_z - 1)};
75 if (dimensions == 2) {
98 const int verts_x =
params.extract_input<
int>(
"Vertices X");
99 const int verts_y =
params.extract_input<
int>(
"Vertices Y");
100 const int verts_z =
params.extract_input<
int>(
"Vertices Z");
101 if (verts_x < 1 || verts_y < 1 || verts_z < 1) {
103 params.set_default_remaining_outputs();
107 std::optional<std::string> uv_map_id =
params.get_output_anonymous_attribute_id_if_needed(
122 ntype.
ui_description =
"Generate a cuboid mesh with variable side lengths and subdivisions";
General operations, lookup, etc. for materials.
void BKE_id_material_eval_ensure_default_slot(ID *id)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_MESH_PRIMITIVE_CUBE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void node_register_type(bNodeType &ntype)
Mesh * create_cuboid_mesh(const float3 &size, int verts_x, int verts_y, int verts_z, std::optional< StringRef > uv_id)
Mesh * create_grid_mesh(int verts_x, int verts_y, float size_x, float size_y, std::optional< StringRef > uv_map_id)
void transform_mesh(Mesh &mesh, float3 translation, math::Quaternion rotation, float3 scale)
Mesh * create_line_mesh(float3 start, float3 delta, int count)
QuaternionBase< T > to_quaternion(const AxisAngleBase< T, AngleT > &axis_angle)
EulerXYZBase< float > EulerXYZ
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, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)