# 材质库服务API

开始使用前,请先创建应用,申请材质库服务scope,并成功完成审批。

# 获取库信息

GET https://apigate.glodon.com/ggpassets/materiallibrary/libraries
1

# 说明

该接口根据当前用户账号权限,获得用户权限下可见的材质库信息,若返回为空,说明该用户暂时没有创建属于其产品的材质库。

# header 参数

参数名 必选 类型 描述
Authorization string Bearer app_access_token. app_access_token为广联达用户中心的token,不同产品token不同
Content-Type string application/json

# 成功返回

{  
    "code": "success",  
    "message": null,
    "data":{
        "libraries":[
            {
            "id": "30809bd285bc48168b4d8ed7ae6a7e2c",
            "name": "GDQ-product",
            "libraryType": 1,
            "userId": null,
            "projectId": null,
            "containerId": null,
            "description": "GDQ-product",
            "createTime": "2019-10-23 11:10:40",
            "updateTime": "2019-12-13 08:42:54"
            }
        ]
    }
}  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# 获取材质分类

GET https://apigate.glodon.com/ggpassets/materiallibrary/libraries/{libraryId}/categories
1

# 说明

获得指定库下的材质分类信息

# header 参数

参数名 必选 类型 描述
Authorization string Bearer app_access_token. app_access_token为广联达用户中心的token,不同产品token不同
Content-Type string application/json

# path 参数

参数名 必选 类型 描述
libraryId string 指定库的ID

# 成功返回

{
    "code": "success",
    "message": null,
    "data": [{
            "id": "1a12dc3604b046739b8a83ac1d2c5654",
            "libraryId": "30809bd285bc48168b4d8ed7ae6a7e2c",
            "name": "自发光",
            "depth": 0,
            "parentId": "",
            "projectId": null,
            "containerId": null,
            "order": 1,
            "description": "Emission"
        }, {
            "id": "3680ba14eccb402e9b83c7032b7edc14",
            "libraryId": "30809bd285bc48168b4d8ed7ae6a7e2c",
            "name": "石材",
            "depth": 0,
            "parentId": "",
            "projectId": null,
            "containerId": null,
            "order": 1,
            "description": "Stone"
        },
    ]
}  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

# 获取材质数据

GET https://apigate.glodon.com/ggpassets/materiallibrary/libraries/{libraryId}/materials/{materialId}
1

# 说明

通过材质ID,获得特定库里的指定材质数据

# header 参数

参数名 必选 类型 描述
Authorization string Bearer app_access_token. app_access_token为广联达用户中心的token,不同产品token不同
Content-Type string application/json
engine string COMMON/GGP/FALCON,请求材质数据对应的引擎类型,默认COMMON

# path 参数

参数名 必选 类型 描述
libraryId string 指定库的ID
materialId string 材质ID

# query 参数

参数名 必选 类型 描述
instance bool 由于返回值中的instance内容较大,由参数控制是否返回instance内容,默认false

# 成功返回

