diff options
author | Hans Goudey <h.goudey@me.com> | 2021-03-22 18:58:46 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-22 18:58:46 +0300 |
commit | 23d2174d6bc40f4426ece2cb5627fc78ea9cf2fa (patch) | |
tree | 5e4c8879f51e1072b00b4913f5fae67ad6a7a75a /source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc | |
parent | 2d1120c1718da183a4178bec9d3d999ef7ac827f (diff) |
Geometry Nodes: Remove location and rotation from mesh primitives
Following some discussion among the geometry nodes team, it was decided
that keeping the primitive nodes simpler and requiring a separate
transform node to move the generated geometry from the origin would
be better.
- It's more consistent with the current general idea of "building
block nodes"
- It makes more sense for the future when it will be possible to
use instancing to control the transforms.
- It reduces UI clutter when the controls are not necessary.
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc index 158491f40e7..f443b4387d3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cylinder.cc @@ -28,8 +28,6 @@ static bNodeSocketTemplate geo_node_mesh_primitive_cylinder_in[] = { {SOCK_INT, N_("Vertices"), 32, 0.0f, 0.0f, 0.0f, 3, 4096}, {SOCK_FLOAT, N_("Radius"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX, PROP_DISTANCE}, {SOCK_FLOAT, N_("Depth"), 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, FLT_MAX, PROP_DISTANCE}, - {SOCK_VECTOR, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX, PROP_TRANSLATION}, - {SOCK_VECTOR, N_("Rotation"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX, PROP_EULER}, {-1, ""}, }; @@ -67,20 +65,16 @@ static void geo_node_mesh_primitive_cylinder_exec(GeoNodeExecParams params) const GeometryNodeMeshCircleFillType fill_type = (const GeometryNodeMeshCircleFillType) storage.fill_type; + const float radius = params.extract_input<float>("Radius"); + const float depth = params.extract_input<float>("Depth"); const int verts_num = params.extract_input<int>("Vertices"); if (verts_num < 3) { params.set_output("Geometry", GeometrySet()); return; } - const float radius = params.extract_input<float>("Radius"); - const float depth = params.extract_input<float>("Depth"); - const float3 location = params.extract_input<float3>("Location"); - const float3 rotation = params.extract_input<float3>("Rotation"); - /* The cylinder is a special case of the cone mesh where the top and bottom radius are equal. */ - Mesh *mesh = create_cylinder_or_cone_mesh( - location, rotation, radius, radius, depth, verts_num, fill_type); + Mesh *mesh = create_cylinder_or_cone_mesh(radius, radius, depth, verts_num, fill_type); params.set_output("Geometry", GeometrySet::create_with_mesh(mesh)); } |