|
ArticyXImporter
ArticyXImporter for Unreal Engine
|
The ArticyImporter plugin for Unreal Engine provides a built-in Type System, which offers an optimized way to get meta-information about types, classes, and properties without using Unreal's built-in reflection system. The Articy Type System operates similarly to Unreal's reflection but is specifically tailored for working with Articy data types and is optimized for performance.
The Type System automatically generates and imports classes and types from Articy content, and allows you to access information about those types at runtime. It contains functionality to retrieve property data, type hierarchy information, template structures, and more.
You can access type information in Unreal Engine through the UArticyTypeSystem class, which stores metadata about each Articy class and its associated properties.
You can retrieve the type for any object by its name:
In this example, we retrieve the Entity type, and then iterate over its properties, printing the technical names of each property.
At the core of the type system is the FArticyType struct, which represents a single Articy class, enum, or template. It stores information about a specific type and includes methods to retrieve detailed property information.
In this example, we retrieve the Character type and iterate over its properties, logging the technical name and the property type.
FArticyPropertyInfo is a struct that holds information about an individual property within a type. This includes the technical name, property type, localization key, and whether the property belongs to a template.
You can use FArticyPropertyInfo to dynamically access or modify property values on Articy objects.
Here, we retrieve the Backstory property from the Character type and print its type.
The type system makes it easy to access properties within templates. Templates in articy:draft are treated as special classes in Unreal, with their own sets of properties (features). The GetPropertiesInFeature() method allows you to access all properties under a specific feature within a template.
In this example, we access all properties in the "Attributes" feature of the Character type.
Enums in articy:draft are handled by the type system as well, with support for retrieving enum values and their metadata. Each enum is treated as a separate type, and its values are represented by FArticyEnumValueInfo.
In this example, we retrieve the enum values for the WeaponType enum and log their display names and numeric values.
The ArticyImporter plugin's Type System in Unreal Engine provides a flexible and performant way to access metadata about Articy objects, templates, and enums. By leveraging FArticyType, FArticyPropertyInfo, and other components, you can dynamically access and manipulate Articy-generated content, reducing the need for hardcoded logic and improving your workflow when building complex narrative-driven projects.
This system is particularly useful for creating dynamic UI elements (e.g., character sheets), implementing data-driven gameplay mechanics, or building custom save systems based on Articy data.