Commands
Creating a New Command
To create a new command in Skyreal VR:
-
Create a new blueprint in your extension plugin that inherits from SkrSdkCommand.
-
Create a data asset in the
RegistrableAssetsdirectory that inherits from SkrSdkCommandDescription. -
Set the Command property to your newly created command blueprint.
-
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
-
Open your command blueprint.
-
In the My Blueprint panel, click Override in the functions section.
-
Select On Launched to implement the command launch behavior.
-
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:
-
Create a widget blueprint inheriting from SkrCustomizableCommandWidget.
-
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]
-
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/]