{
    "code": "success",
    "message": null,
    "data": [
        {
            "common": {
                "id": "b513123469a5ebf9965a98a69c9629dd3625f69c",
                "name": "工艺玻璃-01",
                "templateId": "",
                "projectId": null,
                "containerId": null,
                "type": 0,
                "category": "2fc21df41dc14e479ffa65ffd2aa4617",
                "instance": "{\"template\":\"Glass\",\"id\":\"b513123469a5ebf9965a98a69c9629dd3625f69c\",\"tags\":\"Glass_Craft\",\"name\":\"工艺玻璃-01\",\"diffuse_color\":\"0.6196,0.6902,0.6941,0.4\",\"diffuse_texture\":{\"texture_file\":\"5a2a51233f324d791b95f6d78a03d06b\"},\"normal_texture\":{\"texture_file\":\"\"},\"useBaseTexture\":\"1\",\"enableNormal\":\"1\",\"sourcekey\":\"b513123469a5ebf9965a98a69c9629dd3625f69c\"}",
                "thumbnailObjectKey": "/material_library/thumbnails/common/b513123469a5ebf9965a98a69c9629dd3625f69c?Expires=3161990766&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=FtwMVKGtZXpkmcGg%2BRq%2Bd%2Fe0RIQ%3D",
                "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/common/b513123469a5ebf9965a98a69c9629dd3625f69c?Expires=3161990766&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=FtwMVKGtZXpkmcGg%2BRq%2Bd%2Fe0RIQ%3D",
                "digest": null,
                "version": "2.0",
                "createTime": "2019-12-13 09:01:26",
                "updateTime": "2019-12-13 17:43:16"
            },
            "special": {
                "id": "383c50d82f12483db369dddec06da7e5",
                "materialId": "b513123469a5ebf9965a98a69c9629dd3625f69c",
                "name": "工艺玻璃-01",
                "templateId": "",
                "projectId": null,
                "containerId": null,
                "type": 2,
                "category": "2fc21df41dc14e479ffa65ffd2aa4617",
                "instance": "{\"template\":\"Glass\",\"id\":\"b513123469a5ebf9965a98a69c9629dd3625f69c\",\"tags\":\"Glass_Craft\",\"name\":\"工艺玻璃-01\",\"diffuse_color\":\"0.6196,0.6902,0.6941,0.4\",\"diffuse_texture\":{\"texture_file\":\"5a2a51233f324d791b95f6d78a03d06b\"},\"normal_texture\":{\"texture_file\":\"\"},\"useBaseTexture\":\"1\",\"enableNormal\":\"1\",\"sourcekey\":\"b513123469a5ebf9965a98a69c9629dd3625f69c\"}",
                "thumbnailObjectKey": "/material_library/thumbnails/ggp/b513123469a5ebf9965a98a69c9629dd3625f69c?Expires=3161990766&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=Jm%2F3EQZ8AAUbmQZDsovqfs6gqeM%3D",
                "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/ggp/b513123469a5ebf9965a98a69c9629dd3625f69c?Expires=3161990766&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=Jm%2F3EQZ8AAUbmQZDsovqfs6gqeM%3D",
                "engineType": "GGP",
                "digest": null,
                "version": "2.0",
                "createTime": "2019-12-13 09:01:27",
                "updateTime": "2019-12-13 17:45:04"
            }
        },
        ...
    ]
} 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

# 获取材质列表

GET https://apigate.glodon.com/ggpassets/materiallibrary/libraries/{libraryId}/materials
1

# 说明

获取指定库里的所有符合条件的材质集合

# header 参数

参数名 必选 类型 描述
Authorization string Bearer app_access_token. app_access_token为广联达用户中心的token,不同产品token不同
Content-Type string application/json
engine string COMMON/GGP/FALCON,请求材质数据对应的引擎类型,默认COMMON

# path 参数

参数名 必选 类型 描述
libraryId string 指定库的ID

# query 参数

参数名 必选 类型 描述
instance bool 由于返回值中的instance内容较大,由参数控制是否返回instance内容,默认false
pageIndex number 默认-1,内容列表内容较多时,控制返回内容的范围,pageIndex和pageSize两个参数要同时使用
pageSize number 默认-1,内容列表内容较多时,控制返回内容的范围,pageIndex和pageSize两个参数要同时使用
categoryIds list 返回目录列表中的材质,使用,分隔,目前支持二级分类的id查询

# 成功返回

