3ds Max纹理/自定义材质

时间:2018-03-12 22:25:26

标签: autodesk-forge autodesk-viewer

我在Viewer Release Notes: v4.0.1中读到现在支持Protein Materials tiling patterns(Revit 2019)。这很棒!但是,作为3ds Max用户,我很好奇是否有计划支持来自3ds Max的bitmap-texturescustom materials?这确实会产生新的可能性。

1 个答案:

答案 0 :(得分:1)

我不确定旧版本,但正如您可以从以下屏幕截图中看到一位同事创建的场景: enter image description here

使用纹理转换max文件时应该没有问题,只要按照以下步骤操作:

  1. 将最大文件及其纹理存档并将其上传到存储桶。 例如(使用Python):
  2. filename = 'max_archive.zip'
    bucket_name = bucketKey
    
    url = "https://developer.api.autodesk.com"
    my_object_endpoint = "/oss/v2/buckets/" + bucket_name + "/objects/" + filename
    header = {
               "Authorization": "Bearer " + token,
               "Content-Type": "application/octet-stream",
               "Content-Length": str(os.path.getsize(filename)),
             }    
    with open(filename, 'rb') as object_to_upload:
            response_upload = requests.put(url + my_object_endpoint, headers=header, data=object_to_upload)
    
    1. 发送翻译作业,指明它是存档,此存档的根目录是您的最大文件。 例如(使用Python):
    2. job_endpoint = '/modelderivative/v2/designdata/job'
      header = {
          "Authorization": "Bearer " + token,
          "Content-Type": "application/json",
      }
      
      payload = json.dumps({
          "input" : {
              "urn": '"' + encoded_urn + '"',
              "rootFilename": "physical_material.max",
              "compressedUrn": True
          },
          "output": {
              "formats": [
                  {
                      "type": "svf",
                      "views": [
                          "2d",
                          "3d"
                      ]
                  }
              ]
          }
      })
      
      response = requests.post(url+job_endpoint, headers=header, data=payload)
      

      此处的关键点是有效负载的 输入 部分,您必须指定 rootFilename 并设置压缩 true

      在我的情况下,我得到了上面提到的屏幕截图中的结果。

相关问题