HammeriteEntity

Core: the map. Inherits Resource

One placed thing in a HammeriteMap that is not world geometry: a light, a prop, a spawn point.

An entity is data - a registered type, a classname and a properties bag - and HammeriteMap3D builds a node for it by looking the classname up as a class_name. A point entity stands at origin; a HammeriteBrushEntity owns brushes instead. Make one and add it to a map in one call with HammeriteMap.create_entity(); make() makes one that is not in a map yet. selected, hovered, hidden and temporary_transform are the editor's state, never saved.

Properties

TypeNameDefault
intgroup_id0
boolhidden
boolhovered
intid0
intinstance_id0
intlayer_id0
HammeriteMapmap
Vector3origin
intprefab_id0
Dictionaryproperties{}
boolselected
Transform3Dtemporary_transform
StringNametype&""

Methods

ReturnsMethod
voidclear_property(prop_name: StringName)
Stringeditor_only_prefix() static
AABBget_aabb(center_on_origin: bool = true)
Basisget_basis()
HammeriteEntityBoxget_box()
StringNameget_classname()
Variantget_property(prop_name: StringName, default = null)
Vector3get_scale()
Transform3Dget_transform()
boolhas_property(prop_name: StringName)
boolis_box_turned()
boolis_editor_only(prop_name) static
boolis_scalable()
boolis_turnable()
StringNamekey_box_basis() static
StringNamekey_rotation() static
StringNamekey_scale() static
floatleast_scale() static
HammeriteEntitymake(typename: StringName) static
boolmay_turn_about(axes: String, axis: Vector3) static
voidrequest_delete()
Vector3rotation_of(basis: Basis) static
voidset_property(prop_name: StringName, value)
voidset_property_no_emit(prop_name: StringName, value)
voidtransform_by(transform: Transform3D)

Signals

delete_requested

signal delete_requested()

Emitted by request_delete(). The owning HammeriteMap listens and removes the entity.

group_changed

signal group_changed()

Emitted when group_id has changed.

hidden_changed

signal hidden_changed(hidden: bool)

Emitted when hidden is set, with the new value: true when the entity has been hidden.

hover_changed

signal hover_changed(hovered: bool)

Emitted when entity hover state has changed.

layer_changed

signal layer_changed()

Emitted when layer_id has changed.

property_changed

signal property_changed(prop_name: StringName, value)

Emitted by set_property() and clear_property(), and for each value that changes when properties is assigned whole. Not emitted by set_property_no_emit(), or by writing into the dictionary directly.

selection_changed

signal selection_changed(selected: bool)

Emitted when entity selection state has changed.

temporary_transform_changed

signal temporary_transform_changed(transform: Transform3D)

Emitted when temporary transform has changed (used during transform tool operations).

Property descriptions

group_id

var group_id: int = 0

The editor group this entity is selected together with, or 0 for none. Emits group_changed.

hidden

var hidden: bool

Hidden by an editor tool, not saved. Emits hidden_changed.

hovered

var hovered: bool

Editor hover state, not saved. Emits hover_changed.

id

var id: int = 0

Unique within its map, from HammeriteMap.gen_entity_id(). 0 means unassigned, and HammeriteMap.add_entity() refuses it.

instance_id

var instance_id: int = 0

The HammeritePrefabInstance.instance_id this entity belongs to, or 0 if none.

layer_id

var layer_id: int = 0

The HammeriteLayer this entity is on; it is present in the world only while that layer is (HammeriteMap.is_entity_present()). Emits layer_changed.

map

var map: HammeriteMap

The map this entity belongs to. Held weakly, as a brush holds its map (see HammeriteBrush.map).

origin

var origin: Vector3

Where a point entity stands, in map space: the origin property. Setting it goes through set_property(), so it emits property_changed.

prefab_id

var prefab_id: int = 0

The HammeritePrefab.prefab_id of the prefab this entity was placed from, or 0 if it is not part of a prefab instance.

properties

var properties: Dictionary = {}

The entity's authored values, keyed by StringName. Keys starting with editor_only_prefix() are dropped on assignment. Prefer set_property(), which emits property_changed.

selected

var selected: bool

Editor selection state, not saved. Emits selection_changed.

temporary_transform

var temporary_transform: Transform3D

Temporary transform applied during transform tool operations. This allows preview without recalculating geometry. Not saved; identity when no tool is using it.

type

var type: StringName = &""

The registered entity type this was made as (e.g. &"prop_model"), which names its editor registration and defaults. Distinct from the classname property, which names the node class built for it.

Method descriptions

clear_property()

func clear_property(prop_name: StringName) -> void

Forget this entity's own value of prop_name, so it reads its type's default again, and emit property_changed with that default.

