Texture
Process a 2D texture
Upload a .jpg, .jpeg, or .png with POST /uploads and wait for ready, as in the mesh upload example. Submit that image to POST /pbr/execute/image, then poll its execution for the texture maps.
image_execution=$(curl -sS "$MARSO_API_BASE_URL/pbr/execute/image" \
-H "Authorization: Bearer $MARSO_API_KEY" -H "Content-Type: application/json" \
-d '{"asset_id":"<ready-image-id>"}')
image_id=$(echo "$image_execution" | jq -r .execution_id)
while :; do
result=$(curl -sS "$MARSO_API_BASE_URL/pbr/executions/$image_id" \
-H "Authorization: Bearer $MARSO_API_KEY")
status=$(echo "$result" | jq -r .status)
[[ "$status" == "SUCCEEDED" || "$status" == "PARTIAL_SUCCEEDED" || "$status" == "FAILED" || "$status" == "CANCELED" ]] && break
sleep 5
done
echo "$result"response = requests.post(
f"{base}/pbr/execute/image", headers=headers,
json={"asset_id": "<ready-image-id>"}, timeout=30
)
execution_id = response.json()["execution_id"]
while True:
result = requests.get(f"{base}/pbr/executions/{execution_id}", headers=headers, timeout=30).json()
if result["status"] in {"SUCCEEDED", "PARTIAL_SUCCEEDED", "FAILED"}:
break
time.sleep(5)
print(result.get("pbr_material_assets", {}))Last updated
