Skip to content

Malcolmnixon/GodotReadyPlayerMeAvatar

Repository files navigation

Godot ReadyPlayerMe Avatar

GitHub forks GitHub Repo stars GitHub contributors GitHub

This repository contains a Ready Player Me avatar loader for Godot that can load avatars at runtime from the internet or local files, and can configure them to be driven through the XR tracker system.

Avatar Demo

Versions

Official releases are tagged and can be found here.

The following branches are in active development:

Branch Description Godot version
master Current development branch Godot 4.3-dev6+

Overview

Ready Player Me is an avatar system for games, apps, and VR/AR experiences. Avatars can be created online through the web interface; and then downloaded over a REST interface.

The Godot ReadyPlayerMe Avatar plugin supports downloading avatars given their avatar ID. The avatars are downloaded and parsed in the background and then provided to the user code as nodes ready for adding to a scene.

Usage

The following steps show how to add the Godot ReadyPlayerMe Avatar plugin to a project.

Enable Plugin

The addon files need to be copied to the /addons/godot_rpm_avatar folder of the Godot project, and then enabled in the Plugins under the Project Settings: Enable Plugin

Once enabled, the rpm_loader.gd script will be configured as an autoload node called RpmLoader.

Configuring Avatars

An RpmSettings resource is used to configure how avatars are loaded: RPM Settings

  • body_tracker - The name of the XRBodyTracker to drive the avatar
  • face_tracker - The name of the XRFaceTracker to drive the avatar
  • quality - Quality of the avatar to load

Load Signals

The RpmLoader signals are emitted to report load events:

# Subscribe to load events
RpmLoader.load_complete.connect(_on_load_complete)
RpmLoader.load_failed.connect(_on_load_failed)

# Handle load success
func _on_load_complete(id : String, avatar : Node3D) -> void:
    add_child(avatar)

# Handle load failed
func _on_load_failed(id : String, reason : String) -> void:
    print("Failed to load avatar ", id, " because ", reason)

Load Methods

The RpmLoader exposes methods to load the avatars:

# Start loading avatar "65fa409029044c117cbd3e3c" from the web
RpmLoader.load_web("65fa409029044c117cbd3e3c")

# Start loading avatar "66039f031791600d6e5147b0" from file
RpmLoader.load_file("C:/temp/66039f031791600d6e5147b0.glb", "66039f031791600d6e5147b0")

Avatar Format

All avatars must be in the T pose or the avatar will be corrupted. The load_web method provides the following download parameters:

Parameter Value
quality low / medium / high
pose T
morphTargets Default / ARKit

See the ReadyPlayerMe 3D Avatars Rest API documentation for a complete list of parameters.

Licensing

Code in this repository is licensed under the MIT license.

About this repository

This repository was created by Malcolm Nixon

It is primarily maintained by:

For further contributors please see CONTRIBUTORS.md