Skip to content

Class

ObjectPlacementService3D

Generated GDScript class reference for GridPlacement.ObjectPlacementService3D.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

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 RefCounted

Members

NameKindSummary
object_placedSignalEmitted after a successful [method try_place_at] commit.
preview_validity_changedSignalEmitted when the preview ghost flips between valid and invalid.
active_entry_changedSignalEmitted when the authoritative active entry changes, including clears (null). Observers such as the catalog selection UI must render this state instead of tracking their own parallel selection.
MISSFieldSentinel matching [constant GridPositioner3D.MISS].
NO_GROUNDFieldReturned by [method resolve_surface_height] when a column has no ground.
configureMethod
configure_lifecycleMethod
get_settingsMethod
is_configuredMethod
set_active_entryMethod
get_active_entryMethod
update_preview_cellMethod
is_preview_validMethod
get_preview_cellMethod
get_preview_ghostMethod
clear_previewMethod
rotate_previewMethod
get_preview_yaw_stepsMethod
preview_yaw_degreesMethod
validate_cell_mapMethod
validate_cellMethod
try_place_reportMethod
populate_surface_metadataMethod
try_place_atMethod
is_cell_occupiedMethod
get_placed_nodeMethod
get_family_atMethod
get_placed_countMethod
is_edge_occupiedMethod
is_face_registeredMethod
is_face_occupiedMethod
validate_edgeMethod
update_preview_edgeMethod
try_place_at_edgeMethod
try_place_report_edgeMethod
validate_faceMethod
update_preview_faceMethod
try_place_at_faceMethod
try_place_report_faceMethod
providerProperty
socketProperty
anchor_nameProperty
consumer_tmpProperty
mateProperty
lifecycleProperty
instance_idProperty
projectionsProperty
provider_facesProperty
projectionsProperty
provider_facesProperty
resultProperty
yaw_stepsProperty
cellsProperty
profileProperty
keyProperty
edge_keyProperty
profileProperty
face_keyProperty
face_keyProperty
occupancy_keyProperty
world_aabb_for_mountMethod
unregister_placed_nodeMethod
unregister_placed_node_localMethod
local_snapshotProperty
world_recordProperty
snapshotProperty
update_placed_nodeMethod
old_grid_cellProperty
new_grid_cellProperty
profileProperty
familyProperty
cellsProperty
edge_profileProperty
height_bandProperty
disposeMethod
clear_placement_registriesMethod
snapshot_placement_stateMethod
restore_placement_stateMethod
rehydrate_cell_objectMethod
yaw_stepsProperty
profileProperty
familyProperty
cellsProperty
mountProperty
rehydrate_edge_objectMethod
mountProperty
profileProperty
rehydrate_face_objectMethod
mountProperty
height_bandProperty
get_save_metadataMethod
get_placed_nodesMethod
cell_from_world_positionMethod
cell_from_world_pointMethod