Render API

The following API is currently experimental. For use in critical production environments, please let us know at [email protected].

Ready Player Me Render API allows creating 2D images of Ready Player Me avatars.

POST: https://render.readyplayer.me/render Content-type: JSON Request format:

  • model : (string, required) – Avatar 3D model URL.

  • scene : (string, required) – Name of the scene to render. Possible values: halfbody-portrait-v1, fullbody-portrait-v1

  • blendShapes : (object, optional) – Map of 3D meshes to their blend shapes. For example, the following would set mouthSmile and browInnerUp blend shapes of the avatar's head. The blend shapes need to exist on the designated meshes to be applied. In case you're using atlased avatars, replace "Wolf3D_Head" with "Wolf3D_Avatar".

{
"Wolf3D_Head": {
"mouthSmile": 0.2
}
}
  • armature : (string, optional) – Armature object name to use as a pose for a character. If not specified, the avatar will have a generic pose. Possible values: ArmatureTargetMale, ArmatureTargetFemale

Response format:

  • renders : (array) – List of output renders URLs (at least one).

Example response:

{
"renders": [
"https://example.com/render.png"
]
}

Examples

Simplest request

{
"model": "https://example.com/model.glb",
"scene": "halfbody-portrait-v1"
}

Render a half-body (VR) avatar profile picture

The following request would render an avatar in the scene halfbody-portrait-v1 and make the avatar smile in the render.

{
"model": "https://example.com/model.glb",
"scene": "halfbody-portrait-v1",
"armature": "ArmatureTargetFemale",
"blendShapes": {
"Wolf3D_Head": {
"mouthSmile": 0.2
}
}
}

Example image result:

Render a full-body avatar profile picture

The following request would render an avatar in the scene fullbody-portrait-v1 and make the avatar smile in the render and apply a male pose.

{
"model": "https://example.com/model.glb",
"scene": "fullbody-portrait-v1",
"armature": "ArmatureTargetMale",
"blendShapes": {
"Wolf3D_Head": {
"mouthSmile": 0.2
}
}
}

Example image result:

Client-side JavaScript Code Example

Render API is fully CORS-enabled. An example of client-side code could look like this:

<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<button onclick="return render()">Render</button>
</body>
<script>
function render()
{
const params =
{
model: "https://example.com/model.glb",
scene: "fullbody-portrait-v1",
armature: "ArmatureTargetMale",
blendShapes: {}
}
const http = new XMLHttpRequest()
http.open("POST", "https://render.readyplayer.me/render")
http.setRequestHeader("Content-type", "application/json")
http.send(JSON.stringify(params))
http.onload = function()
{
// Do whatever with response
alert(http.responseText)
}
}
</script>
</html>

Python Code Example

An example of Python code could look like this:

import requests
if __name__ == "__main__":
r = requests.post(
"https://render.readyplayer.me/render",
json={
"model": "https://example.com/model.glb",
"scene": "fullbody-portrait-v1",
"armature": "ArmatureTargetMale",
"blendShapes": {}
},
headers={
"Content-Type": "application/json",
}
)
print(r.content)