https://github.com/gwaredd/yamldataasset
An Unreal Editor plugin that lets you import and export UDataAsset's as yaml files.
https://github.com/gwaredd/yamldataasset
json unreal unreal-engine-5 yaml
Last synced: 4 months ago
JSON representation
An Unreal Editor plugin that lets you import and export UDataAsset's as yaml files.
- Host: GitHub
- URL: https://github.com/gwaredd/yamldataasset
- Owner: gwaredd
- License: other
- Created: 2024-12-15T16:49:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-10T10:29:04.000Z (over 1 year ago)
- Last Synced: 2025-04-03T10:18:52.344Z (about 1 year ago)
- Topics: json, unreal, unreal-engine-5, yaml
- Language: C++
- Homepage:
- Size: 245 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YamlDataAsset
A plugin for the Unreal Editor that allows you to convert between UDataAssets and YAML files.
This makes it easier to swap between Unreal and external data sources.
## Installation
* Like any plugin, clone this repository into the `Plugins` directory and compile into your project.
* You may also need to enable it in the plugins settings (`Edit->Plugins->Project->Editor`).
## Usage
### To Import
* Drop a YAML file into the content browser.
* Select the asset type from the list.
* Click OK.

### To Export
* Choose export from the `Asset Actions` menu, choose YAML.

## Example
### UMyDataAsset
```c++
UCLASS( BlueprintType )
class UMyDataAsset : public UDataAsset
{
GENERATED_UCLASS_BODY()
UPROPERTY( EditAnywhere )
FName Name;
UPROPERTY( EditAnywhere )
TArray SomeNumbers;
};
```
### YAML
```yaml
Name: MyName
SomeNumbers:
- 4
- 8
- 15
- 16
- 23
- 42
```
The plugin uses the Unreal reflection system walk the properties and set the values. It is recursive, so it will work with nested structures, collections and compound types. Property names are case-insensitive.
## Notes
### __uclass
You can put a `__uclass` property at the top of the file to let the plugin know the class to use. If the UDataAsset exists then it will skip the dialog box. For example:
```yaml
__uclass: MyDataAsset
Name: MyName
SomeNumbers:
- 4
- 8
- 15
- 16
- 23
- 42
```
### Asset References
You can set pointers to assets by setting the reference as a string in the yaml (right click on the asset in the content browser and select `Copy Reference`).
For example:
```c++
UPROPERTY( EditAnywhere )
TWeakObjectPtr MyAssetReference;
};
```
```yaml
MyAssetReference: /Script/MyProject.MyDataAsset'/Game/Assets/MyDataAsset.MyDataAsset'
```
### Compound Keys
A `TMap` with a compound key type (a struct as a key, e.g. `TMap`) is not supported. Whilst this is allowed in Unreal, JSON (and therefore YAML) only allows strings for keys (this is a JavaScript limitation). Note that value types will be automatically converted.