Avatar Creator Integration
Integrate the Ready Player Me Avatar Creator in your React application.
In the Quickstart guide, you were introduced to the process of integrating the AvatarCreatorViewer component. This aims to get started quickly on the entire flow of creating and loading an avatar.
In case you want to visualize your avatar separately from the creator, you can use AvatarCreator
component to receive configured Avatar URL and load it with your custom visualization layer.
Import and show the AvatarCreator
Once the package is installed (see Quickstart), you can import the AvatarCreator
component and bring it to your React project. You will be expected to pass your subdomain as a parameter to the component.
Configure the AvatarCreator
When you use Ready Player Me in an iframe, you can use certain URL parameters to customize it to fit your use case. AvatarCreator
component can take an editorConfig parameter which helps you with this.
bodyType
"halfbody" | "fullbody"
Instead of select page, starts with given option.
clearCache
boolean
If disabled previous avatar will not be loaded.
Configure the avatar output (Optimize for quality / speed)
The AvatarCreator returns a URL to an avatar .glb file. A sample URL looks like that:
With the Avatar API, it is possible to pass various parameters to this URL to request a better-optimized, but lower-quality avatar - which could result in an avatar URL like this with a meshLod=2
To achieve this within your project, you can now pass an avatar config to the AvatarCreator component, which adds necessary parameters to the exported avatar URL to help you download or import with a set of optimization options. You can read more about these options here.
quality
"low" | "medium" | "high"
Quality presets.
meshLod
0 | 1 | 2
Changes mesh detail.
textureSizeLimit
number
Maximum size for each texture.
textureAtlas
"none" | 256 | 512 | 1024
Size of atlased texture.
textureChannels
array
Texture channels to load.
morphTargets
array
Morph targets to load.
pose
"A" | "T"
Avatar pose.
useHands
boolean
Use halfbody avatar hands.
useDracoCompression
boolean
Use Draco compression.
useMeshOptCompression
boolean
Use Mesh Opt compression.
Receive the results from AvatarCreator
You can pass AvatarCreator
callbacks to receive exported avatar's URL and the user's ID.
Last updated