diff options
author | Hans Goudey <h.goudey@me.com> | 2021-03-17 00:35:12 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-17 00:35:36 +0300 |
commit | 9a56a3865c06b472ac54c0351e270dcf738add07 (patch) | |
tree | 375bfcdabd2bb184be581ebb95f249938952ad19 /source/blender/makesdna/DNA_node_types.h | |
parent | 3e87d8a4315d794efff659e40f0bb9e34e2aec8a (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/makesdna/DNA_node_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 967258f1b81..06ee22b1452 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -1258,6 +1258,28 @@ typedef struct NodeAttributeConvert { int16_t domain; } NodeAttributeConvert; +typedef struct NodeGeometryMeshCircle { + /* GeometryNodeMeshCircleFillType. */ + uint8_t fill_type; +} NodeGeometryMeshCircle; + +typedef struct NodeGeometryMeshCylinder { + /* GeometryNodeMeshCircleFillType. */ + uint8_t fill_type; +} NodeGeometryMeshCylinder; + +typedef struct NodeGeometryMeshCone { + /* GeometryNodeMeshCircleFillType. */ + uint8_t fill_type; +} NodeGeometryMeshCone; + +typedef struct NodeGeometryMeshLine { + /* GeometryNodeMeshLineMode. */ + uint8_t mode; + /* GeometryNodeMeshLineCountMode. */ + uint8_t count_mode; +} NodeGeometryMeshLine; + /* script node mode */ #define NODE_SCRIPT_INTERNAL 0 #define NODE_SCRIPT_EXTERNAL 1 @@ -1734,6 +1756,22 @@ typedef enum GeometryNodePointsToVolumeResolutionMode { GEO_NODE_POINTS_TO_VOLUME_RESOLUTION_MODE_SIZE = 1, } GeometryNodePointsToVolumeResolutionMode; +typedef enum GeometryNodeMeshCircleFillType { + GEO_NODE_MESH_CIRCLE_FILL_NONE = 0, + GEO_NODE_MESH_CIRCLE_FILL_NGON = 1, + GEO_NODE_MESH_CIRCLE_FILL_TRIANGLE_FAN = 2, +} GeometryNodeMeshCircleFillType; + +typedef enum GeometryNodeMeshLineMode { + GEO_NODE_MESH_LINE_MODE_END_POINTS = 0, + GEO_NODE_MESH_LINE_MODE_OFFSET = 1, +} GeometryNodeMeshLineMode; + +typedef enum GeometryNodeMeshLineCountMode { + GEO_NODE_MESH_LINE_COUNT_TOTAL = 0, + GEO_NODE_MESH_LINE_COUNT_RESOLUTION = 1, +} GeometryNodeMeshLineCountMode; + #ifdef __cplusplus } #endif |