Skip to content

Class

PlacementValidationContext

Generated GDScript class reference for GridPlacement.PlacementValidationContext.

Status
Current
Version
v6.3.0
Source updated
2026-10-29
Generated on
2026-10-29

6.3. These pages document the 6.3 release, where placeable is now entry (what changed) and PlacementOwner is deprecated (migration). Still on 6.2? Your version's guides ship inside the plugin itself, under addons/grid_placement/guides/; the 6.2 URLs on this site now redirect to this series.

Context object carrying all necessary data for placement validation. Supports both object-based (via indicators) and terrain-based (via cells) validation.

Source: addons/grid_placement/placement/placement_rules/placement_validation_context.gd

Syntax

class PlacementValidationContext extends RefCounted

Members

NameKindSummary
action_typePropertyThe type of action being validated.
cellPropertyThe cell being validated.
cell_3dPropertyThe 3D cell being validated. Set only by for_terrain_3d(); the 2D cell stays at its default so 2D-only rules never observe a 3D paint through a 2D coordinate.
terrain_namePropertyThe terrain name (if in PAINT_TILE mode).
scene_entryPropertyThe scene_entry resource (if in PLACE_OBJECT mode).
preview_cellsPropertyAll cells currently being placed/previewed (for adjacency checks in a brush). Also known as batch cells.
preview_cells_3dProperty3D batch cells for multi-cell 3D terrain validation. Set only by for_terrain_3d().
indicatorPropertyThe indicator being validated (if in PLACE_OBJECT mode).
target_mapPropertyThe target TileMapLayer.
target_map_3dPropertyThe target GridMap for 3D terrain validation. Set only by for_terrain_3d().
is_3dPropertyTrue when this context describes a 3D terrain paint. The validation pipeline runs only rules that opt into 3D (see TilePaintRule.supports_3d_terrain()) so 2D-only rules never observe 3D coordinates they cannot interpret.
targeting_statePropertyReference to the targeting state for occupancy and collision queries.
world_registry_2dPropertyOptional game-owned provider for placement-relevant world/physics facts. Grid Placement consumes this abstraction but does not own the backend (Godot Physics, Avian 2D, custom simulation, etc.). The committed-world registry for this context, when one is reachable. Rules that need "is a placed object here?" ask this instead of a physics query: it is the authority, and unlike the physics space it answers before the world's first step (#1886).
world_facts_provider_2dProperty
shared_cachePropertyPer-batch scratch cache shared across every cell context in one multi-cell validation pass (line/rect/outline/flood). Rules memoize expensive, cell-independent resolutions here (e.g. a terrain's collision polygons) so a batch resolves them once instead of once per cell. Empty for single-cell validation. Lifetime = one batch; never global static state.
for_terrainMethod
ctxProperty
for_terrain_3dMethod
ctxProperty
for_objectMethod
ctxProperty