{
    "code": "success",
    "message": null,
    "data": [{
        "common":{
            "id": "cf32f87cc9e3e2eb80698a99de5a74e571ddbca2",
            "name": "直纹-01",
            "templateId": "",
            "projectId": null,
            "containerId": null,
            "type": 0,
            "category": "3dc643a660a54020b8a1748f483e793a",
            "instance": null,
            "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/common/cf32f87cc9e3e2eb80698a99de5a74e571ddbca2?Expires=3201595982&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=o8CsP%2BexRvlgPdFIzqG6AkNncMg%3D",
            "digest": null,
            "version": "2.0",
            "createTime": "2019-12-13 09:03:02",
            "updateTime": "2019-12-13 17:43:15"
        },
        "special":{
            "id": "5c22003ee8824858a96941f83d9b3e97",
            "materialId": "cf32f87cc9e3e2eb80698a99de5a74e571ddbca2",
            "name": "直纹-01",
            "templateId": "",
            "projectId": null,
            "containerId": null,
            "type": 2,
            "category": "3dc643a660a54020b8a1748f483e793a",
            "instance": null,
            "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/falcon/cf32f87cc9e3e2eb80698a99de5a74e571ddbca2?Expires=3201595982&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=3LIhPWlPUwlyVkaqYlnsYiil2PI%3D",
            "engineType": "FALCON",
        "digest": null,
        "version": "2.0",
        "createTime": "2019-12-13 09:03:03",
        "updateTime": "2019-12-25 15:50:10"
        }
    },{
        "common":{
            "id": "0aaabb99b8cf6c500959efebaac04f0935b6a6e7",
            "name": "直纹-02",
            "templateId": "",
            "projectId": null,
            "containerId": null,
            "type": 0,
            "category": "3dc643a660a54020b8a1748f483e793a",
            "instance": null,
            "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/common/0aaabb99b8cf6c500959efebaac04f0935b6a6e7? Expires=3201595982&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=9ENvog9gH%2F6WCUIo6izMyidiIdg%3D",
            "digest": null,
            "version": "2.0",
            "createTime": "2019-12-13 09:02:53",
            "updateTime": "2019-12-13 17:43:17"
},
        "special":{
            "id": "da05e7ce2f7047348f766e000608d0d2",
            "materialId": "0aaabb99b8cf6c500959efebaac04f0935b6a6e7",
            "name": "直纹-02",
            "templateId": "",
            "projectId": null,
            "containerId": null,
            "type": 2,
            "category": "3dc643a660a54020b8a1748f483e793a",
            "instance": null,
            "thumbnailUrl": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/thumbnails/falcon/0aaabb99b8cf6c500959efebaac04f0935b6a6e7?Expires=3201595982&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=jcgICJaL0fJZbLOMBXaPmT4NGtw%3D",
            "engineType": "FALCON",
            "digest": null,
            "version": "2.0",
            "createTime": "2019-12-13 09:02:57",
            "updateTime": "2019-12-25 15:50:09"
        }
    }]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

# 获取材质纹理资源

GET https://apigate.glodon.com/ggpassets/materiallibrary/libraries/{libraryId}/resources/{resourceId}
1

# 说明

获得指定库里的材质数据的纹理资源

# header 参数

参数名 必选 类型 描述
Authorization string Bearer app_access_token. app_access_token为广联达用户中心的token,不同产品token不同
Content-Type string application/json
engine string COMMON/GGP/FALCON,请求材质数据对应的引擎类型,默认COMMON

# path 参数

参数名 必选 类型 描述
libraryId string 指定库的ID
resourceId string 纹理资源ID

# 成功返回

{
    "code": "success",
    "message": null,
    "data": {
        "id": "68a0d9ba7a83455690c17d342ad6f3b2",
        "materialId": null,
        "projectId": "test",
        "resourceId": "5a2a51233f324d791b95f6d78a03d06b",
        "containerId": "test",
        "name": "",
        "suffix": null,
        "size": 74360,
        "url": "https://ggpassets-databag.oss-cn-beijing.aliyuncs.com/material_library/textures/68a0d9ba7a83455690c17d342ad6f3b2?Expires=3161993336&OSSAccessKeyId=LTAI4FfbNE8mdoGd1bgCpG97&Signature=ND4mxp4kQtkIxtQiFjRu3wHE%2BZ8%3D",
        "md5": "36c1b7dff59eff41129e9e6b2c0ea5f6",
        "createTime": "2019-12-13 09:01:25",
        "updateTime": "2019-12-13 09:01:25"
    }
}  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  • 在线客服

  • 意见反馈