Documentation Home
Breadcrumbs

Commands

Commands

Creating a New Command

To create a new command in Skyreal VR:

  1. Create a new blueprint in your extension plugin that inherits from SkrSdkCommand.

  2. Create a data asset in the RegistrableAssets directory that inherits from SkrSdkCommandDescription.

  3. Set the Command property to your newly created command blueprint.

  4. Fill in the display name, icon texture, and specify whether it is VR-compatible, desktop-compatible, or both.

[IMAGE: Command data asset configuration — original at /pictures/v1.16/DataAssetNewCommand.png]

Setting Command Properties

Commands have properties that define default behaviors when launched. Open your command blueprint and find the properties in Class Defaults > Details > Skr.

[IMAGE: Command properties — original at /pictures/v1.16/CommandProperties.png]

Implementing Command Behavior

  1. Open your command blueprint.

  2. In the My Blueprint panel, click Override in the functions section.

  3. Select On Launched to implement the command launch behavior.

  4. Other overridable functions include On Canceled, button pressed/released events, and more.

[IMAGE: Command behavior implementation — original at /pictures/v1.16/CommandBehavior.png]

Adding User Interface

VR Context

VR commands use the Skyreal VR bracelet to display their UI — an interface attached to the user's wrist with multiple tabs.

[IMAGE: Bracelet UI example — original at /pictures/v1.16/VRContextBracelet.png]

To add bracelet tabs:

  1. Create a widget blueprint inheriting from SkrCustomizableCommandWidget.

  2. Customize the tab button in the Skr category of the Details tab in the Designer editor.

[IMAGE: Customize bracelet UI — original at /pictures/v1.16/CustomizeBraceletUI.png]

  1. Override the event Event Post Command and Command Description Init to bind UI with command behaviors.

[IMAGE: VR blueprint behavior — original at /pictures/v1.16/BehaviorVRBlueprint.png]

Desktop Context

For desktop, create a standard widget blueprint for viewport display.

Adding UI to the Command

After creating your UI widgets, reference them in the command blueprint under Class Defaults > Details > Skr > SDK.

[IMAGE: Add UI to command — original at /pictures/v1.16/AddInterfaceToCommand.png]

Command Manager

The SkrSdkCommandManager controls the command system. Use CreateAndLaunchCommandWithDefaultParams for most cases, or use the full creation API for advanced control.

[IFRAME: Command Manager blueprint sample — original at https://blueprintue.com/render/l66q0pm7/]