Line
Generates a straight line segment between two endpoints.
Category: Shapes Menu path: Shapes > Line
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
out | shape | output | Line shape data (open path) |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
p1 | vec2 | (-100, 0) | First endpoint in local-space pixels |
p2 | vec2 | (100, 0) | Second endpoint in local-space pixels |
Expose Channels
When enabled (E button on node header), adds input ports that override params via edge connections:
| Port | Type | Overrides |
|---|---|---|
p1_in | vec2 | p1 |
p2_in | vec2 | p2 |
How It Works
Generates an open (unclosed) path with two points, forming a straight line segment in local space. Since the path is open, only DrawShape's stroke settings will produce visible output -- fill has no effect on open paths. The shape is pure geometry data (no GPU allocation) and must be rasterized via DrawShape to produce a visible image.
Usage Examples
Basic: Draw a line
Line -> Transform2D -> DrawShape -> Output. Set DrawShape's stroke color and stroke width to make the line visible.
Animated connector
Keyframe p1 and p2 to animate a line moving between two positions. Or connect VectorMath outputs to the p1_in / p2_in expose channels.
Trail backbone
Line -> ResampleShape -> ShapeAttributes -> DrawShape. Resample the line into many points, then use ShapeAttributes with a Noise field to vary color or opacity along the line's length.
Tips
- Lines are open paths -- only stroke rendering applies. Set a stroke width and color in DrawShape.
- Shapes are centered at the origin. Use Transform2D for all positioning and rotation.
- Both endpoints are keyframeable as vec2 values, allowing independent animation of each end.
- For multi-segment lines or curves, use EditableShape with the pen tool instead.
Related Nodes
- EditableShape -- freeform multi-point bezier paths
- ResampleShape -- resamples the line into evenly spaced points
- Transform2D -- positions and scales the shape in the composition
- DrawShape -- rasterizes shapes to pixels with stroke