26 .description(
"Side length along each axis");
31 .
description(
"Number of vertices for the X side of the shape");
36 .
description(
"Number of vertices for the Y side of the shape");
41 .
description(
"Number of vertices for the Z side of the shape");
50 const std::optional<StringRef> &uv_map_id)
52 const int dimensions = (verts_x - 1 > 0) + (verts_y - 1 > 0) + (verts_z - 1 > 0);
53 if (dimensions == 0) {
56 if (dimensions == 1) {
60 start = {-
size.x / 2.0f, 0, 0};
61 delta = {
size.x / (verts_x - 1), 0, 0};
63 else if (verts_y > 1) {
64 start = {0, -
size.y / 2.0f, 0};
65 delta = {0,
size.y / (verts_y - 1), 0};
68 start = {0, 0, -
size.z / 2.0f};
69 delta = {0, 0,
size.z / (verts_z - 1)};
74 if (dimensions == 2) {
97 const int verts_x =
params.extract_input<
int>(
"Vertices X");
98 const int verts_y =
params.extract_input<
int>(
"Vertices Y");
99 const int verts_z =
params.extract_input<
int>(
"Vertices Z");
100 if (verts_x < 1 || verts_y < 1 || verts_z < 1) {
102 params.set_default_remaining_outputs();
106 std::optional<std::string> uv_map_id =
params.get_output_anonymous_attribute_id_if_needed(
121 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_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)
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)