Line and rectangle fills for ObjectPlacementService3D: resolves one drag between two grid cells into the mounts the gesture places, previews them, and commits them in order through the service. Set the drag fields, then call cells() and pass the result to preview_edges() / cell_verdicts() while the drag moves and to commit() on release. CELL entries place one piece per span cell; EDGE entries mount one piece per authored span along the run. CORNER, FACE and TOP entries need a specific host per placement and are not fillable. var fill := ObjectFillSpan3D.new(service) fill.brush_shape = PlacementEnums.ObjectTool.RECTANGLE_FILL fill.start_cell = press_cell fill.end_cell = release_cell var result := fill.commit(fill.cells()) print("placed %d/%d" % [result.committed, result.attempted])
Source: addons/grid_placement/systems/building/3d/object_fill_span_3d.gd
Syntax
class ObjectFillSpan3D extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
MISS | Field | |
attempted | Property | Outcome of one commit(). Mounts the commit tried to place. |
committed | Property | Pieces actually placed. |
last_report | Property | The last report the commit produced, or null when nothing was tried. |
last_success | Property | The last successful report, or null when nothing placed. |
blocked | Property | The first issue of each failed mount, in commit order. |
cells | Property | The EDGE mounts a fill places: one cell and edge per piece, in order. |
edges | Property | |
add | Method | |
service | Property | |
brush_shape | Property | The PlacementEnums.ObjectTool the session brush holds. |
start_cell | Property | Grid cell the drag started on (its Y is the fill level). |
end_cell | Property | Grid cell under the cursor now. |
anchor_cell | Property | EDGE entries: anchor cell of the pressed mount; MISS means start_cell. |
start_edge | Property | EDGE entries: edge of the pressed mount. A pressed edge keeps its rotation along the whole run; Vector3i.ZERO derives facings from the drag. |
max_cells | Property | Largest span a gesture may cover; a larger drag yields no cells at all so preview and commit never disagree. 0 means no limit. |
cursor_edge | Property | Optional func(cell: Vector3i) -> Vector3i: the edge nearest the cursor, for EDGE spans with no drag direction. Defaults to +Z. |
cursor_mount | Property | Optional func(cell: Vector3i) -> Array[Vector3i]: the [anchor_cell, edge] mount under the cursor, for a one-cell EDGE span with no pressed edge. Defaults to [cell, cursor edge]. |
budget_exceeded | Property | True when the last cells() call went over max_cells. |
is_edge_fill | Method | |
span_shape | Method | |
cells | Method | |
cells_3d | Method | |
cell_verdicts | Method | |
cell_verdicts_from | Method | |
verdicts | Property | |
entry | Property | |
claimed | Property | |
yaw | Property | |
profile | Property | |
occupies | Property | |
cell | Property | |
footprint | Property | |
valid | Property | |
edge_mounts | Method | |
preview_edges | Method | |
preview_cells | Method | |
lifted | Property | |
verdicts | Property | |
ordered | Property | |
commit | Method |