@soonspacejs/plugin-flow 2.14.3 → 2.14.4
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.
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
1
2
|
import { FlowParser } from '../FlowParser';
|
|
2
3
|
import { NodeGlobalType, NodeType } from '../types';
|
|
3
4
|
import { Node } from './Node';
|
|
4
5
|
declare class UnEmissiveNode extends Node {
|
|
5
6
|
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
+
filterUnEmissiveObject(objectsValue: Object3D[] | Object3D): Object3D<import('three').Object3DEventMap>[];
|
|
6
8
|
exec(global: NodeGlobalType): Promise<void>;
|
|
7
9
|
}
|
|
8
10
|
export { UnEmissiveNode, };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
1
2
|
import { FlowParser } from '../FlowParser';
|
|
2
3
|
import { NodeGlobalType, NodeType } from '../types';
|
|
3
4
|
import { Node } from './Node';
|
|
4
5
|
declare class UnHighlightNode extends Node {
|
|
5
6
|
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
+
filterUnHighlightObject(objectsValue: Object3D[] | Object3D): Object3D<import('three').Object3DEventMap>[];
|
|
6
8
|
exec(global: NodeGlobalType): Promise<void>;
|
|
7
9
|
}
|
|
8
10
|
export { UnHighlightNode, };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { Object3D } from 'three';
|
|
1
2
|
import { FlowParser } from '../FlowParser';
|
|
2
3
|
import { NodeGlobalType, NodeType } from '../types';
|
|
3
4
|
import { Node } from './Node';
|
|
4
5
|
declare class UnOpacityNode extends Node {
|
|
5
6
|
constructor(parser: FlowParser, node: NodeType);
|
|
7
|
+
filterUnOpacityObject(objectsValue: Object3D[] | Object3D): Object3D<import('three').Object3DEventMap>[];
|
|
6
8
|
exec(global: NodeGlobalType): Promise<void>;
|
|
7
9
|
}
|
|
8
10
|
export { UnOpacityNode, };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Vector3 as I, Euler as
|
|
1
|
+
import { Vector3 as I, Euler as D, EventDispatcher as z } from "three";
|
|
2
2
|
import T from "soonspacejs";
|
|
3
|
-
import { AnimationPlayer as
|
|
3
|
+
import { AnimationPlayer as k } from "umanager-animation-parser";
|
|
4
4
|
import { InteractionType as L, InteractionObsType as j, FlowParser as Y, InteractionAction as $ } from "@soonspacejs/plugin-flow";
|
|
5
5
|
class K {
|
|
6
6
|
id;
|
|
@@ -167,7 +167,7 @@ class tt extends f {
|
|
|
167
167
|
t && s && this.writeContext(l(s.value), l(t.value));
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const { objectHandle:
|
|
170
|
+
const { objectHandle: ss } = T.utils;
|
|
171
171
|
class st extends f {
|
|
172
172
|
constructor(t, s) {
|
|
173
173
|
super(t, s);
|
|
@@ -191,32 +191,30 @@ class st extends f {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
const { objectHandle:
|
|
195
|
-
class
|
|
194
|
+
const { objectHandle: et } = T.utils;
|
|
195
|
+
class it extends f {
|
|
196
196
|
constructor(t, s) {
|
|
197
197
|
super(t, s);
|
|
198
198
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
// } )
|
|
206
|
-
// return objects
|
|
207
|
-
// }
|
|
199
|
+
filterUnHighlightObject(t) {
|
|
200
|
+
const s = [];
|
|
201
|
+
return et(t, (i) => {
|
|
202
|
+
this.ssp.viewport.scener.selectedObjects.highlight.has(i) && s.push(i);
|
|
203
|
+
}), s;
|
|
204
|
+
}
|
|
208
205
|
async exec(t) {
|
|
209
206
|
const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = await t.getTarget?.(this);
|
|
210
207
|
if (s) {
|
|
211
208
|
const o = this.getValue(s, i);
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
|
|
209
|
+
if (o) {
|
|
210
|
+
const a = this.filterUnHighlightObject(o);
|
|
211
|
+
this.ssp.unHighlightShow(a);
|
|
212
|
+
}
|
|
215
213
|
}
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
|
-
const { objectHandle:
|
|
219
|
-
class
|
|
216
|
+
const { objectHandle: ot } = T.utils;
|
|
217
|
+
class nt extends f {
|
|
220
218
|
constructor(t, s) {
|
|
221
219
|
super(t, s);
|
|
222
220
|
}
|
|
@@ -234,7 +232,7 @@ class ot extends f {
|
|
|
234
232
|
if (s && i && o) {
|
|
235
233
|
const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
|
|
236
234
|
if (c) {
|
|
237
|
-
const C =
|
|
235
|
+
const C = ot(c, (d) => d);
|
|
238
236
|
this.ssp.opacityShow(C, { color: h, opacity: u }), this.cleanSets.add(() => {
|
|
239
237
|
this.ssp.unOpacityShow(C);
|
|
240
238
|
});
|
|
@@ -242,32 +240,30 @@ class ot extends f {
|
|
|
242
240
|
}
|
|
243
241
|
}
|
|
244
242
|
}
|
|
245
|
-
const { objectHandle:
|
|
246
|
-
class
|
|
243
|
+
const { objectHandle: at } = T.utils;
|
|
244
|
+
class ct extends f {
|
|
247
245
|
constructor(t, s) {
|
|
248
246
|
super(t, s);
|
|
249
247
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
// } )
|
|
257
|
-
// return objects
|
|
258
|
-
// }
|
|
248
|
+
filterUnOpacityObject(t) {
|
|
249
|
+
const s = [];
|
|
250
|
+
return at(t, (i) => {
|
|
251
|
+
this.ssp.viewport.scener.selectedObjects.opacity.has(i) && s.push(i);
|
|
252
|
+
}), s;
|
|
253
|
+
}
|
|
259
254
|
async exec(t) {
|
|
260
255
|
const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = await t.getTarget?.(this);
|
|
261
256
|
if (s) {
|
|
262
257
|
const o = this.getValue(s, i);
|
|
263
|
-
|
|
264
|
-
this.
|
|
265
|
-
|
|
258
|
+
if (o) {
|
|
259
|
+
const a = this.filterUnOpacityObject(o);
|
|
260
|
+
this.ssp.unOpacityShow(a);
|
|
261
|
+
}
|
|
266
262
|
}
|
|
267
263
|
}
|
|
268
264
|
}
|
|
269
|
-
const { objectHandle:
|
|
270
|
-
class
|
|
265
|
+
const { objectHandle: es } = T.utils;
|
|
266
|
+
class rt extends f {
|
|
271
267
|
constructor(t, s) {
|
|
272
268
|
super(t, s);
|
|
273
269
|
}
|
|
@@ -283,11 +279,11 @@ class at extends f {
|
|
|
283
279
|
async exec(t) {
|
|
284
280
|
const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = this.findProp("color", [n.READ_CTX, n.LOCAL]), o = this.findProp("baseColor", [n.READ_CTX, n.LOCAL]), a = this.findProp("minOpacity", [n.READ_CTX, n.LOCAL]), c = this.findProp("maxOpacity", [n.READ_CTX, n.LOCAL]), h = this.findProp("duration", [n.READ_CTX, n.LOCAL]), u = await t.getTarget?.(this);
|
|
285
281
|
if (s && i && o && a && c && h) {
|
|
286
|
-
const C = this.getValue(s, u), d = this.getValue(i),
|
|
282
|
+
const C = this.getValue(s, u), d = this.getValue(i), P = this.getValue(o), x = this.getValue(a), p = this.getValue(c), A = this.getValue(h);
|
|
287
283
|
C && (this.ssp.emissiveShow(C, {
|
|
288
284
|
color: d,
|
|
289
|
-
baseColor:
|
|
290
|
-
minOpacity:
|
|
285
|
+
baseColor: P,
|
|
286
|
+
minOpacity: x,
|
|
291
287
|
maxOpacity: p,
|
|
292
288
|
duration: A
|
|
293
289
|
}), this.cleanSets.add(() => {
|
|
@@ -296,32 +292,30 @@ class at extends f {
|
|
|
296
292
|
}
|
|
297
293
|
}
|
|
298
294
|
}
|
|
299
|
-
const { objectHandle:
|
|
300
|
-
class
|
|
295
|
+
const { objectHandle: lt } = T.utils;
|
|
296
|
+
class ht extends f {
|
|
301
297
|
constructor(t, s) {
|
|
302
298
|
super(t, s);
|
|
303
299
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
// } )
|
|
311
|
-
// return objects
|
|
312
|
-
// }
|
|
300
|
+
filterUnEmissiveObject(t) {
|
|
301
|
+
const s = [];
|
|
302
|
+
return lt(t, (i) => {
|
|
303
|
+
this.ssp.viewport.scener.selectedObjects.emissive.has(i) && s.push(i);
|
|
304
|
+
}), s;
|
|
305
|
+
}
|
|
313
306
|
async exec(t) {
|
|
314
307
|
const s = this.findProp("objects", [n.READ_CTX, n.LOCAL]), i = await t.getTarget?.(this);
|
|
315
308
|
if (s) {
|
|
316
309
|
const o = this.getValue(s, i);
|
|
317
|
-
|
|
318
|
-
this.
|
|
319
|
-
|
|
310
|
+
if (o) {
|
|
311
|
+
const a = this.filterUnEmissiveObject(o);
|
|
312
|
+
this.ssp.unEmissiveShow(a);
|
|
313
|
+
}
|
|
320
314
|
}
|
|
321
315
|
}
|
|
322
316
|
}
|
|
323
317
|
const y = Symbol("meshCache");
|
|
324
|
-
class
|
|
318
|
+
class ut extends f {
|
|
325
319
|
constructor(t, s) {
|
|
326
320
|
super(t, s);
|
|
327
321
|
}
|
|
@@ -336,13 +330,13 @@ class rt extends f {
|
|
|
336
330
|
c = C;
|
|
337
331
|
return;
|
|
338
332
|
}
|
|
339
|
-
const d =
|
|
333
|
+
const d = _(i, h);
|
|
340
334
|
d && (c = d, t[y][h] = d), this.writeContext(u, c);
|
|
341
335
|
}
|
|
342
336
|
}
|
|
343
337
|
}
|
|
344
338
|
const M = Symbol("meshesCache");
|
|
345
|
-
class
|
|
339
|
+
class dt extends f {
|
|
346
340
|
constructor(t, s) {
|
|
347
341
|
super(t, s);
|
|
348
342
|
}
|
|
@@ -358,13 +352,13 @@ class lt extends f {
|
|
|
358
352
|
c.push(d);
|
|
359
353
|
return;
|
|
360
354
|
}
|
|
361
|
-
const
|
|
362
|
-
|
|
355
|
+
const P = _(i, C);
|
|
356
|
+
P && (c.push(P), t[M][C] = P);
|
|
363
357
|
}), this.writeContext(u, c);
|
|
364
358
|
}
|
|
365
359
|
}
|
|
366
360
|
}
|
|
367
|
-
class
|
|
361
|
+
class pt extends f {
|
|
368
362
|
constructor(t, s) {
|
|
369
363
|
super(t, s);
|
|
370
364
|
}
|
|
@@ -376,7 +370,7 @@ class ht extends f {
|
|
|
376
370
|
}
|
|
377
371
|
}
|
|
378
372
|
}
|
|
379
|
-
class
|
|
373
|
+
class ft extends f {
|
|
380
374
|
constructor(t, s) {
|
|
381
375
|
super(t, s);
|
|
382
376
|
}
|
|
@@ -384,11 +378,11 @@ class ut extends f {
|
|
|
384
378
|
const t = this.findProp("models", n.LOCAL), s = this.findProp("out", n.WRITE_CTX);
|
|
385
379
|
if (t && s) {
|
|
386
380
|
const i = l(t.value), o = l(s.value);
|
|
387
|
-
this.writeContext(o,
|
|
381
|
+
this.writeContext(o, kt(this.ssp, i));
|
|
388
382
|
}
|
|
389
383
|
}
|
|
390
384
|
}
|
|
391
|
-
class
|
|
385
|
+
class Ct extends f {
|
|
392
386
|
constructor(t, s) {
|
|
393
387
|
super(t, s);
|
|
394
388
|
}
|
|
@@ -400,7 +394,7 @@ class dt extends f {
|
|
|
400
394
|
}
|
|
401
395
|
}
|
|
402
396
|
}
|
|
403
|
-
class
|
|
397
|
+
class At extends f {
|
|
404
398
|
constructor(t, s) {
|
|
405
399
|
super(t, s);
|
|
406
400
|
}
|
|
@@ -424,7 +418,7 @@ class pt extends f {
|
|
|
424
418
|
}
|
|
425
419
|
}
|
|
426
420
|
const { objectHandle: X } = T.utils;
|
|
427
|
-
class
|
|
421
|
+
class Ot extends f {
|
|
428
422
|
constructor(t, s) {
|
|
429
423
|
super(t, s);
|
|
430
424
|
}
|
|
@@ -449,14 +443,14 @@ class ft extends f {
|
|
|
449
443
|
}
|
|
450
444
|
}
|
|
451
445
|
}
|
|
452
|
-
const { objectHandle:
|
|
453
|
-
class
|
|
446
|
+
const { objectHandle: U } = T.utils;
|
|
447
|
+
class gt extends f {
|
|
454
448
|
constructor(t, s) {
|
|
455
449
|
super(t, s);
|
|
456
450
|
}
|
|
457
451
|
filterHideObject(t) {
|
|
458
452
|
const s = [];
|
|
459
|
-
return
|
|
453
|
+
return U(t, (i) => {
|
|
460
454
|
i.visible === !0 && s.push(i);
|
|
461
455
|
}), s;
|
|
462
456
|
}
|
|
@@ -466,7 +460,7 @@ class Ct extends f {
|
|
|
466
460
|
const o = this.getValue(s, i);
|
|
467
461
|
if (o) {
|
|
468
462
|
const a = this.filterHideObject(o), c = (h) => {
|
|
469
|
-
|
|
463
|
+
U(a, (u) => {
|
|
470
464
|
u.visible = h;
|
|
471
465
|
}), this.ssp.render();
|
|
472
466
|
};
|
|
@@ -475,8 +469,8 @@ class Ct extends f {
|
|
|
475
469
|
}
|
|
476
470
|
}
|
|
477
471
|
}
|
|
478
|
-
const { objectHandle:
|
|
479
|
-
class
|
|
472
|
+
const { objectHandle: S } = T.utils;
|
|
473
|
+
class Pt extends f {
|
|
480
474
|
constructor(t, s) {
|
|
481
475
|
super(t, s);
|
|
482
476
|
}
|
|
@@ -486,10 +480,10 @@ class At extends f {
|
|
|
486
480
|
const c = this.getValue(s, a), h = this.getValue(i), u = this.getValue(o);
|
|
487
481
|
if (c) {
|
|
488
482
|
const C = [];
|
|
489
|
-
|
|
483
|
+
S(c, (p) => {
|
|
490
484
|
C.push(p.position.clone());
|
|
491
485
|
});
|
|
492
|
-
const
|
|
486
|
+
const P = (p, A) => {
|
|
493
487
|
switch (h) {
|
|
494
488
|
case "x":
|
|
495
489
|
p.setX(A.x);
|
|
@@ -503,24 +497,24 @@ class At extends f {
|
|
|
503
497
|
}
|
|
504
498
|
};
|
|
505
499
|
await (async () => {
|
|
506
|
-
const p =
|
|
507
|
-
const
|
|
500
|
+
const p = S(c, async (A) => {
|
|
501
|
+
const O = A.position.clone();
|
|
508
502
|
switch (h) {
|
|
509
503
|
case "x":
|
|
510
|
-
await this.ssp.animation(
|
|
504
|
+
await this.ssp.animation(O, new I().set(O.x + u, O.y, O.z), { duration: 800 }, (g) => P(A.position, g));
|
|
511
505
|
break;
|
|
512
506
|
case "y":
|
|
513
|
-
await this.ssp.animation(
|
|
507
|
+
await this.ssp.animation(O, new I().set(O.x, O.y + u, O.z), { duration: 800 }, (g) => P(A.position, g));
|
|
514
508
|
break;
|
|
515
509
|
case "z":
|
|
516
|
-
await this.ssp.animation(
|
|
510
|
+
await this.ssp.animation(O, new I().set(O.x, O.y, O.z + u), { duration: 800 }, (g) => P(A.position, g));
|
|
517
511
|
break;
|
|
518
512
|
}
|
|
519
513
|
});
|
|
520
514
|
p instanceof Array ? await Promise.all(p) : await p, this.ssp.render();
|
|
521
515
|
})(), this.cleanSets.add(() => {
|
|
522
516
|
let p = 0;
|
|
523
|
-
|
|
517
|
+
S(c, (A) => {
|
|
524
518
|
A.position.copy(C[p++]);
|
|
525
519
|
});
|
|
526
520
|
});
|
|
@@ -529,7 +523,7 @@ class At extends f {
|
|
|
529
523
|
}
|
|
530
524
|
}
|
|
531
525
|
const { objectHandle: v } = T.utils;
|
|
532
|
-
class
|
|
526
|
+
class Tt extends f {
|
|
533
527
|
constructor(t, s) {
|
|
534
528
|
super(t, s);
|
|
535
529
|
}
|
|
@@ -542,7 +536,7 @@ class gt extends f {
|
|
|
542
536
|
v(c, (p) => {
|
|
543
537
|
C.push(p.scale.clone());
|
|
544
538
|
});
|
|
545
|
-
const
|
|
539
|
+
const P = (p, A) => {
|
|
546
540
|
switch (h) {
|
|
547
541
|
case "x":
|
|
548
542
|
p.setX(A.x);
|
|
@@ -557,16 +551,16 @@ class gt extends f {
|
|
|
557
551
|
};
|
|
558
552
|
await (async () => {
|
|
559
553
|
const p = v(c, async (A) => {
|
|
560
|
-
const
|
|
554
|
+
const O = A.scale.clone();
|
|
561
555
|
switch (h) {
|
|
562
556
|
case "x":
|
|
563
|
-
await this.ssp.animation(
|
|
557
|
+
await this.ssp.animation(O, new I().set(O.x * u, O.y, O.z), { duration: 800 }, (g) => P(A.scale, g));
|
|
564
558
|
break;
|
|
565
559
|
case "y":
|
|
566
|
-
await this.ssp.animation(
|
|
560
|
+
await this.ssp.animation(O, new I().set(O.x, O.y * u, O.z), { duration: 800 }, (g) => P(A.scale, g));
|
|
567
561
|
break;
|
|
568
562
|
case "z":
|
|
569
|
-
await this.ssp.animation(
|
|
563
|
+
await this.ssp.animation(O, new I().set(O.x, O.y, O.z * u), { duration: 800 }, (g) => P(A.scale, g));
|
|
570
564
|
break;
|
|
571
565
|
}
|
|
572
566
|
});
|
|
@@ -582,7 +576,7 @@ class gt extends f {
|
|
|
582
576
|
}
|
|
583
577
|
}
|
|
584
578
|
const { objectHandle: V } = T.utils;
|
|
585
|
-
class
|
|
579
|
+
class Et extends f {
|
|
586
580
|
constructor(t, s) {
|
|
587
581
|
super(t, s);
|
|
588
582
|
}
|
|
@@ -595,7 +589,7 @@ class Pt extends f {
|
|
|
595
589
|
V(c, (p) => {
|
|
596
590
|
C.push(p.rotation.clone());
|
|
597
591
|
});
|
|
598
|
-
const
|
|
592
|
+
const P = (p, A) => {
|
|
599
593
|
switch (h) {
|
|
600
594
|
case "x":
|
|
601
595
|
p.x = A.x;
|
|
@@ -609,17 +603,17 @@ class Pt extends f {
|
|
|
609
603
|
}
|
|
610
604
|
};
|
|
611
605
|
await (async () => {
|
|
612
|
-
const p = u / 180 * Math.PI, A = V(c, async (
|
|
613
|
-
const
|
|
606
|
+
const p = u / 180 * Math.PI, A = V(c, async (O) => {
|
|
607
|
+
const g = O.rotation.clone();
|
|
614
608
|
switch (h) {
|
|
615
609
|
case "x":
|
|
616
|
-
await this.ssp.animation(
|
|
610
|
+
await this.ssp.animation(g, new D().set(g.x + p, g.y, g.z), { duration: 800 }, (m) => P(O.rotation, m));
|
|
617
611
|
break;
|
|
618
612
|
case "y":
|
|
619
|
-
await this.ssp.animation(
|
|
613
|
+
await this.ssp.animation(g, new D().set(g.x, g.y + p, g.z), { duration: 800 }, (m) => P(O.rotation, m));
|
|
620
614
|
break;
|
|
621
615
|
case "z":
|
|
622
|
-
await this.ssp.animation(
|
|
616
|
+
await this.ssp.animation(g, new D().set(g.x, g.y, g.z + p), { duration: 800 }, (m) => P(O.rotation, m));
|
|
623
617
|
break;
|
|
624
618
|
}
|
|
625
619
|
});
|
|
@@ -634,7 +628,7 @@ class Pt extends f {
|
|
|
634
628
|
}
|
|
635
629
|
}
|
|
636
630
|
}
|
|
637
|
-
class
|
|
631
|
+
class wt extends f {
|
|
638
632
|
constructor(t, s) {
|
|
639
633
|
super(t, s);
|
|
640
634
|
}
|
|
@@ -646,7 +640,7 @@ class Ot extends f {
|
|
|
646
640
|
}
|
|
647
641
|
}
|
|
648
642
|
}
|
|
649
|
-
class
|
|
643
|
+
class Lt extends f {
|
|
650
644
|
constructor(t, s) {
|
|
651
645
|
super(t, s);
|
|
652
646
|
}
|
|
@@ -658,7 +652,7 @@ class Tt extends f {
|
|
|
658
652
|
}
|
|
659
653
|
}
|
|
660
654
|
}
|
|
661
|
-
class
|
|
655
|
+
class It extends f {
|
|
662
656
|
constructor(t, s) {
|
|
663
657
|
super(t, s);
|
|
664
658
|
}
|
|
@@ -670,7 +664,7 @@ class Et extends f {
|
|
|
670
664
|
}
|
|
671
665
|
}
|
|
672
666
|
}
|
|
673
|
-
class
|
|
667
|
+
class mt extends f {
|
|
674
668
|
constructor(t, s) {
|
|
675
669
|
super(t, s);
|
|
676
670
|
}
|
|
@@ -682,7 +676,7 @@ class wt extends f {
|
|
|
682
676
|
}
|
|
683
677
|
}
|
|
684
678
|
}
|
|
685
|
-
class
|
|
679
|
+
class Nt extends f {
|
|
686
680
|
constructor(t, s) {
|
|
687
681
|
super(t, s);
|
|
688
682
|
}
|
|
@@ -694,7 +688,7 @@ class Lt extends f {
|
|
|
694
688
|
}
|
|
695
689
|
}
|
|
696
690
|
}
|
|
697
|
-
class
|
|
691
|
+
class bt extends f {
|
|
698
692
|
constructor(t, s) {
|
|
699
693
|
super(t, s);
|
|
700
694
|
}
|
|
@@ -707,14 +701,14 @@ class It extends f {
|
|
|
707
701
|
const d = this.ctx._userDataMap.get(h);
|
|
708
702
|
d && (C = d[a]);
|
|
709
703
|
} else if (u && u.userData.properties) {
|
|
710
|
-
const d = u.userData.properties.find((
|
|
704
|
+
const d = u.userData.properties.find((P) => P.key === a);
|
|
711
705
|
d && d.value !== void 0 && (C = d.value);
|
|
712
706
|
}
|
|
713
707
|
this.writeContext(c, C);
|
|
714
708
|
}
|
|
715
709
|
}
|
|
716
710
|
}
|
|
717
|
-
class
|
|
711
|
+
class _t extends f {
|
|
718
712
|
constructor(t, s) {
|
|
719
713
|
super(t, s);
|
|
720
714
|
}
|
|
@@ -729,7 +723,7 @@ class mt extends f {
|
|
|
729
723
|
}
|
|
730
724
|
}
|
|
731
725
|
}
|
|
732
|
-
class
|
|
726
|
+
class xt extends f {
|
|
733
727
|
constructor(t, s) {
|
|
734
728
|
super(t, s);
|
|
735
729
|
}
|
|
@@ -741,7 +735,7 @@ class Nt extends f {
|
|
|
741
735
|
}
|
|
742
736
|
}
|
|
743
737
|
}
|
|
744
|
-
class
|
|
738
|
+
class yt extends f {
|
|
745
739
|
constructor(t, s) {
|
|
746
740
|
super(t, s);
|
|
747
741
|
}
|
|
@@ -753,7 +747,7 @@ class _t extends f {
|
|
|
753
747
|
}
|
|
754
748
|
}
|
|
755
749
|
}
|
|
756
|
-
class
|
|
750
|
+
class Mt extends f {
|
|
757
751
|
constructor(t, s) {
|
|
758
752
|
super(t, s);
|
|
759
753
|
}
|
|
@@ -770,7 +764,7 @@ class xt extends f {
|
|
|
770
764
|
}
|
|
771
765
|
}
|
|
772
766
|
}
|
|
773
|
-
class
|
|
767
|
+
class Dt extends f {
|
|
774
768
|
constructor(t, s) {
|
|
775
769
|
super(t, s);
|
|
776
770
|
}
|
|
@@ -795,7 +789,7 @@ class bt extends f {
|
|
|
795
789
|
}
|
|
796
790
|
}
|
|
797
791
|
}
|
|
798
|
-
class
|
|
792
|
+
class St extends f {
|
|
799
793
|
constructor(t, s) {
|
|
800
794
|
super(t, s);
|
|
801
795
|
}
|
|
@@ -819,14 +813,14 @@ class yt extends f {
|
|
|
819
813
|
}
|
|
820
814
|
}
|
|
821
815
|
const N = /* @__PURE__ */ new Map();
|
|
822
|
-
async function
|
|
823
|
-
const { id: i, keyframes: o } = s, a = new
|
|
816
|
+
async function vt(e, t, s) {
|
|
817
|
+
const { id: i, keyframes: o } = s, a = new k(e, t);
|
|
824
818
|
N.has(i) || N.set(i, /* @__PURE__ */ new Set()), N.get(i)?.add(a), await a.play(o);
|
|
825
819
|
}
|
|
826
820
|
function B(e) {
|
|
827
821
|
N.get(e)?.forEach((t) => t.stop()), N.get(e)?.clear();
|
|
828
822
|
}
|
|
829
|
-
class
|
|
823
|
+
class Vt extends f {
|
|
830
824
|
constructor(t, s) {
|
|
831
825
|
super(t, s);
|
|
832
826
|
}
|
|
@@ -840,7 +834,7 @@ class St extends f {
|
|
|
840
834
|
const C = u.find((d) => d.id === c);
|
|
841
835
|
C && await W(async () => {
|
|
842
836
|
const d = a.matrix.clone();
|
|
843
|
-
await
|
|
837
|
+
await vt(this.ssp, a, C), this.cleanSets.add(() => {
|
|
844
838
|
B(C.id), a && d.decompose(a.position, a.quaternion, a.scale);
|
|
845
839
|
});
|
|
846
840
|
}, h);
|
|
@@ -849,7 +843,7 @@ class St extends f {
|
|
|
849
843
|
}
|
|
850
844
|
}
|
|
851
845
|
}
|
|
852
|
-
class
|
|
846
|
+
class Ht extends f {
|
|
853
847
|
constructor(t, s) {
|
|
854
848
|
super(t, s);
|
|
855
849
|
}
|
|
@@ -861,15 +855,15 @@ class Dt extends f {
|
|
|
861
855
|
}
|
|
862
856
|
}
|
|
863
857
|
}
|
|
864
|
-
const
|
|
865
|
-
async function
|
|
866
|
-
const { id: i, keyframes: o } = s, a = new
|
|
867
|
-
|
|
858
|
+
const b = /* @__PURE__ */ new Map();
|
|
859
|
+
async function Rt(e, t, s) {
|
|
860
|
+
const { id: i, keyframes: o } = s, a = new k(e, t);
|
|
861
|
+
b.has(i) || b.set(i, /* @__PURE__ */ new Set()), b.get(i)?.add(a), await a.play(o);
|
|
868
862
|
}
|
|
869
863
|
function G(e) {
|
|
870
|
-
|
|
864
|
+
b.get(e)?.forEach((t) => t.stop()), b.get(e)?.clear();
|
|
871
865
|
}
|
|
872
|
-
class
|
|
866
|
+
class jt extends f {
|
|
873
867
|
constructor(t, s) {
|
|
874
868
|
super(t, s);
|
|
875
869
|
}
|
|
@@ -883,11 +877,11 @@ class Vt extends f {
|
|
|
883
877
|
const C = u.find((d) => d.id === c);
|
|
884
878
|
if (C) {
|
|
885
879
|
let d = null;
|
|
886
|
-
s.valueType === "Mesh" ? d = a : s.valueType === "Model" && (d =
|
|
880
|
+
s.valueType === "Mesh" ? d = a : s.valueType === "Model" && (d = _(a, C.refId)), d && await W(async () => {
|
|
887
881
|
if (d) {
|
|
888
|
-
const
|
|
889
|
-
await
|
|
890
|
-
G(C.id), d &&
|
|
882
|
+
const P = d.matrix.clone();
|
|
883
|
+
await Rt(this.ssp, d, C), this.cleanSets.add(() => {
|
|
884
|
+
G(C.id), d && P.decompose(d.position, d.quaternion, d.scale);
|
|
891
885
|
});
|
|
892
886
|
}
|
|
893
887
|
}, h);
|
|
@@ -897,7 +891,7 @@ class Vt extends f {
|
|
|
897
891
|
}
|
|
898
892
|
}
|
|
899
893
|
}
|
|
900
|
-
class
|
|
894
|
+
class Xt extends f {
|
|
901
895
|
constructor(t, s) {
|
|
902
896
|
super(t, s);
|
|
903
897
|
}
|
|
@@ -909,7 +903,7 @@ class Rt extends f {
|
|
|
909
903
|
}
|
|
910
904
|
}
|
|
911
905
|
}
|
|
912
|
-
function
|
|
906
|
+
function Ut(e, t) {
|
|
913
907
|
switch (t.type) {
|
|
914
908
|
case r.START:
|
|
915
909
|
return new Z(e, t);
|
|
@@ -920,75 +914,75 @@ function Ht(e, t) {
|
|
|
920
914
|
case r.HIGHLIGHT:
|
|
921
915
|
return new st(e, t);
|
|
922
916
|
case r.UN_HIGHLIGHT:
|
|
923
|
-
return new
|
|
917
|
+
return new it(e, t);
|
|
924
918
|
case r.OPACITY:
|
|
925
|
-
return new ot(e, t);
|
|
926
|
-
case r.UN_OPACITY:
|
|
927
919
|
return new nt(e, t);
|
|
920
|
+
case r.UN_OPACITY:
|
|
921
|
+
return new ct(e, t);
|
|
928
922
|
case r.EMISSIVE:
|
|
929
|
-
return new
|
|
923
|
+
return new rt(e, t);
|
|
930
924
|
case r.UN_EMISSIVE:
|
|
931
|
-
return new
|
|
925
|
+
return new ht(e, t);
|
|
932
926
|
// 获取对象
|
|
933
927
|
case r.MESH:
|
|
934
|
-
return new
|
|
928
|
+
return new ut(e, t);
|
|
935
929
|
case r.MESHES:
|
|
936
|
-
return new
|
|
930
|
+
return new dt(e, t);
|
|
937
931
|
case r.MODEL:
|
|
938
|
-
return new
|
|
932
|
+
return new pt(e, t);
|
|
939
933
|
case r.MODELS:
|
|
940
|
-
return new
|
|
934
|
+
return new ft(e, t);
|
|
941
935
|
case r.SPACE:
|
|
942
|
-
return new
|
|
936
|
+
return new Lt(e, t);
|
|
943
937
|
case r.SPACES:
|
|
944
|
-
return new
|
|
938
|
+
return new It(e, t);
|
|
945
939
|
case r.POIS:
|
|
946
|
-
return new
|
|
940
|
+
return new Nt(e, t);
|
|
947
941
|
case r.POI:
|
|
948
|
-
return new
|
|
942
|
+
return new mt(e, t);
|
|
949
943
|
case r.PATH:
|
|
950
|
-
return new
|
|
944
|
+
return new xt(e, t);
|
|
951
945
|
case r.PATHS:
|
|
952
|
-
return new
|
|
946
|
+
return new yt(e, t);
|
|
953
947
|
// 逻辑节点
|
|
954
948
|
case r.DELAY:
|
|
955
|
-
return new
|
|
949
|
+
return new Ct(e, t);
|
|
956
950
|
case r.CONDITION_NODE:
|
|
957
|
-
return new
|
|
951
|
+
return new At(e, t);
|
|
958
952
|
// 显示隐藏
|
|
959
953
|
case r.SHOW:
|
|
960
|
-
return new
|
|
954
|
+
return new Ot(e, t);
|
|
961
955
|
case r.HIDE:
|
|
962
|
-
return new
|
|
956
|
+
return new gt(e, t);
|
|
963
957
|
// 动画相关
|
|
964
958
|
case r.CLIP_ANIMATION:
|
|
965
|
-
return new
|
|
959
|
+
return new Dt(e, t);
|
|
966
960
|
case r.UN_CLIP_ANIMATION:
|
|
967
|
-
return new yt(e, t);
|
|
968
|
-
case r.TWEEN_ANIMATION:
|
|
969
961
|
return new St(e, t);
|
|
962
|
+
case r.TWEEN_ANIMATION:
|
|
963
|
+
return new Vt(e, t);
|
|
970
964
|
case r.UN_TWEEN_ANIMATION:
|
|
971
|
-
return new
|
|
965
|
+
return new Ht(e, t);
|
|
972
966
|
case r.COMPONENT_TWEEN_ANIMATION:
|
|
973
|
-
return new
|
|
967
|
+
return new jt(e, t);
|
|
974
968
|
case r.UN_COMPONENT_TWEEN_ANIMATION:
|
|
975
|
-
return new
|
|
969
|
+
return new Xt(e, t);
|
|
976
970
|
// 移动
|
|
977
971
|
case r.TRANSLATE:
|
|
978
|
-
return new At(e, t);
|
|
979
|
-
case r.ROTATE:
|
|
980
972
|
return new Pt(e, t);
|
|
973
|
+
case r.ROTATE:
|
|
974
|
+
return new Et(e, t);
|
|
981
975
|
case r.SCALE:
|
|
982
|
-
return new
|
|
976
|
+
return new Tt(e, t);
|
|
983
977
|
case r.FLY_TO:
|
|
984
|
-
return new
|
|
978
|
+
return new wt(e, t);
|
|
985
979
|
// 数据处理节点
|
|
986
980
|
case r.DATA_EXTRACTION:
|
|
987
|
-
return new
|
|
981
|
+
return new bt(e, t);
|
|
988
982
|
case r.DATA_FILTER:
|
|
989
|
-
return new
|
|
983
|
+
return new _t(e, t);
|
|
990
984
|
case r.USER_DATA_NODE:
|
|
991
|
-
return new
|
|
985
|
+
return new Mt(e, t);
|
|
992
986
|
default:
|
|
993
987
|
return new f(e, t);
|
|
994
988
|
}
|
|
@@ -999,7 +993,7 @@ function l(e) {
|
|
|
999
993
|
async function W(e, t) {
|
|
1000
994
|
t ? await e() : e();
|
|
1001
995
|
}
|
|
1002
|
-
function
|
|
996
|
+
function kt(e, t) {
|
|
1003
997
|
return t.map((s) => e.getObjectById(s)).filter(Boolean);
|
|
1004
998
|
}
|
|
1005
999
|
function E(e, t, s) {
|
|
@@ -1008,20 +1002,20 @@ function E(e, t, s) {
|
|
|
1008
1002
|
return i;
|
|
1009
1003
|
{
|
|
1010
1004
|
const { viewport: { scene: o } } = e;
|
|
1011
|
-
return
|
|
1005
|
+
return _(s ?? o, t);
|
|
1012
1006
|
}
|
|
1013
1007
|
}
|
|
1014
|
-
function
|
|
1008
|
+
function _(e, t) {
|
|
1015
1009
|
if (e.userData.key === t || e.uuid === t) return e;
|
|
1016
1010
|
for (let s = 0, i = e.children.length; s < i; s++) {
|
|
1017
|
-
const o = e.children[s], a =
|
|
1011
|
+
const o = e.children[s], a = _(o, t);
|
|
1018
1012
|
if (a !== null)
|
|
1019
1013
|
return a;
|
|
1020
1014
|
}
|
|
1021
1015
|
return null;
|
|
1022
1016
|
}
|
|
1023
|
-
const { utils: { sleep:
|
|
1024
|
-
class
|
|
1017
|
+
const { utils: { sleep: Bt } } = T;
|
|
1018
|
+
class Gt extends z {
|
|
1025
1019
|
ssp;
|
|
1026
1020
|
flow;
|
|
1027
1021
|
nodes;
|
|
@@ -1055,7 +1049,7 @@ class kt extends z {
|
|
|
1055
1049
|
this.clear();
|
|
1056
1050
|
const { nodes: t, edges: s } = this.flow;
|
|
1057
1051
|
t.forEach((i) => {
|
|
1058
|
-
const o =
|
|
1052
|
+
const o = Ut(this, i);
|
|
1059
1053
|
this.addNode(o);
|
|
1060
1054
|
}), s.forEach((i) => {
|
|
1061
1055
|
const o = new K(i);
|
|
@@ -1079,7 +1073,7 @@ class kt extends z {
|
|
|
1079
1073
|
async debug(t = {}, s = 1500) {
|
|
1080
1074
|
const i = this.onNodeAfter;
|
|
1081
1075
|
this.onNodeAfter = async (o) => {
|
|
1082
|
-
await
|
|
1076
|
+
await Bt(s), i?.(o);
|
|
1083
1077
|
}, await this.run(t);
|
|
1084
1078
|
}
|
|
1085
1079
|
/**
|
|
@@ -1106,14 +1100,14 @@ class kt extends z {
|
|
|
1106
1100
|
this.stop(), this.cleanup();
|
|
1107
1101
|
}
|
|
1108
1102
|
}
|
|
1109
|
-
class
|
|
1103
|
+
class Wt extends Gt {
|
|
1110
1104
|
flow;
|
|
1111
1105
|
constructor(t, s) {
|
|
1112
1106
|
super(t, s), this.flow = s;
|
|
1113
1107
|
}
|
|
1114
1108
|
}
|
|
1115
|
-
const
|
|
1116
|
-
class
|
|
1109
|
+
const R = (e, t) => e.userData.key === t ? e : e.parent ? R(e.parent, t) : !1, { groupBy: Ft, asyncRunWithCode: zt } = T.utils;
|
|
1110
|
+
class Yt {
|
|
1117
1111
|
ssp;
|
|
1118
1112
|
interaction;
|
|
1119
1113
|
flows;
|
|
@@ -1123,7 +1117,7 @@ class Wt {
|
|
|
1123
1117
|
status = "ready";
|
|
1124
1118
|
target;
|
|
1125
1119
|
constructor(t, s, i, o) {
|
|
1126
|
-
this.ssp = t, this.interaction = s, this.flows = i, this.flowsMap =
|
|
1120
|
+
this.ssp = t, this.interaction = s, this.flows = i, this.flowsMap = Ft(i, "id"), this.options = o || {}, this.init();
|
|
1127
1121
|
}
|
|
1128
1122
|
init() {
|
|
1129
1123
|
switch (this.interaction.type) {
|
|
@@ -1167,7 +1161,7 @@ class Wt {
|
|
|
1167
1161
|
// 模型事件触发
|
|
1168
1162
|
modelHandler(t) {
|
|
1169
1163
|
const { target: s, currentTarget: i } = t, o = this.interaction.editionId;
|
|
1170
|
-
o ? (s.sid === o || s.userData.familyId === o) &&
|
|
1164
|
+
o ? (s.sid === o || s.userData.familyId === o) && R(i, this.interaction.modelId) && (this.target = s, this.execBehavior()) : this.interaction.obsTargets?.forEach((a) => {
|
|
1171
1165
|
(a === s.userData.id || a === s.userData.sid) && (this.target = s, this.execBehavior());
|
|
1172
1166
|
});
|
|
1173
1167
|
}
|
|
@@ -1177,7 +1171,7 @@ class Wt {
|
|
|
1177
1171
|
const o = this.flowsMap.get(i);
|
|
1178
1172
|
if (o) {
|
|
1179
1173
|
const a = new Y(this.ssp, o[0]);
|
|
1180
|
-
a.parse(),
|
|
1174
|
+
a.parse(), zt(
|
|
1181
1175
|
() => a.run({
|
|
1182
1176
|
getTarget: s,
|
|
1183
1177
|
getAnimations: this.options.getAnimations,
|
|
@@ -1251,13 +1245,13 @@ class Wt {
|
|
|
1251
1245
|
this.disposables.forEach((t) => t());
|
|
1252
1246
|
}
|
|
1253
1247
|
}
|
|
1254
|
-
var
|
|
1255
|
-
const { groupBy:
|
|
1256
|
-
class is extends
|
|
1248
|
+
var $t = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.SELF = "SELF", e.OTHER = "OTHER", e))($t || {}), F = /* @__PURE__ */ ((e) => (e.FLOW = "FLOW", e.ANIMATION = "ANIMATION", e.DELAY = "DELAY", e))(F || {}), H = /* @__PURE__ */ ((e) => (e.GLOBAL = "GLOBAL", e.INSTANCE = "INSTANCE", e.FAMILY = "FAMILY", e))(H || {}), w = /* @__PURE__ */ ((e) => (e.MOUSE_CLICK = "MOUSE_CLICK", e.MOUSE_DB_CLICK = "MOUSE_DB_CLICK", e.MOUSE_RIGHT_CLICK = "MOUSE_RIGHT_CLICK", e.THING_PROP_CHANGE = "THING_PROP_CHANGE", e.THING_EVENT = "THING_EVENT", e.LOADED = "LOADED", e.MODEL_PROP_CHANGE = "MODEL_PROP_CHANGE", e))(w || {});
|
|
1249
|
+
const { groupBy: Kt, asyncRunWithCode: Jt } = T.utils;
|
|
1250
|
+
class is extends Yt {
|
|
1257
1251
|
flows;
|
|
1258
1252
|
flowsMap;
|
|
1259
1253
|
constructor(t, s, i, o) {
|
|
1260
|
-
super(t, s, i, o), this.flows = i, this.flowsMap =
|
|
1254
|
+
super(t, s, i, o), this.flows = i, this.flowsMap = Kt(i, "id");
|
|
1261
1255
|
}
|
|
1262
1256
|
init() {
|
|
1263
1257
|
switch (this.interaction.type) {
|
|
@@ -1287,9 +1281,9 @@ class is extends Wt {
|
|
|
1287
1281
|
// 获取交互触发的Mesh
|
|
1288
1282
|
async getComponentObsTarget(t) {
|
|
1289
1283
|
const { obsType: s, obsTargets: i } = this.interaction;
|
|
1290
|
-
if (s ===
|
|
1284
|
+
if (s === H.GLOBAL)
|
|
1291
1285
|
return null;
|
|
1292
|
-
if (s ===
|
|
1286
|
+
if (s === H.INSTANCE) {
|
|
1293
1287
|
const o = i?.map((a) => {
|
|
1294
1288
|
const c = E(this.ssp, a);
|
|
1295
1289
|
return c || console.warn("Component Target not found:", a), c;
|
|
@@ -1302,7 +1296,7 @@ class is extends Wt {
|
|
|
1302
1296
|
modelHandler(t) {
|
|
1303
1297
|
const { currentTarget: s } = t;
|
|
1304
1298
|
this.interaction.obsTargets?.forEach((i) => {
|
|
1305
|
-
|
|
1299
|
+
R(s, i) && this.execBehavior();
|
|
1306
1300
|
});
|
|
1307
1301
|
}
|
|
1308
1302
|
// 物模型事件触发
|
|
@@ -1317,8 +1311,8 @@ class is extends Wt {
|
|
|
1317
1311
|
t.forEach((i) => {
|
|
1318
1312
|
const o = this.flowsMap.get(i);
|
|
1319
1313
|
if (o) {
|
|
1320
|
-
const a = new
|
|
1321
|
-
a.parse(),
|
|
1314
|
+
const a = new Wt(this.ssp, o[0]);
|
|
1315
|
+
a.parse(), Jt(
|
|
1322
1316
|
() => a.run({
|
|
1323
1317
|
getTarget: s
|
|
1324
1318
|
})
|
|
@@ -1361,15 +1355,15 @@ class is extends Wt {
|
|
|
1361
1355
|
}
|
|
1362
1356
|
}
|
|
1363
1357
|
export {
|
|
1364
|
-
|
|
1358
|
+
Wt as ComponentFlowParser,
|
|
1365
1359
|
is as ComponentTrigger,
|
|
1366
|
-
|
|
1360
|
+
Gt as FlowParser,
|
|
1367
1361
|
F as InteractionAction,
|
|
1368
|
-
|
|
1369
|
-
|
|
1362
|
+
$t as InteractionActionType,
|
|
1363
|
+
H as InteractionObsType,
|
|
1370
1364
|
w as InteractionType,
|
|
1371
1365
|
f as Node,
|
|
1372
1366
|
n as NodePropTypeEnum,
|
|
1373
1367
|
r as NodeTypeEnum,
|
|
1374
|
-
|
|
1368
|
+
Yt as Trigger
|
|
1375
1369
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-flow",
|
|
3
3
|
"pluginName": "FlowPlugin",
|
|
4
|
-
"version": "2.14.
|
|
4
|
+
"version": "2.14.4",
|
|
5
5
|
"description": "FlowPlugin plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
],
|
|
14
14
|
"author": "xunwei",
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "c3a7ad593a3a6ee4c78136138f79459fc47f198b",
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"soonspacejs": "2.14.
|
|
18
|
+
"soonspacejs": "2.14.4",
|
|
19
19
|
"umanager-animation-parser": "^0.0.6"
|
|
20
20
|
}
|
|
21
21
|
}
|