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 [method cells] and pass the result to [method preview_edges] / [method cell_verdicts] while the drag moves and to [method 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. [codeblock] 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]) [/codeblock]
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 [method 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 [enum 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; [constant MISS] means [member start_cell]. |
start_edge | Property | EDGE entries: edge of the pressed mount. A pressed edge keeps its rotation along the whole run; [constant 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 [code]func(cell: Vector3i) -> Vector3i[/code]: the edge nearest the cursor, for EDGE spans with no drag direction. Defaults to +Z. |
cursor_mount | Property | Optional [code]func(cell: Vector3i) -> Array[Vector3i][/code]: the [code][anchor_cell, edge][/code] mount under the cursor, for a one-cell EDGE span with no pressed edge. Defaults to [code][cell, cursor edge][/code]. |
budget_exceeded | Property | True when the last [method cells] call went over [member max_cells]. |
is_edge_fill | Method | |
span_shape | Method | |
cells | Method | |
cells_3d | Method | |
cell_verdicts | Method | |
edge_mounts | Method | |
preview_edges | Method | |
commit | Method |