Skip to content

Class

PlacementMount

Generated GDScript class reference for GridPlacement.PlacementMount.

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

Typed value object for how a placed 3D object is mounted. Replaces the untyped mount sub-dictionary that passed between [ObjectPlacementService3D] (save side) and [code]Demo3DPlacement ._on_placed_objects_restored[/code] (restore side). The mount type, cell, and edge/face keys now live on a typed object with a single [method apply_to] dispatch entry point, so adding a mount type (e.g. a corner socket) is a one-file change instead of editing the service, the persistence layer, and the demo reader. The placed [ScenePlacementEntry] is carried on [member entry] for the in-memory SAVE path ([method ObjectPlacementService3D.get_save_metadata] reads it), but it is intentionally EXCLUDED from [method to_dict] — a [Resource] does not survive a JSON round-trip, so on LOAD the entry is NOT in the saved dict and [method from_dict] leaves it null. The restore side therefore supplies the entry explicitly: the demo reads it from [member PlaceableInstance.placeable] and passes it to [method apply_to], exactly as the earlier restore did. The on-disk / cross-boundary representation stays a [Dictionary] (the save contract + its contract test are preserved): [method to_dict] / [method from_dict] own the string-key serialization, and [method get_save_metadata] still returns the [code]{ "mount": {...}, "entry": ... }[/code] shape.

Source: addons/grid_placement/systems/building/3d/placement_mount.gd

Syntax

class PlacementMount extends RefCounted

Members

NameKindSummary
KEY_TYPEFieldString keys used by [method to_dict] / [method from_dict]. Centralized so the service, persistence layer, and demo never spell them inline.
KEY_CELLField
KEY_EDGEField
KEY_FACE_NORMALField
KEY_YAW_STEPSField
typeProperty
cellProperty
edgeProperty
face_normalProperty
yaw_stepsPropertyFixed 90-degree yaw steps for cell mounts. A negative value means the source save predates yaw metadata and must recover it from the transform.
entryPropertyIn-memory only (save path). Null after a JSON [method from_dict].
for_cellMethod
for_edgeMethod
for_faceMethod
to_dictMethod
from_dictMethod
is_valid_dictMethod
apply_toMethod