Documentation Home
v1.22 v1.23
v1.22 v1.23

Extension of extension

Extension of an Extension

An extension can expose an extension point: a list of entries that other extensions fill, without modifying it. For example, a "Presets" extension lets a customer extension add its own presets.

Extension

Contains

Role

Base extension

A Primary Data Asset (PDA) class, in RegistrableAssets/PDA

Defines what an entry is, and uses the entries.

Dependent extension

Data assets of that class, in RegistrableAssets

Provides the entries.

Why a Primary Data Asset, and why the PDA folder

This is the key point of the system. Two reasons:

  1. It is the only way to define your own data asset type in Blueprint. Unreal only lets you create data asset instances from a Blueprint class if it inherits from Primary Data Asset. That class is the "form" each entry fills.

  2. The class must be loaded before the entries. Skyreal finds registrable assets with one scan per loading phase, and it can only recognize a data asset if its class is already loaded. This is why the class goes in RegistrableAssets/PDA: Skyreal loads these folders first (Pre Init), then scans the RegistrableAssets folders (Init). If the class is anywhere else, the entries of other extensions can be ignored without any error.

PDA load order

Skyreal uses the same mechanism, for example with PDA_CoordinateSystem (SkrBase) and PDA_LinkedAnimGraph (manikins).

Create the extension point (base extension)

  1. In your extension, create the folder Content/RegistrableAssets/PDA.

  2. Create a Blueprint whose parent class is Primary Data Asset, for example PDA_MyPreset, and save it in this folder.

  3. In Class Settings, add the SkrAutoRegisteringAsset interface.

  4. Implement Get Should Auto Register Asset and return true (or a Boolean variable, to let each entry choose). Without it, no entry is registered.

  5. Add the variables each entry will fill, then compile and save.

Use the entries (base extension)

  1. Get the Skr Registery Subsystem.

  2. Call Get Registered Data Asset with your PDA class (PDA_MyPreset).

  3. Use the returned entries to build your presets, tools, commands…

If extensions can be loaded or unloaded while Skyreal is running, also listen to the registry's Registered Data Assets Added and Removed events to stay up to date.

Add entries (dependent extension)

  1. In the dependent extension's .uplugin file, add the base extension as a dependency.

  2. In the Content Browser: Miscellaneous › Data Asset, then pick the base extension's class (PDA_MyPreset).

  3. Fill its variables and save it in Content/RegistrableAssets (not in PDA).

  4. List both extensions in SkrExtensions.json.

Skyreal uses the .uplugin dependencies to load the base extension first. It does not add a missing extension to SkrExtensions.json for you.

Common issues

Symptom

Check

An entry is missing, with no error

The PDA class is in RegistrableAssets/PDA of the base extension, and Get Should Auto Register Asset returns true.

The base class cannot be found

The base extension is listed in SkrExtensions.json and declared as a dependency in the dependent extension's .uplugin.

An entry is not registered

The data asset is under RegistrableAssets of the dependent extension.

A referenced asset is missing

An extension may only reference its own content or its dependencies' content. Engine assets and Unreal plugins that are not extensions are not guaranteed.

Avoid circular dependencies: the base extension must never depend on the extensions that provide its entries.