HammeriteBrushPropertyRegistry

Core: files, names and extension. Inherits RefCounted

Process-wide registry of the extendable brush property schemas addons have contributed.

This is the seam that lets hammerite-audio put acoustic properties on an air brush without hammerite-core ever hearing the word "reverb" - the same arrangement the entity-type registry already provides for entities, one level down, on the brushes themselves. It lives in CORE rather than in the editor on purpose. Values are serialized on the brush, so a shipped game reads them with no editor present, and the registry is what supplies the DEFAULT for every value the author never overrode. An addon must therefore register from its runtime facade (an autoload), not only from its editor plugin - otherwise a game build resolves defaults to null. See HammeriteAudio for the pattern. Static, because a schema describes code rather than data: it is the same for every map open in the process, and it must be answerable from HammeriteBrush.get_property() without a map in hand. Registration is idempotent by schema id, so re-initializing an addon replaces its schema instead of stacking duplicates - and keeps its place, so the inspector's sections do not move. Core's own schemas come first, then everything else in the order it was registered.

Methods

ReturnsMethod
voidregister(schema: HammeriteBrushPropertySchema) static
voidunregister(schema_id: StringName) static
voidclear() static
HammeriteBrushPropertySchema[]get_schemas() static
HammeriteBrushPropertySchemaget_schema(schema_id: StringName) static
HammeriteBrushPropertySchema[]get_schemas_for(brush: HammeriteBrush) static
HammeriteBrushPropertySchema[]get_common_schemas(brushes: HammeriteBrush[]) static
HammeriteBrushPropertyDef[]get_defs() static
HammeriteBrushPropertyDefget_def(key: StringName) static
boolhas_property(key: StringName) static
Variantget_default(key: StringName, fallback = null) static

Method descriptions

register()

static func register(schema: HammeriteBrushPropertySchema) -> void

Register schema, replacing any schema already registered under the same id.

unregister()

static func unregister(schema_id: StringName) -> void

Drop the schema registered under schema_id, if any.

clear()

static func clear() -> void

Forget every schema, core's included until something next asks. Test-support; production code registers once and leaves it.

get_schemas()

static func get_schemas() -> HammeriteBrushPropertySchema[]

Every registered schema: core's, then the rest in registration order. A copy.

get_schema()

static func get_schema(schema_id: StringName) -> HammeriteBrushPropertySchema

The schema registered under schema_id, or null.

get_schemas_for()

static func get_schemas_for(brush: HammeriteBrush) -> HammeriteBrushPropertySchema[]

The schemas whose tier filter admits brush - what the inspector shows for it.

get_common_schemas()

static func get_common_schemas(brushes: HammeriteBrush[]) -> HammeriteBrushPropertySchema[]

The schemas that admit EVERY brush in brushes - the editable set for a multi-selection. An empty selection has no common schemas.

get_defs()

static func get_defs() -> HammeriteBrushPropertyDef[]

Every declared def, of every schema, in the order the schemas were registered.

get_def()

static func get_def(key: StringName) -> HammeriteBrushPropertyDef

The def for namespaced key, or null if no addon declared it.

has_property()

static func has_property(key: StringName) -> bool

True when key has been declared by some registered schema.

get_default()

static func get_default(key: StringName, fallback = null) -> Variant

The declared default for key, or fallback when nothing declares it. This is what an un-overridden brush reads, so a schema whose defaults change retroactively changes every map that never touched the property - which is the intended trade for sparse storage.

Hammerite 1.0 · built from a6dd634, 2026-10-10