Geometry Nodes: Add tooltips to primitive node inputs

Building on the work in rBef45399f3be0, this commits adds
tooltips to the inputs for the default primitives nodes.

Differential Revision: https://developer.blender.org/D12640
This commit is contained in:
Nikhil Shringarpurey 2021-11-03 13:25:44 -05:00 committed by Hans Goudey
parent 7aaedc09c7
commit 4e5537d841
15 changed files with 254 additions and 68 deletions

View File

@ -29,15 +29,27 @@ static void geo_node_curve_primitive_bezier_segment_declare(NodeDeclarationBuild
.default_value(16)
.min(1)
.max(256)
.subtype(PROP_UNSIGNED);
.subtype(PROP_UNSIGNED)
.description(N_("The number of evaluated points on the curve"));
b.add_input<decl::Vector>(N_("Start"))
.default_value({-1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(N_("Position of the start control point of the curve"));
b.add_input<decl::Vector>(N_("Start Handle"))
.default_value({-0.5f, 0.5f, 0.0f})
.subtype(PROP_TRANSLATION);
b.add_input<decl::Vector>(N_("End Handle")).subtype(PROP_TRANSLATION);
b.add_input<decl::Vector>(N_("End")).default_value({1.0f, 0.0f, 0.0f}).subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(
N_("Position of the start handle used to define the shape of the curve. In Offset mode, "
"relative to Start point"));
b.add_input<decl::Vector>(N_("End Handle"))
.subtype(PROP_TRANSLATION)
.description(
N_("Position of the end handle used to define the shape of the curve. In Offset mode, "
"relative to End point"));
b.add_input<decl::Vector>(N_("End"))
.default_value({1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION)
.description(N_("Position of the end control point of the curve"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -25,17 +25,34 @@ namespace blender::nodes {
static void geo_node_curve_primitive_circle_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Resolution")).default_value(32).min(3).max(512);
b.add_input<decl::Int>(N_("Resolution"))
.default_value(32)
.min(3)
.max(512)
.description(N_("Number of points on the circle"));
b.add_input<decl::Vector>(N_("Point 1"))
.default_value({-1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(
N_("One of the three points on the circle. The point order determines the circle's "
"direction"));
b.add_input<decl::Vector>(N_("Point 2"))
.default_value({0.0f, 1.0f, 0.0f})
.subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(
N_("One of the three points on the circle. The point order determines the circle's "
"direction"));
b.add_input<decl::Vector>(N_("Point 3"))
.default_value({1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION);
b.add_input<decl::Float>(N_("Radius")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
.subtype(PROP_TRANSLATION)
.description(
N_("One of the three points on the circle. The point order determines the circle's "
"direction"));
b.add_input<decl::Float>(N_("Radius"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Distance of the points from the origin"));
b.add_output<decl::Geometry>(N_("Curve"));
b.add_output<decl::Vector>(N_("Center"));
}

View File

@ -25,10 +25,21 @@ namespace blender::nodes {
static void geo_node_curve_primitive_line_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Vector>(N_("Start")).subtype(PROP_TRANSLATION);
b.add_input<decl::Vector>(N_("End")).default_value({0.0f, 0.0f, 1.0f}).subtype(PROP_TRANSLATION);
b.add_input<decl::Vector>(N_("Direction")).default_value({0.0f, 0.0f, 1.0f});
b.add_input<decl::Float>(N_("Length")).default_value(1.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Vector>(N_("Start"))
.subtype(PROP_TRANSLATION)
.description(N_("Position of the first control point"));
b.add_input<decl::Vector>(N_("End"))
.default_value({0.0f, 0.0f, 1.0f})
.subtype(PROP_TRANSLATION)
.description(N_("Position of the second control point"));
b.add_input<decl::Vector>(N_("Direction"))
.default_value({0.0f, 0.0f, 1.0f})
.description(
N_("Direction the line is going in. The length of this vector does not matter"));
b.add_input<decl::Float>(N_("Length"))
.default_value(1.0f)
.subtype(PROP_DISTANCE)
.description(N_("Distance between the two points"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -25,14 +25,20 @@ static void geo_node_curve_primitive_quadratic_bezier_declare(NodeDeclarationBui
.default_value(16)
.min(3)
.max(256)
.subtype(PROP_UNSIGNED);
.subtype(PROP_UNSIGNED)
.description(N_("The number of edges on the curve"));
b.add_input<decl::Vector>(N_("Start"))
.default_value({-1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(N_("Position of the first control point"));
b.add_input<decl::Vector>(N_("Middle"))
.default_value({0.0f, 2.0f, 0.0f})
.subtype(PROP_TRANSLATION);
b.add_input<decl::Vector>(N_("End")).default_value({1.0f, 0.0f, 0.0f}).subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(N_("Position of the middle control point"));
b.add_input<decl::Vector>(N_("End"))
.default_value({1.0f, 0.0f, 0.0f})
.subtype(PROP_TRANSLATION)
.description(N_("Position of the last control point"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -23,31 +23,57 @@ namespace blender::nodes {
static void geo_node_curve_primitive_quadrilateral_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>(N_("Width")).default_value(2.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Height")).default_value(2.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Width"))
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("The X axis size of the shape"));
b.add_input<decl::Float>(N_("Height"))
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("The Y axis size of the shape"));
b.add_input<decl::Float>(N_("Bottom Width"))
.default_value(4.0f)
.min(0.0f)
.subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Top Width")).default_value(2.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Offset")).default_value(1.0f).subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The X axis size of the shape"));
b.add_input<decl::Float>(N_("Top Width"))
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("The X axis size of the shape"));
b.add_input<decl::Float>(N_("Offset"))
.default_value(1.0f)
.subtype(PROP_DISTANCE)
.description(
N_("For Parallelogram, the relative X difference between the top and bottom edges. For "
"Trapezoid, the amount to move the top edge in the positive X axis"));
b.add_input<decl::Float>(N_("Bottom Height"))
.default_value(3.0f)
.min(0.0f)
.subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Top Height")).default_value(1.0f).subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The distance between the bottom point and the X axis"));
b.add_input<decl::Float>(N_("Top Height"))
.default_value(1.0f)
.subtype(PROP_DISTANCE)
.description(N_("The distance between the top point and the X axis"));
b.add_input<decl::Vector>(N_("Point 1"))
.default_value({-1.0f, -1.0f, 0.0f})
.subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The exact location of the point to use"));
b.add_input<decl::Vector>(N_("Point 2"))
.default_value({1.0f, -1.0f, 0.0f})
.subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The exact location of the point to use"));
b.add_input<decl::Vector>(N_("Point 3"))
.default_value({1.0f, 1.0f, 0.0f})
.subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The exact location of the point to use"));
b.add_input<decl::Vector>(N_("Point 4"))
.default_value({-1.0f, 1.0f, 0.0f})
.subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("The exact location of the point to use"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -26,12 +26,28 @@ static void geo_node_curve_primitive_spiral_declare(NodeDeclarationBuilder &b)
.default_value(32)
.min(1)
.max(1024)
.subtype(PROP_UNSIGNED);
b.add_input<decl::Float>(N_("Rotations")).default_value(2.0f).min(0.0f);
b.add_input<decl::Float>(N_("Start Radius")).default_value(1.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("End Radius")).default_value(2.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Height")).default_value(2.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Bool>(N_("Reverse"));
.subtype(PROP_UNSIGNED)
.description(N_("Number of points in one rotation of the spiral"));
b.add_input<decl::Float>(N_("Rotations"))
.default_value(2.0f)
.min(0.0f)
.description(N_("Number of times the spiral makes a full rotation"));
b.add_input<decl::Float>(N_("Start Radius"))
.default_value(1.0f)
.subtype(PROP_DISTANCE)
.description(
N_("Horizontal Distance from the Z axis at the start of the spiral"));
b.add_input<decl::Float>(N_("End Radius"))
.default_value(2.0f)
.subtype(PROP_DISTANCE)
.description(
N_("Horizontal Distance from the Z axis at the end of the spiral"));
b.add_input<decl::Float>(N_("Height"))
.default_value(2.0f)
.subtype(PROP_DISTANCE)
.description(N_("The height perpendicular to the base of the spiral"));
b.add_input<decl::Bool>(N_("Reverse"))
.description(N_("Switch the direction from clockwise to counterclockwise"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -22,16 +22,25 @@ namespace blender::nodes {
static void geo_node_curve_primitive_star_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Points")).default_value(8).min(3).max(256).subtype(PROP_UNSIGNED);
b.add_input<decl::Int>(N_("Points"))
.default_value(8)
.min(3)
.max(256)
.subtype(PROP_UNSIGNED)
.description(N_("Number of points on each of the circles"));
b.add_input<decl::Float>(N_("Inner Radius"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("Radius of the inner circle; can be larger than outer radius"));
b.add_input<decl::Float>(N_("Outer Radius"))
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Twist")).subtype(PROP_ANGLE);
.subtype(PROP_DISTANCE)
.description(N_("Radius of the outer circle; can be smaller than inner radius"));
b.add_input<decl::Float>(N_("Twist"))
.subtype(PROP_ANGLE)
.description(N_("The counterclockwise rotation of the inner set of points"));
b.add_output<decl::Geometry>(N_("Curve"));
}

View File

@ -29,8 +29,15 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_circle_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Vertices")).default_value(32).min(3);
b.add_input<decl::Float>(N_("Radius")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Int>(N_("Vertices"))
.default_value(32)
.min(3)
.description(N_("Number of vertices on the circle"));
b.add_input<decl::Float>(N_("Radius"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Distance of the vertices from the origin"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -29,15 +29,35 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_cone_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Vertices")).default_value(32).min(3).max(512);
b.add_input<decl::Int>(N_("Side Segments")).default_value(1).min(1).max(512);
b.add_input<decl::Int>(N_("Fill Segments")).default_value(1).min(1).max(512);
b.add_input<decl::Float>(N_("Radius Top")).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Int>(N_("Vertices"))
.default_value(32)
.min(3)
.max(512)
.description(N_("Number of points on the circle at the top and bottom"));
b.add_input<decl::Int>(N_("Side Segments"))
.default_value(1)
.min(1)
.max(512)
.description(N_("The number of edges running vertically along the side of the cone"));
b.add_input<decl::Int>(N_("Fill Segments"))
.default_value(1)
.min(1)
.max(512)
.description(N_("Number of concentric rings used to fill the round face"));
b.add_input<decl::Float>(N_("Radius Top"))
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Radius of the top circle of the cone"));
b.add_input<decl::Float>(N_("Radius Bottom"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Depth")).default_value(2.0f).min(0.0f).subtype(PROP_DISTANCE);
.subtype(PROP_DISTANCE)
.description(N_("Radius of the bottom circle of the cone"));
b.add_input<decl::Float>(N_("Depth"))
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Height of the generated cone"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -29,10 +29,23 @@ static void geo_node_mesh_primitive_cube_declare(NodeDeclarationBuilder &b)
b.add_input<decl::Vector>(N_("Size"))
.default_value(float3(1))
.min(0.0f)
.subtype(PROP_TRANSLATION);
b.add_input<decl::Int>(N_("Vertices X")).default_value(2).min(2).max(1000);
b.add_input<decl::Int>(N_("Vertices Y")).default_value(2).min(2).max(1000);
b.add_input<decl::Int>(N_("Vertices Z")).default_value(2).min(2).max(1000);
.subtype(PROP_TRANSLATION)
.description(N_("Side length along each axis"));
b.add_input<decl::Int>(N_("Vertices X"))
.default_value(2)
.min(2)
.max(1000)
.description(N_("Number of vertices for the X side of the shape"));
b.add_input<decl::Int>(N_("Vertices Y"))
.default_value(2)
.min(2)
.max(1000)
.description(N_("Number of vertices for the Y side of the shape"));
b.add_input<decl::Int>(N_("Vertices Z"))
.default_value(2)
.min(2)
.max(1000)
.description(N_("Number of vertices for the Z side of the shape"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -33,17 +33,17 @@ static void geo_node_mesh_primitive_cylinder_declare(NodeDeclarationBuilder &b)
.default_value(32)
.min(3)
.max(512)
.description(N_("The number of vertices around the circumference"));
.description(N_("The number of vertices on the top and bottom circles"));
b.add_input<decl::Int>(N_("Side Segments"))
.default_value(1)
.min(1)
.max(512)
.description(N_("The number of segments along the side"));
.description(N_("The number of rectangular segments along each side"));
b.add_input<decl::Int>(N_("Fill Segments"))
.default_value(1)
.min(1)
.max(512)
.description(N_("The number of concentric segments of the fill"));
.description(N_("The number of concentric rings used to fill the round faces"));
b.add_input<decl::Float>(N_("Radius"))
.default_value(1.0f)
.min(0.0f)
@ -53,7 +53,7 @@ static void geo_node_mesh_primitive_cylinder_declare(NodeDeclarationBuilder &b)
.default_value(2.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("The height of the cylinder on the Z axis"));
.description(N_("The height of the cylinder"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -29,10 +29,26 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_grid_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>(N_("Size X")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Float>(N_("Size Y")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Int>(N_("Vertices X")).default_value(3).min(2).max(1000);
b.add_input<decl::Int>(N_("Vertices Y")).default_value(3).min(2).max(1000);
b.add_input<decl::Float>(N_("Size X"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Side length of the plane in the X direction"));
b.add_input<decl::Float>(N_("Size Y"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Side length of the plane in the Y direction"));
b.add_input<decl::Int>(N_("Vertices X"))
.default_value(3)
.min(2)
.max(1000)
.description(N_("Number of vertices in the X direction"));
b.add_input<decl::Int>(N_("Vertices Y"))
.default_value(3)
.min(2)
.max(1000)
.description(N_("Number of vertices in the Y direction"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -28,8 +28,16 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_ico_sphere_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>(N_("Radius")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Int>(N_("Subdivisions")).default_value(1).min(1).max(7);
b.add_input<decl::Float>(N_("Radius"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Distance from the generated points to the origin"));
b.add_input<decl::Int>(N_("Subdivisions"))
.default_value(1)
.min(1)
.max(7)
.description(N_("Number of subdivisions on top of the basic icosahedron"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -29,12 +29,25 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_line_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Count")).default_value(10).min(1).max(10000);
b.add_input<decl::Float>(N_("Resolution")).default_value(1.0f).min(0.1f).subtype(PROP_DISTANCE);
b.add_input<decl::Vector>(N_("Start Location")).subtype(PROP_TRANSLATION);
b.add_input<decl::Int>(N_("Count"))
.default_value(10)
.min(1)
.max(10000)
.description(N_("Number of vertices on the line"));
b.add_input<decl::Float>(N_("Resolution"))
.default_value(1.0f)
.min(0.1f)
.subtype(PROP_DISTANCE)
.description(N_("Length of each individual edge"));
b.add_input<decl::Vector>(N_("Start Location"))
.subtype(PROP_TRANSLATION)
.description(N_("Position of the first vertex"));
b.add_input<decl::Vector>(N_("Offset"))
.default_value({0.0f, 0.0f, 1.0f})
.subtype(PROP_TRANSLATION);
.subtype(PROP_TRANSLATION)
.description(N_(
"In offset mode, the distance between each socket on each axis. In end points mode, the "
"position of the final vertex"));
b.add_output<decl::Geometry>(N_("Mesh"));
}

View File

@ -29,9 +29,21 @@ namespace blender::nodes {
static void geo_node_mesh_primitive_uv_shpere_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Int>(N_("Segments")).default_value(32).min(3).max(1024);
b.add_input<decl::Int>(N_("Rings")).default_value(16).min(2).max(1024);
b.add_input<decl::Float>(N_("Radius")).default_value(1.0f).min(0.0f).subtype(PROP_DISTANCE);
b.add_input<decl::Int>(N_("Segments"))
.default_value(32)
.min(3)
.max(1024)
.description(N_("Horizontal resolution of the sphere"));
b.add_input<decl::Int>(N_("Rings"))
.default_value(16)
.min(2)
.max(1024)
.description(N_("The number of horizontal rings"));
b.add_input<decl::Float>(N_("Radius"))
.default_value(1.0f)
.min(0.0f)
.subtype(PROP_DISTANCE)
.description(N_("Distance from the generated points to the origin"));
b.add_output<decl::Geometry>(N_("Mesh"));
}