Create a Space for Assets
Refer to this guide when you choose to create a Space to store your digital assets for use with the Substance 3D API.
Overview
Using the Substance 3D API requires digital assets like 3D models or scenes. There's a few options to upload your assets for use with the API.
You can use the /spaces endpoint to create a Space to store your assets. For each asset file, add a new --form argument in the cURL command and replace:
{DESTINATION_FOLDER}: A path to the folder in the destination Space.{FILEPATH}: A path to your local file.
curl --url https://s3d.adobe.io/v1/spaces \
--header 'Authorization: Bearer $S3D_FF_SERVICES_ACCESS_TOKEN' \
--form '{DESTINATION_FOLDER}=@{FILEPATH}'
The steps below offer a walkthrough for creating a Space and uploading a few prepared digital assets to it.
Prerequisites
- You'll need a valid Substance 3D API Client ID and Access Token. To generate these, review the Authentication Guide.
- Export your valid Access Token as an environment variable:
S3D_FF_SERVICES_ACCESS_TOKEN.
Step 1 - Upload files
In a secure terminal, use the cURL command to upload your prepared asset files.
data-slots=heading, code
data-repeat=2
data-languages=CURL, JSON
curl --url https://s3d.adobe.io/v1/spaces \
--header 'Authorization: Bearer $S3D_FF_SERVICES_ACCESS_TOKEN' \
--form '.=@my_assets/asset.gltf' \
--form '.=@my_assets/asset.bin' \
--form 'textures=@my_assets/textures/texture_asset.png'
{
"id": "EXAMPLE-174b-4d9d-917f-bdcd6e117447",
"files": [...],
...
}
This command creates a new Space with the following tree structure:
├── textures
│ └── texture_asset.png
└── asset.gltf
└── asset.bin
The response contains the Space ID to reference the assets' location in Substance 3D API requests.
Step 2 - Reference uploaded assets
Your assets are now ready to use with the Substance 3D APIs. Let's see an example of that with a Render job.
To use the uploaded assets with the Render Model API, use the Space ID obtained during Step 1.
data-slots=heading, code
data-repeat=2
data-languages=JSON, CURL
{
"scene": {
"modelFile": "asset.gltf"
},
"sources": [
{
"space": {
"id": "5cbf0499-174b-4d9d-917f-bdcd6e117447"
}
}
]
}
curl -X POST https://s3d.adobe.io/v1/scenes/render-basic \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $S3D_FF_SERVICES_ACCESS_TOKEN' \
-d @payload.json