gltf-parser-plugin 1.1.5 → 1.1.7

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/index.d.ts CHANGED
@@ -35,7 +35,9 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
35
35
  private _modelInfo;
36
36
  private _modelInfoPromise;
37
37
  private _interactionFilter;
38
- private _componentColorHelper;
38
+ private _partColorHelper;
39
+ private _partBlinkHelper;
40
+ private _partFrameHelper;
39
41
  oids: number[];
40
42
  private renderer;
41
43
  private splitMeshCache;
@@ -156,39 +158,79 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
156
158
  /**
157
159
  * Hide the corresponding part of the original mesh according to the OID array
158
160
  */
159
- hideByOids(oids: number[]): void;
161
+ hidePartsByOids(oids: number[]): void;
160
162
  /**
161
163
  * Restore the display of the corresponding mesh according to the OID array
162
164
  */
163
- unhideByOids(oids: number[]): void;
165
+ showPartsByOids(oids: number[]): void;
164
166
  /**
165
167
  * 根据 oid 数组设置构件颜色
166
168
  * 隐藏原 mesh,将 split mesh 替换材质后加入场景(使用 tiles.group)
167
169
  * @param oids 构件 OID 数组
168
170
  * @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
169
171
  */
170
- setComponentColorByOids(oids: number[], color: ColorInput): void;
172
+ setPartColorByOids(oids: number[], color: ColorInput): void;
171
173
  /**
172
174
  * 恢复指定构件的颜色
173
- * 从场景移除 split mesh,unhide mesh
175
+ * 从场景移除 split mesh,恢复原 mesh 显示
174
176
  * @param oids 构件 OID 数组
175
177
  */
176
- restoreComponentColorByOids(oids: number[]): void;
178
+ restorePartColorByOids(oids: number[]): void;
177
179
  /**
178
180
  * 根据 oid 数组设置构件透明度
179
181
  * @param oids 构件 OID 数组
180
182
  * @param opacity 透明度,0-1,0 完全透明,1 完全不透明
181
183
  */
182
- setComponentOpacityByOids(oids: number[], opacity: number): void;
184
+ setPartOpacityByOids(oids: number[], opacity: number): void;
183
185
  /**
184
186
  * 恢复指定构件的透明度
185
187
  * @param oids 构件 OID 数组
186
188
  */
187
- restoreComponentOpacityByOids(oids: number[]): void;
189
+ restorePartOpacityByOids(oids: number[]): void;
190
+ /**
191
+ * 设置需要闪烁的构件
192
+ * @param oids 构件 OID 数组
193
+ */
194
+ setBlinkPartsByOids(oids: number[]): void;
195
+ /**
196
+ * 设置闪烁颜色
197
+ * @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
198
+ */
199
+ setBlinkColor(color: ColorInput): void;
200
+ /**
201
+ * 设置闪烁周期时间(毫秒)
202
+ * @param ms 一个完整闪烁周期(暗->亮->暗)的时长,默认 1000
203
+ */
204
+ setBlinkIntervalTime(ms: number): void;
205
+ /**
206
+ * 清除所有闪烁构件
207
+ */
208
+ clearAllBlinkParts(): void;
209
+ /**
210
+ * 设置需要线框显示的构件
211
+ * @param oids 构件 OID 数组
212
+ */
213
+ setFramePartsByOids(oids: number[]): void;
214
+ /**
215
+ * 清除所有线框显示构件
216
+ */
217
+ clearAllFrameParts(): void;
218
+ /**
219
+ * 设置指定构件的线框填充颜色
220
+ * @param oids 构件 OID 数组
221
+ * @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
222
+ */
223
+ setFrameFillColor(oids: number[], color: ColorInput): void;
224
+ /**
225
+ * 设置指定构件的线框边框颜色
226
+ * @param oids 构件 OID 数组
227
+ * @param color 颜色值,支持 hex 数字、颜色字符串(如 "#ff0000")、THREE.Color 对象
228
+ */
229
+ setFrameEdgeColor(oids: number[], color: ColorInput): void;
188
230
  /**
189
231
  * Restore the original materials of the mesh
190
232
  */
191
- unhide(): void;
233
+ showAllParts(): void;
192
234
  /**
193
235
  * Get the current feature ID count
194
236
  */
@@ -204,7 +246,7 @@ export declare class GLTFParserPlugin implements MeshHelperHost {
204
246
  */
205
247
  export declare interface GLTFParserPluginOptions {
206
248
  /**
207
- * WebGLRenderer instance, required for mesh helper features (hideByOids, etc.)
249
+ * WebGLRenderer instance, required for mesh helper features (hidePartsByOids, etc.)
208
250
  */
209
251
  renderer?: WebGLRenderer;
210
252
  /**
package/package.json CHANGED
@@ -1,47 +1,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
- }
1
+ {
2
+ "name": "gltf-parser-plugin",
3
+ "version": "1.1.7",
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.5.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": "^8.0.0",
38
+ "vite-plugin-dts": "^4.5.4",
39
+ "vitest": "^4.1.0"
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
+ }