gltf-parser-plugin 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/gltf-parser-plugin.module.js +192 -97
- package/build/gltf-parser-plugin.module.js.map +1 -1
- package/build/index.d.ts +25 -23
- package/package.json +47 -47
package/build/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
35
35
|
private _modelInfo;
|
|
36
36
|
private _modelInfoPromise;
|
|
37
37
|
private _interactionFilter;
|
|
38
|
-
private
|
|
38
|
+
private _componentColorHelper;
|
|
39
39
|
oids: number[];
|
|
40
40
|
private renderer;
|
|
41
41
|
private splitMeshCache;
|
|
@@ -143,28 +143,6 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
143
143
|
unisolateByOid(oid: number): void;
|
|
144
144
|
unisolate(): void;
|
|
145
145
|
getIsolatedOids(): number[];
|
|
146
|
-
/**
|
|
147
|
-
* 根据 oid 数组修改构件颜色
|
|
148
|
-
* @param oids 构件 OID 数组
|
|
149
|
-
* @param color 颜色值,支持 hex 数字(如 0xff0000)、颜色字符串(如 "#ff0000")、THREE.Color 对象
|
|
150
|
-
*/
|
|
151
|
-
setColorByOids(oids: number[], color: ColorInput): void;
|
|
152
|
-
/**
|
|
153
|
-
* 根据 oid 数组修改构件颜色透明度
|
|
154
|
-
* @param oids 构件 OID 数组
|
|
155
|
-
* @param opacity 透明度,0-1,0 完全透明,1 完全不透明
|
|
156
|
-
*/
|
|
157
|
-
setOpacityByOids(oids: number[], opacity: number): void;
|
|
158
|
-
/**
|
|
159
|
-
* 恢复指定构件的颜色为修改前的状态
|
|
160
|
-
* @param oids 构件 OID 数组
|
|
161
|
-
*/
|
|
162
|
-
restoreColorByOids(oids: number[]): void;
|
|
163
|
-
/**
|
|
164
|
-
* 恢复指定构件的透明度为修改前的状态
|
|
165
|
-
* @param oids 构件 OID 数组
|
|
166
|
-
*/
|
|
167
|
-
restoreOpacityByOids(oids: number[]): void;
|
|
168
146
|
/**
|
|
169
147
|
* 内部方法:根据 oid 获取 mesh 数组
|
|
170
148
|
*/
|
|
@@ -183,6 +161,30 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
|
|
|
183
161
|
* Restore the display of the corresponding mesh according to the OID array
|
|
184
162
|
*/
|
|
185
163
|
unhideByOids(oids: number[]): void;
|
|
164
|
+
/**
|
|
165
|
+
* 根据 oid 数组设置构件颜色
|
|
166
|
+
* 隐藏原 mesh,将 split mesh 替换材质后加入场景(使用 tiles.group)
|
|
167
|
+
* @param oids 构件 OID 数组
|
|
168
|
+
* @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
|
|
169
|
+
*/
|
|
170
|
+
setComponentColorByOids(oids: number[], color: ColorInput): void;
|
|
171
|
+
/**
|
|
172
|
+
* 恢复指定构件的颜色
|
|
173
|
+
* 从场景移除 split mesh,unhide 原 mesh
|
|
174
|
+
* @param oids 构件 OID 数组
|
|
175
|
+
*/
|
|
176
|
+
restoreComponentColorByOids(oids: number[]): void;
|
|
177
|
+
/**
|
|
178
|
+
* 根据 oid 数组设置构件透明度
|
|
179
|
+
* @param oids 构件 OID 数组
|
|
180
|
+
* @param opacity 透明度,0-1,0 完全透明,1 完全不透明
|
|
181
|
+
*/
|
|
182
|
+
setComponentOpacityByOids(oids: number[], opacity: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* 恢复指定构件的透明度
|
|
185
|
+
* @param oids 构件 OID 数组
|
|
186
|
+
*/
|
|
187
|
+
restoreComponentOpacityByOids(oids: number[]): void;
|
|
186
188
|
/**
|
|
187
189
|
* Restore the original materials of the mesh
|
|
188
190
|
*/
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gltf-parser-plugin",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "A plugin for parsing GLTF files",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./build/gltf-parser-plugin.module.js",
|
|
7
|
-
"module": "./build/gltf-parser-plugin.module.js",
|
|
8
|
-
"types": "./build/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"import": "./build/gltf-parser-plugin.module.js",
|
|
12
|
-
"types": "./build/index.d.ts"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"build"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"dev": "vite build --watch",
|
|
20
|
-
"serve": "vite",
|
|
21
|
-
"build": "tsc && vite build",
|
|
22
|
-
"test": "vitest",
|
|
23
|
-
"test:watch": "vitest --watch",
|
|
24
|
-
"type-check": "tsc --noEmit",
|
|
25
|
-
"lint": "eslint src --ext .ts,.tsx",
|
|
26
|
-
"prepublishOnly": "pnpm run build"
|
|
27
|
-
},
|
|
28
|
-
"author": "maptalks",
|
|
29
|
-
"license": "MIT",
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/node": "^25.4.0",
|
|
32
|
-
"@types/three": "^0.183.1",
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
34
|
-
"@typescript-eslint/parser": "^8.57.0",
|
|
35
|
-
"eslint": "^10.0.3",
|
|
36
|
-
"typescript": "^5.9.3",
|
|
37
|
-
"vite": "^7.3.1",
|
|
38
|
-
"vite-plugin-dts": "^4.5.4",
|
|
39
|
-
"vitest": "^4.0.18"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"3d-tiles-renderer": "^0.4.22",
|
|
43
|
-
"@maptalks/gltf-loader": "^0.124.4",
|
|
44
|
-
"@maptalks/transcoders.draco": "^0.124.4",
|
|
45
|
-
"three": "^0.183.2"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "gltf-parser-plugin",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "A plugin for parsing GLTF files",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./build/gltf-parser-plugin.module.js",
|
|
7
|
+
"module": "./build/gltf-parser-plugin.module.js",
|
|
8
|
+
"types": "./build/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./build/gltf-parser-plugin.module.js",
|
|
12
|
+
"types": "./build/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"build"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite build --watch",
|
|
20
|
+
"serve": "vite",
|
|
21
|
+
"build": "tsc && vite build",
|
|
22
|
+
"test": "vitest",
|
|
23
|
+
"test:watch": "vitest --watch",
|
|
24
|
+
"type-check": "tsc --noEmit",
|
|
25
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
26
|
+
"prepublishOnly": "pnpm run build"
|
|
27
|
+
},
|
|
28
|
+
"author": "maptalks",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^25.4.0",
|
|
32
|
+
"@types/three": "^0.183.1",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^8.57.0",
|
|
34
|
+
"@typescript-eslint/parser": "^8.57.0",
|
|
35
|
+
"eslint": "^10.0.3",
|
|
36
|
+
"typescript": "^5.9.3",
|
|
37
|
+
"vite": "^7.3.1",
|
|
38
|
+
"vite-plugin-dts": "^4.5.4",
|
|
39
|
+
"vitest": "^4.0.18"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"3d-tiles-renderer": "^0.4.22",
|
|
43
|
+
"@maptalks/gltf-loader": "^0.124.4",
|
|
44
|
+
"@maptalks/transcoders.draco": "^0.124.4",
|
|
45
|
+
"three": "^0.183.2"
|
|
46
|
+
}
|
|
47
|
+
}
|