Skip to content

Class

PlacementMount

Generated GDScript class reference for GridPlacement.PlacementMount.

Status
Current
Version
v6.2.1
Source updated
2026-09-24
Generated on
2026-10-22

Typed value object for how a placed 3D object is mounted. Replaces the untyped mount sub-dictionary that passed between ObjectPlacementService3D (save side) and Demo3DPlacement ._on_placed_objects_restored (restore side). The mount type, cell, and edge/face keys now live on a typed object with a single 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 entry for the in-memory SAVE path (ObjectPlacementService3D.get_save_metadata() reads it), but it is intentionally EXCLUDED from to_dict() — a Resource does not survive a JSON round-trip, so on LOAD the entry is NOT in the saved dict and from_dict() leaves it null. The restore side therefore supplies the entry explicitly: the demo reads it from PlaceableInstance.placeable and passes it to 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): to_dict() / from_dict() own the string-key serialization, and get_save_metadata() still returns the { "mount": {...}, "entry": ... } shape.

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

Syntax

class PlacementMount extends RefCounted

Members

NameKindSummary
KEY_TYPEFieldString keys used by to_dict() / from_dict(). Centralized so the service, persistence layer, and demo never spell them inline.
KEY_CELLField
KEY_EDGEField
KEY_FACE_NORMALField
KEY_CORNERField
KEY_YAW_STEPSField
typeProperty
cellProperty
edgeProperty
face_normalProperty
cornerProperty
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 from_dict().
for_cellMethod
for_edgeMethod
for_faceMethod
for_topMethod
for_cornerMethod
to_dictMethod
from_dictMethod
is_valid_dictMethod
apply_toMethod