Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-03-17 00:35:12 +0300
committerHans Goudey <h.goudey@me.com>2021-03-17 00:35:36 +0300
commit9a56a3865c06b472ac54c0351e270dcf738add07 (patch)
tree375bfcdabd2bb184be581ebb95f249938952ad19 /source/blender/nodes/NOD_static_types.h
parent3e87d8a4315d794efff659e40f0bb9e34e2aec8a (diff)
Geometry Nodes: Add initial version of mesh primitives
This commit includes nodes to build the following primitives: - Cone - Cylinder - Circle - Cube - UV Sphere - Ico Sphere - Line - Plane/Grid In general the inputs are the same as the corresponding operators in the 3D view. **Line Primitive** The line primitive has two modes-- adding vertices between two end points, or adding vertices each at an offset from the start point. For the former mode, there is a choice between a vertex count and a distance between each point. **Plane Primitive** This commit includes the "Plane" and "Grid" primitives as one node. Generally primitives are named after the simpler form of the shape they create (i.e. "Cone" can make some more complex shapes). Also, generally you want to tweak the number of subdivisions anyway, so defaulting to plane is not an inconvenience. And generally having fewer redundant base primitives is better. **Future Improvements** A following patch proposes to improve the speed of the cylinder, cone, and sphere primitives: D10730. Additional possible future improvements would be adding subdivisions to the cube node and rings to the cone and cylinder nodes. Differential Revision: https://developer.blender.org/D10715
Diffstat (limited to 'source/blender/nodes/NOD_static_types.h')
-rw-r--r--source/blender/nodes/NOD_static_types.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index e9983d7e92c..89144b678e7 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -302,6 +302,14 @@ DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_SEPARATE_XYZ, def_geo_attribute_separat
DefNode(GeometryNode, GEO_NODE_SUBDIVIDE, 0, "SUBDIVIDE", Subdivide, "Subdivide", "")
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_REMOVE, 0, "ATTRIBUTE_REMOVE", AttributeRemove, "Attribute Remove", "")
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CONVERT, def_geo_attribute_convert, "ATTRIBUTE_CONVERT", AttributeConvert, "Attribute Convert", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CUBE, 0, "MESH_PRIMITIVE_CUBE", MeshCube, "Cube", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CIRCLE, def_geo_mesh_circle, "MESH_PRIMITIVE_CIRCLE", MeshCircle, "Circle", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_UV_SPHERE, 0, "MESH_PRIMITIVE_UV_SPHERE", MeshUVSphere, "UV Sphere", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CYLINDER, def_geo_mesh_cylinder, "MESH_PRIMITIVE_CYLINDER", MeshCylinder, "Cylinder", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE, 0, "MESH_PRIMITIVE_ICO_SPHERE", MeshIcoSphere, "Ico Sphere", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_CONE, def_geo_mesh_cone, "MESH_PRIMITIVE_CONE", MeshCone, "Cone", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_LINE, def_geo_mesh_line, "MESH_PRIMITIVE_LINE", MeshLine, "Line", "")
+DefNode(GeometryNode, GEO_NODE_MESH_PRIMITIVE_PLANE, 0, "MESH_PRIMITIVE_PLANE", MeshPlane, "Plane", "")
/* undefine macros */
#undef DefNode