editor_only_prefix()

static func editor_only_prefix() -> String

A type's registration also carries what the editor draws it with - its icon, its tint - under this prefix. That belongs to the type, never to one entity of it: a copy on the entity is an editor asset baked into the map, and it goes stale the moment the type's picture changes.

get_aabb()

func get_aabb(center_on_origin: bool = true) -> AABB

The entity's axis-aligned box from its _aabb property, sized by get_scale(). Placed at origin when center_on_origin, otherwise relative to it. When it is turned (is_box_turned()) this is the box enclosing the turned one. Empty for a type with no _aabb, which includes brush entities.

get_basis()

func get_basis() -> Basis

key_rotation() as a basis: identity for an entity that is not turned, or cannot be.

get_box()

func get_box() -> HammeriteEntityBox

The box it fills, turned if it is turned. What the editor draws and what a click is tested against.

Experimental: HammeriteEntityBox is not part of the supported API.

get_classname()

func get_classname() -> StringName

The classname property: the class_name of the node built for this entity, or empty if it has none.

get_property()

func get_property(prop_name: StringName, default = null) -> Variant

The value of prop_name: this entity's own, else its type's registered default, else default - as HammeriteBrush.get_property() and HammeriteSkybox.get_property() read theirs.

get_scale()

func get_scale() -> Vector3

key_scale(): one along each axis for an entity that is not sized, or cannot be. Never less than least_scale(), and never mirrored - a mesh turned inside out is lit from the wrong side.

get_transform()

func get_transform() -> Transform3D

What a point of the entity's own goes through to stand in the world: sized along its own axes, then turned, then put where the entity is.

has_property()

func has_property(prop_name: StringName) -> bool

Whether this entity holds its own value of prop_name, rather than its type's default.

is_box_turned()

func is_box_turned() -> bool

Whether this entity's box is turned, and so whether asking for the AABB loses something.

is_editor_only()

static func is_editor_only(prop_name) -> bool

Whether prop_name starts with editor_only_prefix() and so belongs to the type's registration, not to a saved entity.

is_scalable()

func is_scalable() -> bool

Whether this entity carries a size of its own - whether its type lets it be sized at all.

is_turnable()

func is_turnable() -> bool

Whether this entity carries a turn of its own - whether its type lets it be turned at all.

key_box_basis()

static func key_box_basis() -> StringName

Which way this entity's box is turned. Identity - no turn at all - for almost everything.

key_rotation()

static func key_rotation() -> StringName

Which way the entity itself is turned (#77), as Euler angles in degrees - what Node3D.rotation_degrees holds, so a value typed into the property panel reads the way Godot's own does. Only on a type that declares it may be turned (_editor_rotation_axes in its registration); everything else has no such property and faces the way it was made.

key_scale()

static func key_scale() -> StringName

How far the entity itself is stretched along each of its own axes, before it is turned - what Node3D.scale holds. Only on a type that declares it may be sized, by carrying this in its registration; everything else has no such property and is the size it was made.

least_scale()

static func least_scale() -> float

The least an entity may be sized to along an axis: nothing has no inverse, and a mesh of no depth has no inside to be lit from.

make()

static func make(typename: StringName) -> HammeriteEntity

A new entity of typename: a HammeriteBrushEntity for a brush type, carrying every property the type declares at its default (HammeriteEntityTypeRegistry). It has no id and is in no map; HammeriteMap.create_entity() gives it both.

may_turn_about()

static func may_turn_about(axes: String, axis: Vector3) -> bool

Whether axes - a type's _editor_rotation_axes, some of "xyz" - lets it turn about axis: a world axis the turn is about, or near enough to one.

request_delete()

func request_delete() -> void

Ask the owning map to remove this entity, by emitting delete_requested. Does nothing before the entity is added to a map.

rotation_of()

static func rotation_of(basis: Basis) -> Vector3

basis as what key_rotation() stores: degrees, and near-whole numbers rounded to them, so a quarter turn made with the tool reads 90 rather than 89.99999.

set_property()

func set_property(prop_name: StringName, value) -> void

Store value and emit property_changed, which the entity's node listens to. An editor-only key (is_editor_only()) belongs to the type and is refused.

set_property_no_emit()

func set_property_no_emit(prop_name: StringName, value) -> void

Store value without emitting property_changed, so the node does not hear of it. Refuses an editor-only key, as set_property() does.

transform_by()

func transform_by(transform: Transform3D) -> void

Carry this entity through transform, as a prefab instance carries what it holds: its origin moved, and - where it can be turned - its turn turned with it. Only the turn of transform is taken; an entity is sized by its own key_scale(), never by what it stands in.

Hammerite 2.0 · built from 6d57ab2d, 2026-10-17