If you need the thumbnails to match a configuration I would fire off a batch of WebGL renders so each configuration has an image attributed to it and we can query the Layers API for those images.
It should be a matter of simply making a GET request to a URL similar to something like:
https://{ENV}.threekit.com/api/layers/layer?bearer_token={TOKEN}&assetLayerConfiguration={CONFIG}&assetId={ASSETID}
A couple of things to note:
- If you are making this request from the browser, make sure your bearer token is the public token authorized for the domain.
- The
assetLayerConfiguration
will have to be encoded and stringified JSON:encodeURIComponent(JSON.stringify({key: value}))
Finally, this API will return an object similar to the following:
"id": "f5529722-a3c4-4c1a-8dd7-d2a9c2071323",
"assetId": "ed74e60a-4a2b-4826-8463-03dff52bfc84",
"assetLayer": "ed74e60a-4a2b-4826-8463-03dff52bfc84",
"assetVersion": "",
"assetLayerConfiguration": {
"String": "1"
},
"stageId": "",
"stageConfiguration": {},
"metadata": {},
"orgId": "e1406626-3f0a-4eb8-aa9b-55b30bd0551d",
"jobId": "0a03838b-5d29-4af7-a066-e0a4a6d6ba7a",
"taskId": "f7776a25-5397-4be6-855f-f98dd8ffeefd",
"fileId": "dc51740d-4bf0-49bb-b2b7-e1176818e1a3",
"branch": "unpublished",
"createdAt": "2021-02-12T19:14:39.240Z",
"format": "png",
"stageMetadata": null,
"width": 2000,
"height": 2000
}
To use the returned fileId
as an image, you can retrieve it from our CDN:
https://{ENV}.threekit.com/api/files/{fileId}/content
https://preview.threekit.com/api/files/dc51740d-4bf0-49bb-b2b7-e1176818e1a3/content
Let me know if I can help further.