unreal.NamingTokensEngineSubsystem

class unreal.NamingTokensEngineSubsystem(outer: Object | None = None, name: Name | str = 'None')

Bases: EngineSubsystem

An editor subsystem for registering global tokens and evaluating strings across the entire project.

C++ Source:

  • Plugin: NamingTokens

  • Module: NamingTokens

  • File: NamingTokensEngineSubsystem.h

clear_cached_naming_tokens() None

Clears all currently cached naming tokens. They will be loaded on demand when required. This can avoid an editor restart if a namespace is adjusted on a BP asset, and you don’t want the old namespace to access it.

evaluate_token_list(token_list, filter, contexts) Array[NamingTokenValueData]

Given a list of tokens, return a list of all found tokens and their values.

Parameters:
  • token_list (Array[str]) – A list of raw tokens. Tokens can include their namespace, but do not include brackets.

  • filter (NamingTokenFilterArgs) – [Optional] Filter to determine which namespaces to use.

  • contexts (Array[Object]) – [Optional] Context objects to pass to naming tokens.

Returns:

Evaluation data for each token.

Return type:

Array[NamingTokenValueData]

evaluate_token_string(token_string, filter, contexts) NamingTokenResultData

Parse and evaluate token string.

Parameters:
  • token_string (str) – The string containing unprocessed tokens.

  • filter (NamingTokenFilterArgs) – [Optional] Filter to determine which namespaces to use.

  • contexts (Array[Object]) – [Optional] Context objects to pass to naming tokens.

Returns:

The result of the evaluation.

Return type:

NamingTokenResultData

evaluate_token_text(token_text, filter, contexts) NamingTokenResultData

Parse and evaluate token text.

Parameters:
  • token_text (Text) – The text containing unprocessed tokens.

  • filter (NamingTokenFilterArgs) – [Optional] Filter to determine which namespaces to use.

  • contexts (Array[Object]) – [Optional] Context objects to pass to naming tokens.

Returns:

The result of the evaluation.

Return type:

NamingTokenResultData

get_all_namespaces() Array[str]

Retrieve all discovered namespaces.

Return type:

Array[str]

get_global_namespaces() Array[str]

Retrieve the registered global namespaces.

Return type:

Array[str]

get_multiple_naming_tokens(namespaces) Array[NamingTokens]

Lookup multiple naming tokens from multiple namespaces.

Parameters:

namespaces (Array[str]) – An array of all token namespaces.

Returns:

An array of matching tokens objects.

Return type:

Array[NamingTokens]

get_naming_tokens(namespace) NamingTokens

Lookup naming tokens given a namespace. This will look first in cached naming tokens, then native classes, then blueprint classes. Call ClearCachedNamingTokens to reset the cache and force a full lookup.

Parameters:

namespace (str) – The namespace of the tokens.

Returns:

The found Naming Tokens object, or nullptr.

Return type:

NamingTokens

get_naming_tokens_native(namespace) NamingTokens

Lookup naming tokens given a namespace. This will look first in cached naming tokens, then native classes. Call ClearCachedNamingTokens to reset the cache and force a full lookup.

Parameters:

namespace (str) – The namespace of the tokens.

Returns:

The found Naming Tokens object, or nullptr.

Return type:

NamingTokens

is_global_namespace_registered(namespace) bool

Checks if a namespace is registered globally.

Parameters:

namespace (str)

Return type:

bool

register_global_namespace(namespace) None

Register tokens as a global namespace. This prevents the need to include the namespace in a token string.

Parameters:

namespace (str) – The namespace of the tokens to register.

unregister_global_namespace(namespace) None

Remove tokens from a global namespace.

Parameters:

namespace (str) – The namespace of the tokens to unregister.