readyplayerme / rpm-unreal-avatar-creator

Ready Player Me Avatar Creator for Unreal Engine
MIT License
12 stars 5 forks source link

Ready Player Me Avatar Creator DEPRECATED

This repository has been deprecated as it has been merged into Ready Player Me SDK.

Please note that this repository is no longer actively maintained or supported. We recommend that you update to Ready Player Me SDK 2.0 or later.

For historical purposes, the code and documentation will remain available in this repository.

Screenshot 2023-09-01 093029

Ready Player Me Avatar Creator is an extension to Ready Player Me avatar platform, which helps you create avatars.

The RpmAvatarCreator plugin is an in-engine implementation of the web avatar creator.

Please visit the online documentation and join our public discord community.

Online Documentation

Discord Channel

Important

Dependencies

Requirements

Integration

Avatar Creator plugin depends on the Ready Player Me Unreal SDK, follow the setup steps in the Documentation or the Readme for setting it up before adding the RpmAvatarCreator plugin.

Add RpmAvatarCreator plugin

To add the RpmAvatarCreator plugin to your project:

(Optional) Add RpmAvatarCreator plugin as submodule

Alternatively, instead of direct download, you can add the plugin to your git-managed project as a submodule. To do so, run the following command in the terminal from your project folder.

   git submodule add --name Plugins/RpmAvatarCreator -- https://github.com/readyplayerme/rpm-unreal-avatar-creator.git Plugins/RpmAvatarCreator

Quick Start

A demo map is included in the plugin for demonstrating how the Sample Avatar Creator opens at runtime. It is located in the RpmAvatarCreator\Content\Maps folder. The avatar creator will not run properly until the AppId and Subdomain of your application are set in the project settings. You can find them in Ready Player Me Studio website. The AppId and Subdomain should belong to the same application otherwise the avatar creator will fail. To add the AvatarCreator widget to your project, copy the existing blueprint logic from the demo map into your project.

AvatarCreator is a widget that can be added to a map or another widget. Inside the AvatarCreatorDemo map, we create and add the widget to the viewport. We need to subscribe to the Avatar Saved event to get the URL when the avatar is saved. We need to subscribe to the Avatar Selected event as well to get the URL when the avatar is selected from the list of user avatars. Additionally, we can load an avatar with this URL afterward.

Screenshot 2023-09-01 093125

Additionally, if the close button is enabled, we can subscribe to the Close Button Clicked event to be notified when the close button is clicked. This way we can close the widget and perform other actions.

Customization Options

Use the Sample project

When spawning the Avatar Creator widget, it's possible to configure it with the specified parameters.

Customization options:

The sample also provides a function Override Preview Avatar that allows customization for the render environment and actor. It can also be used to simulate a mirror in VR. Duplicate the default render actor, modify it and use your actor instead. If not set, the default render actor will be spawned.

Custom Sample UI

The plugin Content represents a sample project, if you want to have a completely different UI, you can duplicate the sample project and change the UI. In this case, you will not be able to get the latest changes to this sample project UI.

CustomizationGuide.md document describes the ways of making a custom UI for the avatar creator.

The structure of the sample is described in detail in the SampleStructure.md document.

TODO

Webcam support

Webcam functionality is currently available only on the Windows platform when using Unreal Engine 4.27. However, Unreal Engine 5 experiences issues with Webcam support. To make the webcam work in Unreal Engine 5, a workaround is available, which involves changing the Default RHI property to DirectX 11. However, this change may result in the disabling of certain Unreal Engine 5 features. if webcam support is required for mobile platforms, you will need to either create a platform-specific webcam functionality or add an external plugin.

File Picker

The sample doesn't provide an option to pick an image file that would be used for generating an avatar according to the image. This is done to keep the sample project simple. Depending on the target platform, the file picker functionality and dependencies will be different.

In case you require file picker functionality, you can either add an external plugin or create a platform-specific file picker. After implementing the platform-side file-picking functionality, convert the selected image to a base64 string and pass it to the Base64Image property of the AvatarProperties in the AvatarCreatorApi. After implementing the file-picking logic, you will need to modify the WBP_RPM_SelfieSuggestion widget and include a button for picking images.

Links