AssetTagRegistry๏ƒ

Inherits: Object

Reverse index of asset paths by tag.

Description๏ƒ

Stores and queries per-asset tag assignments for editor search and MCP tools.

Methods๏ƒ

void

abort_batch()

Error

add_tags_to_asset(path: String, tags: PackedStringArray)

bool

asset_matches_tag_filter(path: String, tag_tokens: PackedStringArray, require_all: bool = true) const

void

begin_batch()

void

cancel_opened_batch()

Error

commit_batch()

PackedStringArray

find_assets_by_tag(tag: String, match_parent: bool = true) const

PackedStringArray

get_indexed_paths() const

PackedStringArray

get_tags_for_asset(path: String) const

PackedStringArray

get_unused_tags() const

Error

load()

void

prune_removed_paths()

Error

remove_tags_from_asset(path: String, tags: PackedStringArray)

bool

rename_asset_path(old_path: String, new_path: String)

Error

rescan()

Error

save()

void

schedule_prune_removed_paths()

Dictionary

search_assets(tags: PackedStringArray, type_filter: String = "", path_glob: String = "", path_regex: String = "", require_all: bool = true) const

Error

set_tags_for_asset(path: String, tags: PackedStringArray)


Signals๏ƒ

asset_tags_batch_changed(paths: PackedStringArray) ๐Ÿ”—

Emitted after a batch commit with the list of asset paths whose tags changed.


asset_tags_changed(path: String) ๐Ÿ”—

Emitted when tags change for a single asset path outside a batch.


index_reloaded() ๐Ÿ”—

Emitted when the asset tag index is reloaded from disk.


Method Descriptions๏ƒ

void abort_batch() ๐Ÿ”—

Discards the active index batch without persisting pending path changes.


Error add_tags_to_asset(path: String, tags: PackedStringArray) ๐Ÿ”—

Adds tags to the asset at path. Returns @GlobalScope.OK on success, or an Error if the update fails.


bool asset_matches_tag_filter(path: String, tag_tokens: PackedStringArray, require_all: bool = true) const ๐Ÿ”—

Returns true when the asset at path matches tag_tokens. When require_all is true, every token must match.


void begin_batch() ๐Ÿ”—

Starts a nested index batch so multiple asset tag mutations can be committed together.


void cancel_opened_batch() ๐Ÿ”—

Aborts every nested open batch and restores the previous index state.


Error commit_batch() ๐Ÿ”—

Ends one batch level and persists dirty index paths when the outermost batch closes. Returns @GlobalScope.OK on success, or an Error if saving fails.


PackedStringArray find_assets_by_tag(tag: String, match_parent: bool = true) const ๐Ÿ”—

Returns asset paths tagged with tag. When match_parent is true, hierarchical children of tag also match.


PackedStringArray get_indexed_paths() const ๐Ÿ”—

Returns every asset path currently present in the tag index.


PackedStringArray get_tags_for_asset(path: String) const ๐Ÿ”—

Returns the tags assigned to the asset at path.


PackedStringArray get_unused_tags() const ๐Ÿ”—

Returns dictionary tags that are not assigned to any indexed asset.


Error load() ๐Ÿ”—

Loads the asset tag index from disk. Returns @GlobalScope.OK on success, or an Error if the index cannot be read.


void prune_removed_paths() ๐Ÿ”—

Immediately removes index entries whose asset paths no longer exist on disk.


Error remove_tags_from_asset(path: String, tags: PackedStringArray) ๐Ÿ”—

Removes tags from the asset at path. Returns @GlobalScope.OK on success, or an Error if the update fails.


bool rename_asset_path(old_path: String, new_path: String) ๐Ÿ”—

Moves indexed tags from old_path to new_path. Returns true when the path was remapped.


Error rescan() ๐Ÿ”—

Rebuilds the reverse lookup from the current index and persists it. Returns @GlobalScope.OK on success, or an Error if saving fails.


Error save() ๐Ÿ”—

Persists the asset tag index to disk. Returns @GlobalScope.OK on success, or an Error if writing fails.


void schedule_prune_removed_paths() ๐Ÿ”—

Schedules a debounced call to prune_removed_paths().


Dictionary search_assets(tags: PackedStringArray, type_filter: String = "", path_glob: String = "", path_regex: String = "", require_all: bool = true) const ๐Ÿ”—

Searches indexed assets by tags with optional type and path filters. Returns a result dictionary containing matching paths and metadata.


Error set_tags_for_asset(path: String, tags: PackedStringArray) ๐Ÿ”—

Replaces all tags on the asset at path with tags. Returns @GlobalScope.OK on success, or an Error if the update fails.