Scene-free 3D object placement service ( v1, ground snapping). Owns the preview ghost, validity evaluation, and placement commit for 3D sessions. Production addon code (not demo code) because valid/invalid preview feedback is core placement UX every 3D consumer needs; demos and games only wire it to their positioner/UI. Validity rules (evaluated in order, all must pass): 1. an active [ScenePlacementEntry] with a packed_scene is selected 2. no footprint cell is already occupied by a placed object 3. every footprint column has resolvable ground on the GridMap (when [member ObjectPlacementSettings3D.require_ground_cell]) 4. the surface elevation delta across the footprint stays within [member ObjectPlacementSettings3D.max_elevation_delta] ("too steep") 5. the entry's [PlacementSnapProfile3D] adjacency requirement is met (when [member PlacementSnapProfile3D.require_adjacent_snap]) Ground resolution: each footprint column is scanned top-down through the GridMap ([member ObjectPlacementSettings3D.surface_scan_max_y] .. [member ObjectPlacementSettings3D.surface_scan_min_y]); the first occupied cell's mesh AABB top is the walkable surface, so slabs, full blocks, and stacked blocks all resolve without per-item configuration. Objects rest on the HIGHEST surface under their footprint. Cell items are assumed unrotated (v1); socket-level snapping is . Visual feedback decision (see the draft guide): the ghost's meshes are TINTED via material_override (valid/invalid colors from settings) instead of spawning 2D-style indicator cubes. In 3D, per-cell indicator geometry occludes the scene and duplicates draw work; the tinted ghost communicates validity, final position, and footprint in a single visual.
Source: addons/grid_placement/systems/building/3d/object_placement_service_3d.gd
Syntax
class ObjectPlacementService3D extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
object_placed | Event | Emitted after a successful [method try_place_at] commit. |
preview_validity_changed | Event | Emitted when the preview ghost flips between valid and invalid. |
MISS | Field | Sentinel matching [constant GridPositioner3D.MISS]. |
NO_GROUND | Field | Returned by [method resolve_surface_height] when a column has no ground. |
configure | Method | |
is_configured | Method | |
set_active_entry | Method | |
get_active_entry | Method | |
update_preview_cell | Method | |
issues | Property | |
valid | Property | |
is_preview_valid | Method | |
get_preview_cell | Method | |
clear_preview | Method | |
footprint_cells | Method | |
size | Property | |
cells | Property | |
resolve_surface_height | Method | |
library | Property | |
probe | Property | |
item | Property | |
mesh | Property | |
top_offset | Property | |
center_global | Property | |
resolve_surface_item_name | Method | |
library | Property | |
probe | Property | |
item | Property | |
validate_cell | Method | |
issues | Property | |
cells | Property | |
min_surface | Property | |
max_surface | Property | |
missing_ground | Property | |
surface | Property | |
profile | Property | |
placement_position | Method | |
cells | Property | |
sum | Property | |
max_surface | Property | |
center | Property | |
try_place_report | Method | |
report | Property | |
issues | Property | |
node | Property | |
populate_surface_metadata | Method | |
cells | Property | |
max_surface | Property | |
surface_name | Property | |
surface | Property | |
try_place_at | Method | |
issues | Property | |
node | Property | |
profile | Property | |
family | Property | |
is_cell_occupied | Method | |
get_placed_node | Method | |
get_family_at | Method | |
get_placed_count | Method | |
nearest_edge | Method | |
center | Property | |
dx | Property | |
dz | Property | |
edge_position | Method | |
key | Property | |
center | Property | |
half | Property | |
surface | Property | |
edge_yaw | Method | |
is_edge_occupied | Method | |
validate_edge | Method | |
issues | Property | |
profile | Property | |
update_preview_edge | Method | |
issues | Property | |
valid | Property | |
try_place_at_edge | Method | |
issues | Property | |
node | Property | |
dispose | Method |
Source
addons/grid_placement/systems/building/3d/object_placement_service_3d.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs