Implementing the SDK into Your Project

Updated: 09/05/2024

This tutorial covers the process of implementing an embeddable model file exported from Cubism Editor into an Unreal Engine project and displaying the model on the viewport.

Prerequisites

To use the Cubism SDK for Unreal Engine, you need to install the Unreal Engine 5.3 series and the Cubism SDK for Unreal Engine.
For information on installing Unreal Engine, click here.
The Cubism SDK for Unreal Engine can be downloaded here.
The Cubism SDK for Unreal Engine is distributed as a plugin for Unreal Engine.
See the official document for Unreal Engine for more information on how the plugin works.

When working with Live2D models in the SDK, you need to export them as built-in models, not as .cmo3 or .can3 for editing.
See “Data for Embedded Use” for information on how to export models for embedded use.
The data to be exported are the .moc3 file, the .model3.json file, and the folder containing the textures.
Please keep these in one folder.

Adding the plugin to project files

In the following, we assume that you have created a UE project named CubismSDKForUE.
When creating a project, it is recommended to select C++ in the project configuration.
The directory of the created project will generally look like the following, so create a Plugins folder in the root directory and place the plugin under it.

CubismSDKForUE
├── Binaries
├── Config
├── Content
│   └── ...
├── Plugins <- ディレクトリを追加
│   └── CubismUnrealEngineComponents <- プラグインをここに配置する
│       └── ...
├── Source
└── CubismSDKForUE.uproject

Open the CubismSDKForUE.uproject file in a text editor or a similar piece of software, add Live2DCubismSDK to the Plugins properties, and set Enabled to true.
After adding the plugin, overwrite and save the file.

{
	"FileVersion": 3,
	"EngineAssociation": "5.2",
	"Category": "",
	"Description": "",
	"Modules": [
		{
			"Name": "CubismSDKForUE",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	],
	"Plugins": [
		{
			"Name": "ModelingToolsEditorMode",
			"Enabled": true,
			"TargetAllowList": [
				"Editor"
			]
		},
		{
			"Name": "Live2DCubismSDK",
			"Enabled": true
		}
	]
}

Then double-click the saved .uproject file to start the project, and when the build is complete, the SDK implementation is complete.

Importing models into your project

Drag a folder of a series of embeddable model data exported from Cubism Editor to Unreal Editor’s content browser.

After successful importing, all embeddable model files have been converted to uasset asset files for Unreal Engine.
Each asset can be double-clicked to view its contents in Unreal Editor.

Drag the CubismModelJson asset corresponding to model3.json from the converted assets to the Unreal Editor viewport to spawn the CubismModel actor.

Was this article helpful?
YesNo
Please let us know what you think about this article.