Measurements Meet Imagination: Creating accurate 3D Avatars with Meshcapade’s API

Denis
Meshcapade
Published in
3 min readJun 6, 2023
Avatars created from measurements in motion

Measuring humans is hard. We’re not talking about measuring strength or endurance here, but about accurately sizing up folks in all our glorious variety of shapes and sizes. And for every body type, there’s a different opinion on how to measure it accurately. The complexity escalates when considering the fluid dynamics of human movement. Our bodies are not static, but constantly morphing entities — we twist, contort, and elongate various parts, adding layers of ambiguity to the measurement challenge.

Despite these difficulties, it’s crucial to have a standardized reference point for measurements, particularly in the realm of technological design. This is where the ISO 7250–1:2017 standard becomes an invaluable resource. By adhering to this internationally accepted guide for basic human body measurements, we can maintain consistency, improve accuracy, and advance our understanding of the human form in its myriad manifestations.

Avatar from measurements on me.meshcapade.com

Starting from one or more measurements, the Meshcapade avatar creator utilizes these inputs to extrapolate the remaining body dimensions. This customization process ensures that your avatar closely mirrors your real-life proportions, resulting in a highly personalized and lifelike representation. Creating avatars from measurements on Meshcapade is also possible through the API.

Creating an avatar from measurements

With only one single measurement you can already create an avatar from measurements. It’s as straight forward as:

curl --location 'https://api.meshcapade.com/api/v1/avatars/create/from-measurements' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
--data '{
"name": "Created from measurements API",
"gender":"female",
"measurements":{
"Height": 180.1
}
}'

Note: See the Avatar from images article about creating an account and authenticating your requests and how to set the $TOKEN

Breaking down the request we have a couple of components to look at.

'curl [...]/avatars/create/from-measurement`

Is one of several API endpoints to create avatars from many different sources. In this case from measurements, as the name suggests. Check out the docs for more options!

'{
"name": "Created from measurements API",
"gender":"female",
"measurements":{
"Height": 180.1
}
}'

The body of the request contains the name of the avatar we want to create, the gender which is either female or male and finally the measurements.

For a comprehensive list of all available measurement points to utilize, please refer to our Notion document. Please note that the measurements provided are in centimeters. If any measurements are currently in imperial units, they will need to be converted to metric before running the request.

The somewhat shortened response to the request looks somewhat close to the following:

{
"data": {
"type": "asset",
"id": "bbab51d3-b6bc-4484-94f0-d01a506eedb3",
"attributes": {
"metadata": {
"bodyShape": {
"gender": "FEMALE",
"modelVersion": "SMPLX",
"shapeParameters": null
}
},
"name": "Created from measurements API",
"origin": "FROM_MEASUREMENTS",
"state": "AWAITING_PROCESSING",
},
"links": {
"self": "https://api.meshcapade.com/api/v1/avatars/bbab51d3-b6bc-4484-94f0-d01a506eedb3"
}
}
}

Seeing the “state”: “AWAITING_PROCESSING” tells us that we succesfully requested the creation of our avatar. Usually it takes only a couple of seconds until the avatar is ready.

Requesting the avatar

We can request the avatar simply by following the data["links"]["self"] link, which points to the newly created avatar asset:

curl --location "https://api.meshcapade.com/api/v1/avatars/$AVATAR_ID" 
--header "Authorization: Bearer $TOKEN"

If our avatar has already been processed, the response will look like this:

{
"data": {
"type": "asset",
"id": "bbab51d3-b6bc-4484-94f0-d01a506eedb3",
"attributes": {
"created_at": 1685970096,
"metadata": {
"bodyShape": {
"gender": "FEMALE",
"modelVersion": "SMPLX",
"shapeParameters": [
2.1875213361916543,
-0.26719294316046005,
"lots of numbers here [...]"
-0.07937182182457603
]
}
},
"name": "Created from measurements API",
"origin": "FROM_MEASUREMENTS",
"state": "READY",
"type": "AVATAR"
},
"links": {
"self": "https://api.meshcapade.com/api/v1/avatars/bbab51d3-b6bc-4484-94f0-d01a506eedb3"
}
}
}

Don’t panic if the avatar is not READY yet, give it a couple more seconds and try again.

Download your avatar

Downloading your newly created avatar is as easy as creating it. Follow the “Download your avatar” section of our previous article to easily create an obj or rigged fbx download.

You can also preview your avatar in the online Avatar vault and download them manually!

--

--