unreal.UICommandsScriptingSubsystem

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

Bases: EngineSubsystem

UEditorInputSubsystem Subsystem for dynamically registering editor commands through scripting

C++ Source:

  • Plugin: SlateScripting

  • Module: SlateScriptingCommands

  • File: UICommandsScriptingSubsystem.h

can_execute_commands() bool

Checks whether commands registered in the subsystem can be executed

Return type:

bool

can_set_execute_commands(set_name) bool

Checks whether commands in the given set can be executed. This will also check CanExecuteCommands at a global scope

Parameters:

set_name (Name) –

Return type:

bool

get_available_contexts() Array[Name]

Retrieves the list of names for all contexts currently registered in the subsystem. This does not check whether the contexts are bound to any UI Command List.

Return type:

Array[Name]

get_binding_count_for_context(context_name) int32

Retrieves the number of UI Command Lists registered within this context through the subsystem. UI Command Lists are typically used to bind the list of commands associated with a single UI (i.e. a single viewport).

Parameters:

context_name (Name) –

Return type:

int32

get_registered_commands() Array[ScriptingCommandInfo]

Retrieves the list of command info for all commands currently registered in the subsystem

Return type:

Array[ScriptingCommandInfo]

is_command_registered(command_info, check_input_chord=True) bool

Checks whether the given command is registered within the subsystem. Using name, set and context for comparison

Parameters:
Return type:

bool

is_command_set_registered(set_name) bool

Checks whether the given set is currently registered in the subsystem

Parameters:

set_name (Name) –

Return type:

bool

is_context_registered(context_name) bool

Checks whether the context with the given name is currently registered in the subsystem This does not check whether the context is bound to any UI Command List.

Parameters:

context_name (Name) –

Return type:

bool

is_input_chord_mapped(context_name, input_chord) bool

Checks whether the given input chord is already mapped to a command in the given context. This includes commands not registered through the subsystem.

Parameters:
Return type:

bool

register_command(command_info, on_execute_command, override_existing=False) bool

Registers a command within the given context and set. The set must be registered beforehand.

Parameters:
  • command_info (ScriptingCommandInfo) – The command infos such as name, label, description and input chord.

  • on_execute_command (ExecuteCommand) – The delegate to be executed for handling this command.

  • override_existing (bool) – Whether existing command with matching context, set and name should be overriden

Returns:

Whether the command was succesfully registered

Return type:

bool

register_command_checked(command_info, on_execute_command, on_can_execute_command, override_existing=False) bool

Registers a command within the given context and set. The set must be registered beforehand.

Parameters:
  • command_info (ScriptingCommandInfo) – The command infos such as name, label, description and input chord.

  • on_execute_command (ExecuteCommand) – The delegate to be executed for handling this command.

  • on_can_execute_command (CanExecuteCommand) – The delegate to be executed for checking if this command can be executed.

  • override_existing (bool) – Whether existing command with matching context, set and name should be overriden

Returns:

Whether the command was successfully registered

Return type:

bool

register_command_set(set_name) bool

Registers a new command set

Parameters:

set_name (Name) –

Returns:

Whether the set did not already exist and was successfully registered

Return type:

bool

set_can_execute_commands(should_execute_commands) None

Sets whether commands registered in the subsystem can be executed

Parameters:

should_execute_commands (bool) –

set_can_set_execute_commands(set_name, should_execute_commands) None

Enables or disables execution of commands registered within the given set

Parameters:
  • set_name (Name) –

  • should_execute_commands (bool) –

unregister_all_sets() None

Unregisters all commands dynamically registered within all contexts and sets. warning: this will unregister all commands currently registered by this subsystem

unregister_command(command_info) bool

Unregisters a command previously registered. The command name, set and context will be used for comparison.

Parameters:

command_info (ScriptingCommandInfo) –

Returns:

Whether the command was successfully unregistered.

Return type:

bool

unregister_command_set(set_name) bool

Unregisters the corresponding command set with all commands registered within it

Parameters:

set_name (Name) –

Returns:

Whether the command set existed and was successfully unregistered

Return type:

bool