Forge ARKit API – 无法在POST作业后获取清单

huangapple go评论83阅读模式
英文:

Forge ARKit API - can't GET manifest after POST job

问题

我已经在Forge AR工具包上工作了好几天了。我试图在Unity中显示和与APS(Forge)模型进行交互。我按照这篇博客文章逐步操作,并参考了这份文档,但遇到了一些问题。以下是我的API调用详细信息(我使用Postman测试了所有API调用)。

获取令牌

我通过Authentication API v2获取令牌:

curl --location --request POST 'https://developer.api.autodesk.com/authentication/v2/token' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {My_Base_Code}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=data:read data:write data:create data:search bucket:create bucket:read bucket:update bucket:delete account:read account:write code:all'

创建场景

curl --location --request PUT 'https://developer-api-beta.autodesk.io/arkit/v1/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ/scenes/test-scene' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {My_Token}' \
--data '{
    "prj":{
        "urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ"
    }
}'

我收到了状态码200的以下响应:

{
    "prj": {
        "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF_2yMDIzMDUyMi90ZXN0MS5ydnQ"
    }
}

当我调用GET /arkit/v1/{urn}/scenes时,我在响应中收到了test-scene

创建场景资产

curl --location --request POST 'developer-api-beta.autodesk.io/modelderivative/v2/arkit/job' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {My_Token}' \
--data '{
  "input": {
    "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ"
  },
  "output": {
    "destination": {
      "region": "US"
    },
    "formats": [
      {
        "type": "arkit",
        "scene": "test-scene"
      }
    ]
  }
}'

我收到了状态码200,但响应主体为空。

检查场景处理状态

curl --location --request GET 'developer-api-beta.autodesk.io/modelderivative/v2/arkit/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ/manifest' \
--header 'Authorization: Bearer {My_Token}' \
--header 'Content-Type: application/json'

我总是在此处收到状态码404的响应。这是因为它仍在处理中吗?还是我漏掉了什么?任何帮助都将不胜感激!

英文:

I've been working on Forge AR kit for several days. What I'm trying to do is to display and interact with APS(Forge) model in Unity. I followed this blog post step-by-step and refer to this document and meet some problems. Here's the details of my api calls (I test all api calls with Postman).

Get Token

I get token via Authentication API v2:

curl --location --request POST 'https://developer.api.autodesk.com/authentication/v2/token' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {My_Base_Code}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=data:read data:write data:create data:search bucket:create bucket:read bucket:update bucket:delete account:read account:write code:all'

Create Scene

curl --location --request PUT 'https://developer-api-beta.autodesk.io/arkit/v1/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ/scenes/test-scene' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {My_Token}' \
--data '{
    "prj":{
        "urn":"dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ"
    }
}'

I got following response with status 200:

{
    "prj": {
        "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ"
    }
}

When I call GET /arkit/v1/{urn}/scenes I received test-scene in the response.

Create Scene Assets

curl --location --request POST 'developer-api-beta.autodesk.io/modelderivative/v2/arkit/job' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {My_Token}' \
--data '{
  "input": {
    "urn": "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ"
  },
  "output": {
    "destination": {
      "region": "US"
    },
    "formats": [
      {
        "type": "arkit",
        "scene": "test-scene"
      }
    ]
  }
}'

I got status 200 with empty response body.

Check Scene Processing Status

curl --location --request GET 'developer-api-beta.autodesk.io/modelderivative/v2/arkit/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGVzdGJ1Y2tldF8yMDIzMDUyMi90ZXN0MS5ydnQ/manifest' \
--header 'Authorization: Bearer {My_Token}' \
--header 'Content-Type: application/json'

I always get response with status 404 here. Is it because it's still processing? or did I miss something? Any help is appreciated!

答案1

得分: 1

尽管您的问题似乎已经被@BugFinder回答过了,但让我再补充一些关于项目本身的细节:

Forge AR/VR Toolkit曾经是一个实验性项目,但很遗憾,它现在不再开发了。如果您有兴趣将您的APS模型带入除了Viewer之外的环境,我建议您查看forge-convert-utils项目。这是一个Node.js模块和一个CLI工具,可以将来自Autodesk Platform Services的SVF模型转换成流行的开放式3D交换格式glTF 2.0。然后,可以轻松加载glTF内容到Unity、Unreal Engine和其他环境中。使用forge-convert-utils方法的好处包括:

  • 您可以更多地控制处理流程(即,您不会冒险使用第三方流程)
  • 您正在未来保护您的解决方案,因为Model Derivative服务计划在未来将glTF作为本机输出添加进去。
英文:

While your question seems to have been answered by @BugFinder already, let me add a couple more details on the project itself:

The Forge AR/VR Toolkit used to be an experimental project, and I'm afraid it's not being developed anymore. If you're interested in bringing your APS models into environments other than the Viewer, I'd suggest that you take a look at the forge-convert-utils project instead. It's a Node.js module and a CLI tool that converts SVF models from Autodesk Platform Services into the popular, open 3D exchange format glTF 2.0. The glTF content can then be easily loaded into Unity, Unreal Engine, and other environments. The benefits of using the forge-convert-utils approach are:

  • you have more control over the processing pipeline (i.e., you're not risking that a 3rd party pipeline will get sunset)
  • you're future-proofing your solution as the Model Derivative service is planning to add glTF as native output in the future

huangapple
  • 本文由 发表于 2023年6月19日 17:32:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76505352.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定