endset_three_editor 0.10.19 → 0.10.21
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/dist/three-editor.es.js
CHANGED
|
@@ -512,7 +512,7 @@ function Ko(r) {
|
|
|
512
512
|
function Zo(r) {
|
|
513
513
|
r.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
514
514
|
}
|
|
515
|
-
const _e = new $i(), he = new P(),
|
|
515
|
+
const _e = new $i(), he = new P(), qe = new P(), ie = new Ae(), cn = {
|
|
516
516
|
X: new P(1, 0, 0),
|
|
517
517
|
Y: new P(0, 1, 0),
|
|
518
518
|
Z: new P(0, 0, 1)
|
|
@@ -534,19 +534,19 @@ class Qo extends Un {
|
|
|
534
534
|
this._plane = i, n.add(i);
|
|
535
535
|
const o = this;
|
|
536
536
|
function a(h, f) {
|
|
537
|
-
let
|
|
537
|
+
let w = f;
|
|
538
538
|
Object.defineProperty(o, h, {
|
|
539
539
|
get: function() {
|
|
540
|
-
return
|
|
540
|
+
return w !== void 0 ? w : f;
|
|
541
541
|
},
|
|
542
542
|
set: function(D) {
|
|
543
|
-
|
|
543
|
+
w !== D && (w = D, i[h] = D, s[h] = D, o.dispatchEvent({ type: h + "-changed", value: D }), o.dispatchEvent(xs));
|
|
544
544
|
}
|
|
545
545
|
}), o[h] = f, i[h] = f, s[h] = f;
|
|
546
546
|
}
|
|
547
547
|
a("camera", e), a("object", void 0), a("enabled", !0), a("axis", null), a("mode", "translate"), a("translationSnap", null), a("rotationSnap", null), a("scaleSnap", null), a("space", "world"), a("size", 1), a("dragging", !1), a("showX", !0), a("showY", !0), a("showZ", !0), a("showXY", !0), a("showYZ", !0), a("showXZ", !0), a("minX", -1 / 0), a("maxX", 1 / 0), a("minY", -1 / 0), a("maxY", 1 / 0), a("minZ", -1 / 0), a("maxZ", 1 / 0);
|
|
548
|
-
const l = new P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(), A = new Ae(), b = new P(), m = new P(), p = new P(), I = 0,
|
|
549
|
-
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion", A), a("pointStart", b), a("pointEnd", m), a("rotationAxis", p), a("rotationAngle", I), a("eye",
|
|
548
|
+
const l = new P(), c = new P(), d = new Ae(), u = new Ae(), g = new P(), A = new Ae(), b = new P(), m = new P(), p = new P(), I = 0, v = new P();
|
|
549
|
+
a("worldPosition", l), a("worldPositionStart", c), a("worldQuaternion", d), a("worldQuaternionStart", u), a("cameraPosition", g), a("cameraQuaternion", A), a("pointStart", b), a("pointEnd", m), a("rotationAxis", p), a("rotationAngle", I), a("eye", v), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ae(), this._parentQuaternionInv = new Ae(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ae(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ae(), this._scaleStart = new P(), this._getPointer = Jo.bind(this), this._onPointerDown = $o.bind(this), this._onPointerHover = _o.bind(this), this._onPointerMove = er.bind(this), this._onPointerUp = tr.bind(this), t !== null && this.connect(t);
|
|
550
550
|
}
|
|
551
551
|
connect(e) {
|
|
552
552
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
|
|
@@ -588,10 +588,10 @@ class Qo extends Un {
|
|
|
588
588
|
else if (n === "scale") {
|
|
589
589
|
if (t.search("XYZ") !== -1) {
|
|
590
590
|
let a = this.pointEnd.length() / this.pointStart.length();
|
|
591
|
-
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1),
|
|
591
|
+
this.pointEnd.dot(this.pointStart) < 0 && (a *= -1), qe.set(a, a, a);
|
|
592
592
|
} else
|
|
593
|
-
he.copy(this.pointStart),
|
|
594
|
-
s.scale.copy(this._scaleStart).multiply(
|
|
593
|
+
he.copy(this.pointStart), qe.copy(this.pointEnd), he.applyQuaternion(this._worldQuaternionInv), qe.applyQuaternion(this._worldQuaternionInv), qe.divide(he), t.search("X") === -1 && (qe.x = 1), t.search("Y") === -1 && (qe.y = 1), t.search("Z") === -1 && (qe.z = 1);
|
|
594
|
+
s.scale.copy(this._scaleStart).multiply(qe), this.scaleSnap && (t.search("X") !== -1 && (s.scale.x = Math.round(s.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Y") !== -1 && (s.scale.y = Math.round(s.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), t.search("Z") !== -1 && (s.scale.z = Math.round(s.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
|
|
595
595
|
} else if (n === "rotate") {
|
|
596
596
|
this._offset.copy(this.pointEnd).sub(this.pointStart);
|
|
597
597
|
const a = 20 / this.worldPosition.distanceTo(he.setFromMatrixPosition(this.camera.matrixWorld));
|
|
@@ -819,8 +819,8 @@ class nr extends mt {
|
|
|
819
819
|
p.translate(0, 0.04, 0);
|
|
820
820
|
const I = new rt();
|
|
821
821
|
I.setAttribute("position", new ke([0, 0, 0, 1, 0, 0], 3));
|
|
822
|
-
const
|
|
823
|
-
|
|
822
|
+
const v = new ge(75e-4, 75e-4, 0.5, 3);
|
|
823
|
+
v.translate(0, 0.25, 0);
|
|
824
824
|
function h(N, U) {
|
|
825
825
|
const z = new gt(N, 75e-4, 3, 64, U * Math.PI * 2);
|
|
826
826
|
return z.rotateY(Math.PI / 2), z.rotateX(Math.PI / 2), z;
|
|
@@ -829,21 +829,21 @@ class nr extends mt {
|
|
|
829
829
|
const N = new rt();
|
|
830
830
|
return N.setAttribute("position", new ke([0, 0, 0, 1, 1, 1], 3)), N;
|
|
831
831
|
}
|
|
832
|
-
const
|
|
832
|
+
const w = {
|
|
833
833
|
X: [
|
|
834
834
|
[new L(m, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
835
835
|
[new L(m, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
|
|
836
|
-
[new L(
|
|
836
|
+
[new L(v, i), [0, 0, 0], [0, 0, -Math.PI / 2]]
|
|
837
837
|
],
|
|
838
838
|
Y: [
|
|
839
839
|
[new L(m, o), [0, 0.5, 0]],
|
|
840
840
|
[new L(m, o), [0, -0.5, 0], [Math.PI, 0, 0]],
|
|
841
|
-
[new L(
|
|
841
|
+
[new L(v, o)]
|
|
842
842
|
],
|
|
843
843
|
Z: [
|
|
844
844
|
[new L(m, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
845
845
|
[new L(m, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
|
|
846
|
-
[new L(
|
|
846
|
+
[new L(v, a), null, [Math.PI / 2, 0, 0]]
|
|
847
847
|
],
|
|
848
848
|
XYZ: [
|
|
849
849
|
[new L(new Ft(0.1, 0), u), [0, 0, 0]]
|
|
@@ -940,17 +940,17 @@ class nr extends mt {
|
|
|
940
940
|
}, se = {
|
|
941
941
|
X: [
|
|
942
942
|
[new L(p, i), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
|
|
943
|
-
[new L(
|
|
943
|
+
[new L(v, i), [0, 0, 0], [0, 0, -Math.PI / 2]],
|
|
944
944
|
[new L(p, i), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
|
|
945
945
|
],
|
|
946
946
|
Y: [
|
|
947
947
|
[new L(p, o), [0, 0.5, 0]],
|
|
948
|
-
[new L(
|
|
948
|
+
[new L(v, o)],
|
|
949
949
|
[new L(p, o), [0, -0.5, 0], [0, 0, Math.PI]]
|
|
950
950
|
],
|
|
951
951
|
Z: [
|
|
952
952
|
[new L(p, a), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
|
|
953
|
-
[new L(
|
|
953
|
+
[new L(v, a), [0, 0, 0], [Math.PI / 2, 0, 0]],
|
|
954
954
|
[new L(p, a), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
|
|
955
955
|
],
|
|
956
956
|
XY: [
|
|
@@ -1005,14 +1005,14 @@ class nr extends mt {
|
|
|
1005
1005
|
const U = new mt();
|
|
1006
1006
|
for (const z in N)
|
|
1007
1007
|
for (let _ = N[z].length; _--; ) {
|
|
1008
|
-
const B = N[z][_][0].clone(), be = N[z][_][1], Oe = N[z][_][2], Re = N[z][_][3],
|
|
1009
|
-
B.name = z, B.tag =
|
|
1008
|
+
const B = N[z][_][0].clone(), be = N[z][_][1], Oe = N[z][_][2], Re = N[z][_][3], Ve = N[z][_][4];
|
|
1009
|
+
B.name = z, B.tag = Ve, be && B.position.set(be[0], be[1], be[2]), Oe && B.rotation.set(Oe[0], Oe[1], Oe[2]), Re && B.scale.set(Re[0], Re[1], Re[2]), B.updateMatrix();
|
|
1010
1010
|
const Le = B.geometry.clone();
|
|
1011
1011
|
Le.applyMatrix4(B.matrix), B.geometry = Le, B.renderOrder = 1 / 0, B.position.set(0, 0, 0), B.rotation.set(0, 0, 0), B.scale.set(1, 1, 1), U.add(B);
|
|
1012
1012
|
}
|
|
1013
1013
|
return U;
|
|
1014
1014
|
}
|
|
1015
|
-
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Z(
|
|
1015
|
+
this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = Z(w)), this.add(this.gizmo.rotate = Z(T)), this.add(this.gizmo.scale = Z(se)), this.add(this.picker.translate = Z(D)), this.add(this.picker.rotate = Z($)), this.add(this.picker.scale = Z(ne)), this.add(this.helper.translate = Z(O)), this.add(this.helper.rotate = Z(Y)), this.add(this.helper.scale = Z(J)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
|
|
1016
1016
|
}
|
|
1017
1017
|
// updateMatrixWorld will update transformations and appearance of individual handles
|
|
1018
1018
|
updateMatrixWorld(e) {
|
|
@@ -1625,14 +1625,14 @@ class Ar {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
if (b.isCSS2DObject) {
|
|
1627
1627
|
ct.setFromMatrixPosition(b.matrixWorld), ct.applyMatrix4(yn);
|
|
1628
|
-
const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(p.layers) === !0,
|
|
1629
|
-
|
|
1628
|
+
const I = ct.z >= -1 && ct.z <= 1 && b.layers.test(p.layers) === !0, v = b.element;
|
|
1629
|
+
v.style.display = I === !0 ? "" : "none", I === !0 && (b.onBeforeRender(t, m, p), v.style.transform = "translate(" + -100 * b.center.x + "%," + -100 * b.center.y + "%)translate(" + (ct.x * i + i) + "px," + (-ct.y * o + o) + "px)", v.parentNode !== l && l.appendChild(v), b.onAfterRender(t, m, p));
|
|
1630
1630
|
const h = {
|
|
1631
1631
|
distanceToCameraSquared: u(p, b)
|
|
1632
1632
|
};
|
|
1633
1633
|
a.objects.set(b, h);
|
|
1634
1634
|
}
|
|
1635
|
-
for (let I = 0,
|
|
1635
|
+
for (let I = 0, v = b.children.length; I < v; I++)
|
|
1636
1636
|
d(b.children[I], m, p);
|
|
1637
1637
|
}
|
|
1638
1638
|
function u(b, m) {
|
|
@@ -1645,13 +1645,13 @@ class Ar {
|
|
|
1645
1645
|
}), m;
|
|
1646
1646
|
}
|
|
1647
1647
|
function A(b) {
|
|
1648
|
-
const m = g(b).sort(function(I,
|
|
1649
|
-
if (I.renderOrder !==
|
|
1650
|
-
return
|
|
1651
|
-
const h = a.objects.get(I).distanceToCameraSquared, f = a.objects.get(
|
|
1648
|
+
const m = g(b).sort(function(I, v) {
|
|
1649
|
+
if (I.renderOrder !== v.renderOrder)
|
|
1650
|
+
return v.renderOrder - I.renderOrder;
|
|
1651
|
+
const h = a.objects.get(I).distanceToCameraSquared, f = a.objects.get(v).distanceToCameraSquared;
|
|
1652
1652
|
return h - f;
|
|
1653
1653
|
}), p = m.length;
|
|
1654
|
-
for (let I = 0,
|
|
1654
|
+
for (let I = 0, v = m.length; I < v; I++)
|
|
1655
1655
|
m[I].element.style.zIndex = p - I;
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
@@ -2247,19 +2247,19 @@ class Fr {
|
|
|
2247
2247
|
b.setUint32(0, A.byteLength, !0), b.setUint32(4, Lr, !0);
|
|
2248
2248
|
const m = ws(Nr(JSON.stringify(o)), 32), p = new DataView(new ArrayBuffer(vn));
|
|
2249
2249
|
p.setUint32(0, m.byteLength, !0), p.setUint32(4, Sr, !0);
|
|
2250
|
-
const I = new ArrayBuffer(wn),
|
|
2251
|
-
|
|
2250
|
+
const I = new ArrayBuffer(wn), v = new DataView(I);
|
|
2251
|
+
v.setUint32(0, Rr, !0), v.setUint32(4, Pr, !0);
|
|
2252
2252
|
const h = wn + p.byteLength + m.byteLength + b.byteLength + A.byteLength;
|
|
2253
|
-
|
|
2253
|
+
v.setUint32(8, h, !0);
|
|
2254
2254
|
const f = new Blob([
|
|
2255
2255
|
I,
|
|
2256
2256
|
p,
|
|
2257
2257
|
m,
|
|
2258
2258
|
b,
|
|
2259
2259
|
A
|
|
2260
|
-
], { type: "application/octet-stream" }),
|
|
2261
|
-
|
|
2262
|
-
t(
|
|
2260
|
+
], { type: "application/octet-stream" }), w = new FileReader();
|
|
2261
|
+
w.readAsArrayBuffer(f), w.onloadend = function() {
|
|
2262
|
+
t(w.result);
|
|
2263
2263
|
};
|
|
2264
2264
|
};
|
|
2265
2265
|
} else if (o.buffers && o.buffers.length > 0) {
|
|
@@ -2650,7 +2650,7 @@ class Fr {
|
|
|
2650
2650
|
async processMeshAsync(e) {
|
|
2651
2651
|
const t = this.cache, n = this.json, s = [e.geometry.uuid];
|
|
2652
2652
|
if (Array.isArray(e.material))
|
|
2653
|
-
for (let f = 0,
|
|
2653
|
+
for (let f = 0, w = e.material.length; f < w; f++)
|
|
2654
2654
|
s.push(e.material[f].uuid);
|
|
2655
2655
|
else
|
|
2656
2656
|
s.push(e.material.uuid);
|
|
@@ -2672,20 +2672,20 @@ class Fr {
|
|
|
2672
2672
|
let b = null;
|
|
2673
2673
|
for (let f in o.attributes) {
|
|
2674
2674
|
if (f.slice(0, 5) === "morph") continue;
|
|
2675
|
-
const
|
|
2676
|
-
if (f = g[f] || f.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f) && !f.startsWith("_") && (f = "_" + f), t.attributes.has(this.getUID(
|
|
2677
|
-
c[f] = t.attributes.get(this.getUID(
|
|
2675
|
+
const w = o.attributes[f];
|
|
2676
|
+
if (f = g[f] || f.toUpperCase(), !/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(f) && !f.startsWith("_") && (f = "_" + f), t.attributes.has(this.getUID(w))) {
|
|
2677
|
+
c[f] = t.attributes.get(this.getUID(w));
|
|
2678
2678
|
continue;
|
|
2679
2679
|
}
|
|
2680
2680
|
b = null;
|
|
2681
|
-
const O =
|
|
2682
|
-
f === "JOINTS_0" && !(O instanceof Uint16Array) && !(O instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Dt.Utils.toTypedBufferAttribute(
|
|
2683
|
-
const T = this.processAccessor(b ||
|
|
2684
|
-
T !== null && (f.startsWith("_") || this.detectMeshQuantization(f,
|
|
2681
|
+
const O = w.array;
|
|
2682
|
+
f === "JOINTS_0" && !(O instanceof Uint16Array) && !(O instanceof Uint8Array) ? (console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'), b = Dt.Utils.toTypedBufferAttribute(w, Uint16Array)) : (O instanceof Uint32Array || O instanceof Int32Array) && !f.startsWith("_") && (console.warn(`GLTFExporter: Attribute "${f}" converted to type FLOAT.`), b = Dt.Utils.toTypedBufferAttribute(w, Float32Array));
|
|
2683
|
+
const T = this.processAccessor(b || w, o);
|
|
2684
|
+
T !== null && (f.startsWith("_") || this.detectMeshQuantization(f, w), c[f] = T, t.attributes.set(this.getUID(w), T));
|
|
2685
2685
|
}
|
|
2686
2686
|
if (A !== void 0 && o.setAttribute("normal", A), Object.keys(c).length === 0) return null;
|
|
2687
2687
|
if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
|
|
2688
|
-
const f = [],
|
|
2688
|
+
const f = [], w = [], D = {};
|
|
2689
2689
|
if (e.morphTargetDictionary !== void 0)
|
|
2690
2690
|
for (const O in e.morphTargetDictionary)
|
|
2691
2691
|
D[e.morphTargetDictionary[O]] = O;
|
|
@@ -2709,30 +2709,30 @@ class Fr {
|
|
|
2709
2709
|
z === 0 && Z.setX(N, se.getX(N) - J.getX(N)), z === 1 && Z.setY(N, se.getY(N) - J.getY(N)), z === 2 && Z.setZ(N, se.getZ(N) - J.getZ(N)), z === 3 && Z.setW(N, se.getW(N) - J.getW(N));
|
|
2710
2710
|
T[ne] = this.processAccessor(Z, o), t.attributes.set(this.getUID(J, !0), T[ne]);
|
|
2711
2711
|
}
|
|
2712
|
-
u.push(T), f.push(e.morphTargetInfluences[O]), e.morphTargetDictionary !== void 0 &&
|
|
2712
|
+
u.push(T), f.push(e.morphTargetInfluences[O]), e.morphTargetDictionary !== void 0 && w.push(D[O]);
|
|
2713
2713
|
}
|
|
2714
|
-
l.weights = f,
|
|
2714
|
+
l.weights = f, w.length > 0 && (l.extras = {}, l.extras.targetNames = w);
|
|
2715
2715
|
}
|
|
2716
2716
|
const m = Array.isArray(e.material);
|
|
2717
2717
|
if (m && o.groups.length === 0) return null;
|
|
2718
2718
|
let p = !1;
|
|
2719
2719
|
if (m && o.index === null) {
|
|
2720
2720
|
const f = [];
|
|
2721
|
-
for (let
|
|
2722
|
-
f[
|
|
2721
|
+
for (let w = 0, D = o.attributes.position.count; w < D; w++)
|
|
2722
|
+
f[w] = w;
|
|
2723
2723
|
o.setIndex(f), p = !0;
|
|
2724
2724
|
}
|
|
2725
|
-
const I = m ? e.material : [e.material],
|
|
2726
|
-
for (let f = 0,
|
|
2725
|
+
const I = m ? e.material : [e.material], v = m ? o.groups : [{ materialIndex: 0, start: void 0, count: void 0 }];
|
|
2726
|
+
for (let f = 0, w = v.length; f < w; f++) {
|
|
2727
2727
|
const D = {
|
|
2728
2728
|
mode: a,
|
|
2729
2729
|
attributes: c
|
|
2730
2730
|
};
|
|
2731
2731
|
if (this.serializeUserData(o, D), u.length > 0 && (D.targets = u), o.index !== null) {
|
|
2732
2732
|
let T = this.getUID(o.index);
|
|
2733
|
-
(
|
|
2733
|
+
(v[f].start !== void 0 || v[f].count !== void 0) && (T += ":" + v[f].start + ":" + v[f].count), t.attributes.has(T) ? D.indices = t.attributes.get(T) : (D.indices = this.processAccessor(o.index, o, v[f].start, v[f].count), t.attributes.set(T, D.indices)), D.indices === null && delete D.indices;
|
|
2734
2734
|
}
|
|
2735
|
-
const O = await this.processMaterialAsync(I[
|
|
2735
|
+
const O = await this.processMaterialAsync(I[v[f].materialIndex]);
|
|
2736
2736
|
O !== null && (D.material = O), d.push(D);
|
|
2737
2737
|
}
|
|
2738
2738
|
p === !0 && o.setIndex(null), l.primitives = d, n.meshes || (n.meshes = []), await this._invokeAllAsync(function(f) {
|
|
@@ -2921,9 +2921,9 @@ class Fr {
|
|
|
2921
2921
|
if (e.children.length > 0) {
|
|
2922
2922
|
const m = [];
|
|
2923
2923
|
for (let p = 0, I = e.children.length; p < I; p++) {
|
|
2924
|
-
const
|
|
2925
|
-
if (
|
|
2926
|
-
const h = await this.processNodeAsync(
|
|
2924
|
+
const v = e.children[p];
|
|
2925
|
+
if (v.visible || n.onlyVisible === !1) {
|
|
2926
|
+
const h = await this.processNodeAsync(v);
|
|
2927
2927
|
h !== null && m.push(h);
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
@@ -3907,13 +3907,13 @@ class ga {
|
|
|
3907
3907
|
return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
|
|
3908
3908
|
const d = c.pop(), u = d.isGroup ? d.children : [d], g = c[0].count, A = [];
|
|
3909
3909
|
for (const b of u) {
|
|
3910
|
-
const m = new Ce(), p = new P(), I = new Ae(),
|
|
3910
|
+
const m = new Ce(), p = new P(), I = new Ae(), v = new P(1, 1, 1), h = new vo(b.geometry, b.material, g);
|
|
3911
3911
|
for (let f = 0; f < g; f++)
|
|
3912
|
-
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && I.fromBufferAttribute(l.ROTATION, f), l.SCALE &&
|
|
3912
|
+
l.TRANSLATION && p.fromBufferAttribute(l.TRANSLATION, f), l.ROTATION && I.fromBufferAttribute(l.ROTATION, f), l.SCALE && v.fromBufferAttribute(l.SCALE, f), h.setMatrixAt(f, m.compose(p, I, v));
|
|
3913
3913
|
for (const f in l)
|
|
3914
3914
|
if (f === "_COLOR_0") {
|
|
3915
|
-
const
|
|
3916
|
-
h.instanceColor = new Mo(
|
|
3915
|
+
const w = l[f];
|
|
3916
|
+
h.instanceColor = new Mo(w.array, w.itemSize, w.normalized);
|
|
3917
3917
|
} else f !== "TRANSLATION" && f !== "ROTATION" && f !== "SCALE" && b.geometry.setAttribute(f, l[f]);
|
|
3918
3918
|
mt.prototype.copy.call(h, b), this.parser.assignFinalMaterial(h), A.push(h);
|
|
3919
3919
|
}
|
|
@@ -4009,10 +4009,10 @@ class ui extends So {
|
|
|
4009
4009
|
return t;
|
|
4010
4010
|
}
|
|
4011
4011
|
interpolate_(e, t, n, s) {
|
|
4012
|
-
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u, A = g * u, b = e * c, m = b - c, p = -2 * A + 3 * g, I = A - g,
|
|
4012
|
+
const i = this.resultBuffer, o = this.sampleValues, a = this.valueSize, l = a * 2, c = a * 3, d = s - t, u = (n - t) / d, g = u * u, A = g * u, b = e * c, m = b - c, p = -2 * A + 3 * g, I = A - g, v = 1 - p, h = I - g + u;
|
|
4013
4013
|
for (let f = 0; f !== a; f++) {
|
|
4014
|
-
const
|
|
4015
|
-
i[f] =
|
|
4014
|
+
const w = o[m + f + a], D = o[m + f + l] * d, O = o[b + f + a], T = o[b + f] * d;
|
|
4015
|
+
i[f] = v * w + h * D + p * O + I * T;
|
|
4016
4016
|
}
|
|
4017
4017
|
return i;
|
|
4018
4018
|
}
|
|
@@ -4069,7 +4069,7 @@ const ve = {
|
|
|
4069
4069
|
COLOR_0: "color",
|
|
4070
4070
|
WEIGHTS_0: "skinWeight",
|
|
4071
4071
|
JOINTS_0: "skinIndex"
|
|
4072
|
-
},
|
|
4072
|
+
}, Ye = {
|
|
4073
4073
|
scale: "scale",
|
|
4074
4074
|
translation: "position",
|
|
4075
4075
|
rotation: "quaternion",
|
|
@@ -4440,16 +4440,16 @@ class Pa {
|
|
|
4440
4440
|
const a = o[0], l = vs[s.type], c = pt[s.componentType], d = c.BYTES_PER_ELEMENT, u = d * l, g = s.byteOffset || 0, A = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, b = s.normalized === !0;
|
|
4441
4441
|
let m, p;
|
|
4442
4442
|
if (A && A !== u) {
|
|
4443
|
-
const I = Math.floor(g / A),
|
|
4444
|
-
let h = t.cache.get(
|
|
4445
|
-
h || (m = new c(a, I * A, s.count * A / d), h = new Jn(m, A / d), t.cache.add(
|
|
4443
|
+
const I = Math.floor(g / A), v = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + I + ":" + s.count;
|
|
4444
|
+
let h = t.cache.get(v);
|
|
4445
|
+
h || (m = new c(a, I * A, s.count * A / d), h = new Jn(m, A / d), t.cache.add(v, h)), p = new _n(h, l, g % A / d, b);
|
|
4446
4446
|
} else
|
|
4447
4447
|
a === null ? m = new c(s.count * l) : m = new c(a, g, s.count * l), p = new De(m, l, b);
|
|
4448
4448
|
if (s.sparse !== void 0) {
|
|
4449
|
-
const I = vs.SCALAR,
|
|
4449
|
+
const I = vs.SCALAR, v = pt[s.sparse.indices.componentType], h = s.sparse.indices.byteOffset || 0, f = s.sparse.values.byteOffset || 0, w = new v(o[1], h, s.sparse.count * I), D = new c(o[2], f, s.sparse.count * l);
|
|
4450
4450
|
a !== null && (p = new De(p.array.slice(), p.itemSize, p.normalized)), p.normalized = !1;
|
|
4451
|
-
for (let O = 0, T =
|
|
4452
|
-
const Y =
|
|
4451
|
+
for (let O = 0, T = w.length; O < T; O++) {
|
|
4452
|
+
const Y = w[O];
|
|
4453
4453
|
if (p.setX(Y, D[O * l]), l >= 2 && p.setY(Y, D[O * l + 1]), l >= 3 && p.setZ(Y, D[O * l + 2]), l >= 4 && p.setW(Y, D[O * l + 3]), l >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
4454
4454
|
}
|
|
4455
4455
|
p.normalized = b;
|
|
@@ -4671,17 +4671,17 @@ class Pa {
|
|
|
4671
4671
|
for (let A = 0, b = d.length; A < b; A++) {
|
|
4672
4672
|
const m = d[A], p = o[A];
|
|
4673
4673
|
let I;
|
|
4674
|
-
const
|
|
4674
|
+
const v = c[A];
|
|
4675
4675
|
if (p.mode === ve.TRIANGLES || p.mode === ve.TRIANGLE_STRIP || p.mode === ve.TRIANGLE_FAN || p.mode === void 0)
|
|
4676
|
-
I = i.isSkinnedMesh === !0 ? new Eo(m,
|
|
4676
|
+
I = i.isSkinnedMesh === !0 ? new Eo(m, v) : new L(m, v), I.isSkinnedMesh === !0 && I.normalizeSkinWeights(), p.mode === ve.TRIANGLE_STRIP ? I.geometry = Tn(I.geometry, Qn) : p.mode === ve.TRIANGLE_FAN && (I.geometry = Tn(I.geometry, Ps));
|
|
4677
4677
|
else if (p.mode === ve.LINES)
|
|
4678
|
-
I = new Ss(m,
|
|
4678
|
+
I = new Ss(m, v);
|
|
4679
4679
|
else if (p.mode === ve.LINE_STRIP)
|
|
4680
|
-
I = new We(m,
|
|
4680
|
+
I = new We(m, v);
|
|
4681
4681
|
else if (p.mode === ve.LINE_LOOP)
|
|
4682
|
-
I = new Do(m,
|
|
4682
|
+
I = new Do(m, v);
|
|
4683
4683
|
else if (p.mode === ve.POINTS)
|
|
4684
|
-
I = new Kt(m,
|
|
4684
|
+
I = new Kt(m, v);
|
|
4685
4685
|
else
|
|
4686
4686
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + p.mode);
|
|
4687
4687
|
Object.keys(I.geometry.morphAttributes).length > 0 && Ea(I, i), I.name = t.createUniqueName(i.name || "mesh_" + e), He(I, i), p.extensions && $e(s, I, p), t.assignFinalMaterial(I), u.push(I);
|
|
@@ -4751,8 +4751,8 @@ class Pa {
|
|
|
4751
4751
|
loadAnimation(e) {
|
|
4752
4752
|
const t = this.json, n = this, s = t.animations[e], i = s.name ? s.name : "animation_" + e, o = [], a = [], l = [], c = [], d = [];
|
|
4753
4753
|
for (let u = 0, g = s.channels.length; u < g; u++) {
|
|
4754
|
-
const A = s.channels[u], b = s.samplers[A.sampler], m = A.target, p = m.node, I = s.parameters !== void 0 ? s.parameters[b.input] : b.input,
|
|
4755
|
-
m.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", I)), l.push(this.getDependency("accessor",
|
|
4754
|
+
const A = s.channels[u], b = s.samplers[A.sampler], m = A.target, p = m.node, I = s.parameters !== void 0 ? s.parameters[b.input] : b.input, v = s.parameters !== void 0 ? s.parameters[b.output] : b.output;
|
|
4755
|
+
m.node !== void 0 && (o.push(this.getDependency("node", p)), a.push(this.getDependency("accessor", I)), l.push(this.getDependency("accessor", v)), c.push(b), d.push(m));
|
|
4756
4756
|
}
|
|
4757
4757
|
return Promise.all([
|
|
4758
4758
|
Promise.all(o),
|
|
@@ -4763,16 +4763,16 @@ class Pa {
|
|
|
4763
4763
|
]).then(function(u) {
|
|
4764
4764
|
const g = u[0], A = u[1], b = u[2], m = u[3], p = u[4], I = [];
|
|
4765
4765
|
for (let h = 0, f = g.length; h < f; h++) {
|
|
4766
|
-
const
|
|
4767
|
-
if (
|
|
4768
|
-
|
|
4769
|
-
const $ = n._createAnimationTracks(
|
|
4766
|
+
const w = g[h], D = A[h], O = b[h], T = m[h], Y = p[h];
|
|
4767
|
+
if (w === void 0) continue;
|
|
4768
|
+
w.updateMatrix && w.updateMatrix();
|
|
4769
|
+
const $ = n._createAnimationTracks(w, D, O, T, Y);
|
|
4770
4770
|
if ($)
|
|
4771
4771
|
for (let se = 0; se < $.length; se++)
|
|
4772
4772
|
I.push($[se]);
|
|
4773
4773
|
}
|
|
4774
|
-
const
|
|
4775
|
-
return He(
|
|
4774
|
+
const v = new Ro(i, void 0, I);
|
|
4775
|
+
return He(v, s), v;
|
|
4776
4776
|
});
|
|
4777
4777
|
}
|
|
4778
4778
|
createNodeMesh(e) {
|
|
@@ -4885,17 +4885,17 @@ class Pa {
|
|
|
4885
4885
|
function c(A) {
|
|
4886
4886
|
A.morphTargetInfluences && l.push(A.name ? A.name : A.uuid);
|
|
4887
4887
|
}
|
|
4888
|
-
|
|
4888
|
+
Ye[i.path] === Ye.weights ? (c(e), e.isGroup && e.children.forEach(c)) : l.push(a);
|
|
4889
4889
|
let d;
|
|
4890
|
-
switch (
|
|
4891
|
-
case
|
|
4890
|
+
switch (Ye[i.path]) {
|
|
4891
|
+
case Ye.weights:
|
|
4892
4892
|
d = sn;
|
|
4893
4893
|
break;
|
|
4894
|
-
case
|
|
4894
|
+
case Ye.rotation:
|
|
4895
4895
|
d = nn;
|
|
4896
4896
|
break;
|
|
4897
|
-
case
|
|
4898
|
-
case
|
|
4897
|
+
case Ye.translation:
|
|
4898
|
+
case Ye.scale:
|
|
4899
4899
|
d = tn;
|
|
4900
4900
|
break;
|
|
4901
4901
|
default:
|
|
@@ -4914,7 +4914,7 @@ class Pa {
|
|
|
4914
4914
|
const u = s.interpolation !== void 0 ? va[s.interpolation] : Xs, g = this._getArrayFromAccessor(n);
|
|
4915
4915
|
for (let A = 0, b = l.length; A < b; A++) {
|
|
4916
4916
|
const m = new d(
|
|
4917
|
-
l[A] + "." +
|
|
4917
|
+
l[A] + "." + Ye[i.path],
|
|
4918
4918
|
t.array,
|
|
4919
4919
|
g,
|
|
4920
4920
|
u
|
|
@@ -5087,9 +5087,9 @@ const C = {
|
|
|
5087
5087
|
/** 当前选中的物体 */
|
|
5088
5088
|
selectedObject: null
|
|
5089
5089
|
};
|
|
5090
|
-
let _t = !1, at = !1,
|
|
5090
|
+
let _t = !1, at = !1, Ke = null;
|
|
5091
5091
|
const za = 16755200;
|
|
5092
|
-
let ks = [], Vt = [], Nt = !0, ot = null, Te = null, $t = null,
|
|
5092
|
+
let ks = [], Vt = [], Nt = !0, ot = null, Te = null, $t = null, Xe = [];
|
|
5093
5093
|
const lt = /* @__PURE__ */ new Map();
|
|
5094
5094
|
let Ht, es = null, Ot = null, Rt = null;
|
|
5095
5095
|
async function Wa(r, e = "edit", t) {
|
|
@@ -5112,7 +5112,7 @@ function Xa() {
|
|
|
5112
5112
|
});
|
|
5113
5113
|
n.texture.name = "EffectComposer.rt1";
|
|
5114
5114
|
const s = new dr(C.renderer, n);
|
|
5115
|
-
s.addPass(new fr(C.scene, C.camera)), s.addPass(new hr()),
|
|
5115
|
+
s.addPass(new fr(C.scene, C.camera)), s.addPass(new hr()), Ke = s;
|
|
5116
5116
|
}
|
|
5117
5117
|
function Va() {
|
|
5118
5118
|
if (C.scene = new R.Scene(), C.scene.name = "sl_scene", C.renderer) {
|
|
@@ -5215,7 +5215,7 @@ function Qa() {
|
|
|
5215
5215
|
}
|
|
5216
5216
|
function Ai() {
|
|
5217
5217
|
var e, t;
|
|
5218
|
-
es = requestAnimationFrame(Ai), de.update(), (e = C.orbitControls) == null || e.update(), C.mode === "run" &&
|
|
5218
|
+
es = requestAnimationFrame(Ai), de.update(), (e = C.orbitControls) == null || e.update(), C.mode === "run" && Ke && C.scene && C.camera ? Ke.render() : (t = C.renderer) == null || t.render(C.scene, C.camera), C.scene && C.camera && Mr(C.scene, C.camera), Nt && C.scene && (Vt = [], C.scene.traverse((n) => {
|
|
5219
5219
|
n.userData.isWater && n.type === "Mesh" && Vt.push(n);
|
|
5220
5220
|
}), Nt = !1);
|
|
5221
5221
|
for (let n = 0; n < Vt.length; n++) {
|
|
@@ -5234,7 +5234,7 @@ function Ai() {
|
|
|
5234
5234
|
function Ja() {
|
|
5235
5235
|
if (!C.container || !C.camera || !C.renderer) return;
|
|
5236
5236
|
const r = C.container.clientWidth, e = C.container.clientHeight;
|
|
5237
|
-
r === 0 || e === 0 || (C.camera.aspect = r / e, C.camera.updateProjectionMatrix(), C.renderer.setSize(r, e),
|
|
5237
|
+
r === 0 || e === 0 || (C.camera.aspect = r / e, C.camera.updateProjectionMatrix(), C.renderer.setSize(r, e), Ke && Ke.setSize(r, e), Tr(r, e));
|
|
5238
5238
|
}
|
|
5239
5239
|
function ds(r) {
|
|
5240
5240
|
let e = r;
|
|
@@ -5434,20 +5434,20 @@ function Ci(r) {
|
|
|
5434
5434
|
e && Ii(e);
|
|
5435
5435
|
}
|
|
5436
5436
|
function ol(r) {
|
|
5437
|
-
r.userData.isMovable && r.parent === C.scene && (
|
|
5437
|
+
r.userData.isMovable && r.parent === C.scene && (Xe.includes(r) || Xe.push(r));
|
|
5438
5438
|
}
|
|
5439
5439
|
function rl(r) {
|
|
5440
|
-
const e =
|
|
5441
|
-
e !== -1 &&
|
|
5440
|
+
const e = Xe.indexOf(r);
|
|
5441
|
+
e !== -1 && Xe.splice(e, 1);
|
|
5442
5442
|
}
|
|
5443
5443
|
function js() {
|
|
5444
5444
|
const r = [];
|
|
5445
|
-
C.scene.
|
|
5446
|
-
e.userData.isMovable &&
|
|
5447
|
-
}),
|
|
5445
|
+
C.scene.children.forEach((e) => {
|
|
5446
|
+
e.userData.isMovable && r.push(e);
|
|
5447
|
+
}), Xe = r, fs();
|
|
5448
5448
|
}
|
|
5449
5449
|
function fs() {
|
|
5450
|
-
$t == null || $t([...
|
|
5450
|
+
$t == null || $t([...Xe]);
|
|
5451
5451
|
}
|
|
5452
5452
|
function al(r) {
|
|
5453
5453
|
ot = r;
|
|
@@ -5459,7 +5459,7 @@ function cl(r) {
|
|
|
5459
5459
|
$t = r;
|
|
5460
5460
|
}
|
|
5461
5461
|
function wi() {
|
|
5462
|
-
return
|
|
5462
|
+
return Xe;
|
|
5463
5463
|
}
|
|
5464
5464
|
function Fs() {
|
|
5465
5465
|
return C.selectedObject;
|
|
@@ -5651,7 +5651,7 @@ function yl() {
|
|
|
5651
5651
|
}
|
|
5652
5652
|
const bl = 16777215, xl = 1;
|
|
5653
5653
|
async function Il() {
|
|
5654
|
-
var f,
|
|
5654
|
+
var f, w, D, O;
|
|
5655
5655
|
xe == null || xe(!0), await new Promise((T) => setTimeout(T, 50)), Ys();
|
|
5656
5656
|
const r = C.scene;
|
|
5657
5657
|
if (!r)
|
|
@@ -5713,10 +5713,10 @@ async function Il() {
|
|
|
5713
5713
|
var be, Oe, Re;
|
|
5714
5714
|
const _ = z.querySelector(".item-label"), B = z.querySelector(".item-value");
|
|
5715
5715
|
if (_ && B) {
|
|
5716
|
-
const
|
|
5716
|
+
const Ve = (_.textContent || "").trim(), Le = ((Oe = (be = B.childNodes[0]) == null ? void 0 : be.textContent) == null ? void 0 : Oe.trim()) || "", ze = B.querySelector(
|
|
5717
5717
|
"span"
|
|
5718
5718
|
), ps = ze ? (ze.textContent || "").trim() : void 0, As = ((Re = z.getAttribute("data-item-code")) == null ? void 0 : Re.trim()) || void 0;
|
|
5719
|
-
N.push({ label:
|
|
5719
|
+
N.push({ label: Ve, value: Le, unit: ps, code: As });
|
|
5720
5720
|
}
|
|
5721
5721
|
}), T.parent) {
|
|
5722
5722
|
const z = J.element.style.width || "", _ = J.element.style.fontSize || "", B = jt(T.parent), be = B ? B.getOffsetY() : 0.1;
|
|
@@ -5792,17 +5792,17 @@ async function Il() {
|
|
|
5792
5792
|
delete T.userData._sourceUuid;
|
|
5793
5793
|
}), c && (d ? d.add(c) : r.add(c));
|
|
5794
5794
|
const I = {
|
|
5795
|
-
position: (
|
|
5795
|
+
position: (w = C.camera) == null ? void 0 : w.position.toArray(),
|
|
5796
5796
|
rotation: (D = C.camera) == null ? void 0 : D.rotation.toArray(),
|
|
5797
5797
|
target: ((O = C.orbitControls) == null ? void 0 : O.target.toArray()) || [0, 0, 0]
|
|
5798
|
-
},
|
|
5798
|
+
}, v = {};
|
|
5799
5799
|
n.forEach((T, Y) => {
|
|
5800
|
-
|
|
5800
|
+
v[Y] = T;
|
|
5801
5801
|
});
|
|
5802
5802
|
const h = {
|
|
5803
5803
|
scene: p,
|
|
5804
5804
|
camera: I,
|
|
5805
|
-
dataPanels:
|
|
5805
|
+
dataPanels: v,
|
|
5806
5806
|
waters: i,
|
|
5807
5807
|
textures: s,
|
|
5808
5808
|
ambientLight: a,
|
|
@@ -5859,28 +5859,43 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5859
5859
|
f ? (C.scene.environment = f, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5860
5860
|
}
|
|
5861
5861
|
xi(p);
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
w.
|
|
5868
|
-
|
|
5862
|
+
let v = !0;
|
|
5863
|
+
for (; v; ) {
|
|
5864
|
+
v = !1;
|
|
5865
|
+
for (let f = p.children.length - 1; f >= 0; f--) {
|
|
5866
|
+
const w = p.children[f];
|
|
5867
|
+
if (w.name === "sl_scene" || w.name === "AuxScene") {
|
|
5868
|
+
w.updateMatrixWorld();
|
|
5869
|
+
const D = w.matrixWorld.clone();
|
|
5870
|
+
[...w.children].forEach((O) => {
|
|
5871
|
+
w.remove(O), O.applyMatrix4(D), p.add(O);
|
|
5872
|
+
}), p.remove(w), v = !0;
|
|
5873
|
+
}
|
|
5874
|
+
}
|
|
5869
5875
|
}
|
|
5870
5876
|
const h = (f) => {
|
|
5871
5877
|
if (f.isTransformControlsRoot || f.isLine || f.isLineSegments || f.type === "AmbientLight" || f.userData.type === "lightHelper" || f.userData.type === "initFloor")
|
|
5872
5878
|
return;
|
|
5873
5879
|
(f.isMesh || f.type === "Group" && f.parent === p) && (f.userData.isMovable = !0);
|
|
5874
|
-
const
|
|
5875
|
-
f.userData.isWater &&
|
|
5880
|
+
const w = f.material;
|
|
5881
|
+
f.userData.isWater && w && !w.uniforms && !f.userData.waterSpeed && (f.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), f.children.forEach(h);
|
|
5876
5882
|
};
|
|
5877
|
-
h(p)
|
|
5883
|
+
h(p);
|
|
5884
|
+
{
|
|
5885
|
+
const f = (w, D) => {
|
|
5886
|
+
console.log(
|
|
5887
|
+
`${" ".repeat(D)}${w.type} | name:${w.name || "(无)"} | parent:${w.parent ? w.parent.type + "/" + (w.parent.name || "无") : "无"} | isMovable:${!!w.userData.isMovable}`
|
|
5888
|
+
), w.children.forEach((O) => f(O, D + 1));
|
|
5889
|
+
};
|
|
5890
|
+
console.log("===== [导入诊断] GLB 解开后场景结构 ====="), f(p, 0), console.log("===== [导入诊断] sceneObjects 顶层(树应显示)====="), Xe.forEach((w) => console.log(` ${w.type} | name:${w.name || "(无)"} | isMovable:${!!w.userData.isMovable}`));
|
|
5891
|
+
}
|
|
5892
|
+
js();
|
|
5878
5893
|
} else {
|
|
5879
5894
|
const m = typeof r == "string" ? JSON.parse(r) : r, I = new R.ObjectLoader().parse(m);
|
|
5880
5895
|
if (I.type === "Scene") {
|
|
5881
|
-
const
|
|
5882
|
-
if (C.scene = I,
|
|
5883
|
-
C.scene.environment =
|
|
5896
|
+
const v = (d = C.scene) == null ? void 0 : d.environment;
|
|
5897
|
+
if (C.scene = I, v)
|
|
5898
|
+
C.scene.environment = v, C.scene.environmentIntensity = 1;
|
|
5884
5899
|
else if (C.renderer) {
|
|
5885
5900
|
const h = Jt(C.renderer);
|
|
5886
5901
|
h && (C.scene.environment = h, C.scene.environmentIntensity = 1);
|
|
@@ -5892,17 +5907,17 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5892
5907
|
const p = m.userData.id || m.userData._sourceUuid || m.uuid, I = t[p];
|
|
5893
5908
|
if (I && m.userData.isMovable) {
|
|
5894
5909
|
tl(m);
|
|
5895
|
-
const
|
|
5910
|
+
const v = new as({
|
|
5896
5911
|
title: I.title,
|
|
5897
5912
|
items: I.items
|
|
5898
5913
|
});
|
|
5899
|
-
|
|
5914
|
+
v.attachTo(m), v.visible = !1, I.width && v.setWidth(I.width), I.fontSize && v.setFontSize(I.fontSize), I.offsetY !== void 0 && v.setOffsetY(I.offsetY), I.offsetX !== void 0 && v.setOffsetX(I.offsetX), I.offsetZ !== void 0 && v.setOffsetZ(I.offsetZ), ii(m, v);
|
|
5900
5915
|
}
|
|
5901
5916
|
})), n && n.length > 0 && Promise.resolve().then(() => Nl).then(({ addWater: m, addWaterCylinder: p }) => {
|
|
5902
5917
|
for (const I of n) {
|
|
5903
|
-
const
|
|
5918
|
+
const v = I.geometryType || "box";
|
|
5904
5919
|
let h;
|
|
5905
|
-
|
|
5920
|
+
v === "cylinder" ? h = p({
|
|
5906
5921
|
radiusTop: I.cylinderRadiusTop ?? 5,
|
|
5907
5922
|
radiusBottom: I.cylinderRadiusBottom ?? 5,
|
|
5908
5923
|
radialSegments: I.cylinderRadialSegments ?? 32,
|
|
@@ -5921,24 +5936,24 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5921
5936
|
const m = new R.TextureLoader();
|
|
5922
5937
|
(A = C.scene) == null || A.traverse((p) => {
|
|
5923
5938
|
if (p.type === "Mesh") {
|
|
5924
|
-
const I = p,
|
|
5925
|
-
for (const h of
|
|
5939
|
+
const I = p, v = Array.isArray(I.material) ? I.material : [I.material];
|
|
5940
|
+
for (const h of v)
|
|
5926
5941
|
if (h && h.uuid && s[h.uuid]) {
|
|
5927
5942
|
const f = s[h.uuid];
|
|
5928
5943
|
if (f.mapDataUrl) {
|
|
5929
|
-
const
|
|
5930
|
-
|
|
5944
|
+
const w = m.load(f.mapDataUrl);
|
|
5945
|
+
w.wrapS = w.wrapT = R.RepeatWrapping, w.repeat.set(1, 1), h.map = w, h.userData = h.userData || {}, h.userData._mapDataUrl = f.mapDataUrl, h.userData._mapFileName = f.mapFileName;
|
|
5931
5946
|
}
|
|
5932
5947
|
if (f.normalMapDataUrl) {
|
|
5933
|
-
const
|
|
5934
|
-
|
|
5948
|
+
const w = m.load(f.normalMapDataUrl);
|
|
5949
|
+
w.wrapS = w.wrapT = R.RepeatWrapping, w.repeat.set(1, 1), h.normalMap = w, h.normalScale = new R.Vector2(
|
|
5935
5950
|
f.normalScale ?? 1,
|
|
5936
5951
|
f.normalScale ?? 1
|
|
5937
5952
|
), h.userData = h.userData || {}, h.userData._normalMapDataUrl = f.normalMapDataUrl, h.userData._normalMapFileName = f.normalMapFileName;
|
|
5938
5953
|
}
|
|
5939
5954
|
if (f.aoMapDataUrl) {
|
|
5940
|
-
const
|
|
5941
|
-
|
|
5955
|
+
const w = m.load(f.aoMapDataUrl);
|
|
5956
|
+
w.wrapS = w.wrapT = R.RepeatWrapping, w.repeat.set(1, 1), h.aoMap = w, h.aoMapIntensity = f.aoMapIntensity ?? 1, h.userData = h.userData || {}, h.userData._aoMapDataUrl = f.aoMapDataUrl, h.userData._aoMapFileName = f.aoMapFileName;
|
|
5942
5957
|
}
|
|
5943
5958
|
h.needsUpdate = !0;
|
|
5944
5959
|
}
|
|
@@ -5948,11 +5963,11 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5948
5963
|
o && ka(o), e === "edit" && ((b = C.scene) == null || b.traverse((m) => {
|
|
5949
5964
|
var p, I;
|
|
5950
5965
|
if (m.type === "DirectionalLight") {
|
|
5951
|
-
const
|
|
5952
|
-
if (!
|
|
5953
|
-
|
|
5954
|
-
const h = new R.DirectionalLightHelper(
|
|
5955
|
-
h.userData.type = "lightHelper",
|
|
5966
|
+
const v = m;
|
|
5967
|
+
if (!v.userData.helper) {
|
|
5968
|
+
v.target.parent !== C.scene && (v.target.parent && v.target.parent.remove(v.target), v.target.position.set(0, 0, 0), (p = C.scene) == null || p.add(v.target));
|
|
5969
|
+
const h = new R.DirectionalLightHelper(v, 1);
|
|
5970
|
+
h.userData.type = "lightHelper", v.userData.helper = h, h.update(), (I = C.scene) == null || I.add(h);
|
|
5956
5971
|
}
|
|
5957
5972
|
}
|
|
5958
5973
|
}));
|
|
@@ -5970,7 +5985,7 @@ function Ei(r) {
|
|
|
5970
5985
|
Ei(t);
|
|
5971
5986
|
}
|
|
5972
5987
|
function vl() {
|
|
5973
|
-
es !== null && (cancelAnimationFrame(es), es = null), Ot && C.container && (C.container.removeEventListener("click", Ot), Ot = null), Rt && (window.removeEventListener("resize", Rt), Rt = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null),
|
|
5988
|
+
es !== null && (cancelAnimationFrame(es), es = null), Ot && C.container && (C.container.removeEventListener("click", Ot), Ot = null), Rt && (window.removeEventListener("resize", Rt), Rt = null), C.orbitControls && (C.orbitControls.dispose(), C.orbitControls = null), C.transformControls && (C.transformControls.dispose(), C.transformControls = null), Ke && (Ke.dispose(), Ke = null), C.scene && (Ei(C.scene), C.scene = null), C.renderer && (C.renderer.dispose(), C.renderer.domElement && C.container && C.container.removeChild(C.renderer.domElement), C.renderer = null), Er(), C.camera = null, C.gridHelper = null, C.selectedObject = null, C.container = null, C.mode = "", C.defaultMainCamera = null, Ht = void 0, Xe = [], lt.clear(), fs(), ja(), _t = !1, at = !1;
|
|
5974
5989
|
}
|
|
5975
5990
|
const Ml = /^[og]\s*(.+)?/, Tl = /^mtllib /, El = /^usemtl /, Dl = /^usemap /, Hn = /\s+/, kn = new P(), Ds = new P(), jn = new P(), Fn = new P(), we = new P(), qt = new le();
|
|
5976
5991
|
function Ol() {
|
|
@@ -6224,23 +6239,23 @@ class Rl extends Vs {
|
|
|
6224
6239
|
for (let m = 0, p = g.length; m < p; m++) {
|
|
6225
6240
|
const I = g[m];
|
|
6226
6241
|
if (I.length > 0) {
|
|
6227
|
-
const
|
|
6228
|
-
A.push(
|
|
6242
|
+
const v = I.split("/");
|
|
6243
|
+
A.push(v);
|
|
6229
6244
|
}
|
|
6230
6245
|
}
|
|
6231
6246
|
const b = A[0];
|
|
6232
6247
|
for (let m = 1, p = A.length - 1; m < p; m++) {
|
|
6233
|
-
const I = A[m],
|
|
6248
|
+
const I = A[m], v = A[m + 1];
|
|
6234
6249
|
t.addFace(
|
|
6235
6250
|
b[0],
|
|
6236
6251
|
I[0],
|
|
6237
|
-
|
|
6252
|
+
v[0],
|
|
6238
6253
|
b[1],
|
|
6239
6254
|
I[1],
|
|
6240
|
-
|
|
6255
|
+
v[1],
|
|
6241
6256
|
b[2],
|
|
6242
6257
|
I[2],
|
|
6243
|
-
|
|
6258
|
+
v[2]
|
|
6244
6259
|
);
|
|
6245
6260
|
}
|
|
6246
6261
|
} else if (d === "l") {
|
|
@@ -6290,9 +6305,9 @@ class Rl extends Vs {
|
|
|
6290
6305
|
const m = new rt();
|
|
6291
6306
|
m.setAttribute("position", new ke(d.vertices, 3)), d.normals.length > 0 && m.setAttribute("normal", new ke(d.normals, 3)), d.colors.length > 0 && (b = !0, m.setAttribute("color", new ke(d.colors, 3))), d.hasUVIndices === !0 && m.setAttribute("uv", new ke(d.uvs, 2));
|
|
6292
6307
|
const p = [];
|
|
6293
|
-
for (let
|
|
6294
|
-
const f = u[
|
|
6295
|
-
let D = t.materials[
|
|
6308
|
+
for (let v = 0, h = u.length; v < h; v++) {
|
|
6309
|
+
const f = u[v], w = f.name + "_" + f.smooth + "_" + b;
|
|
6310
|
+
let D = t.materials[w];
|
|
6296
6311
|
if (this.materials !== null) {
|
|
6297
6312
|
if (D = this.materials.create(f.name), g && D && !(D instanceof Mt)) {
|
|
6298
6313
|
const O = new Mt();
|
|
@@ -6302,13 +6317,13 @@ class Rl extends Vs {
|
|
|
6302
6317
|
Et.prototype.copy.call(O, D), O.color.copy(D.color), O.map = D.map, D = O;
|
|
6303
6318
|
}
|
|
6304
6319
|
}
|
|
6305
|
-
D === void 0 && (g ? D = new Mt() : A ? D = new It({ size: 1, sizeAttenuation: !1 }) : D = new Ho(), D.name = f.name, D.flatShading = !f.smooth, D.vertexColors = b, t.materials[
|
|
6320
|
+
D === void 0 && (g ? D = new Mt() : A ? D = new It({ size: 1, sizeAttenuation: !1 }) : D = new Ho(), D.name = f.name, D.flatShading = !f.smooth, D.vertexColors = b, t.materials[w] = D), p.push(D);
|
|
6306
6321
|
}
|
|
6307
6322
|
let I;
|
|
6308
6323
|
if (p.length > 1) {
|
|
6309
|
-
for (let
|
|
6310
|
-
const f = u[
|
|
6311
|
-
m.addGroup(f.groupStart, f.groupCount,
|
|
6324
|
+
for (let v = 0, h = u.length; v < h; v++) {
|
|
6325
|
+
const f = u[v];
|
|
6326
|
+
m.addGroup(f.groupStart, f.groupCount, v);
|
|
6312
6327
|
}
|
|
6313
6328
|
g ? I = new Ss(m, p) : A ? I = new Kt(m, p) : I = new L(m, p);
|
|
6314
6329
|
} else
|
|
@@ -6559,14 +6574,14 @@ function Sl() {
|
|
|
6559
6574
|
const m = { index: null, attributes: [] };
|
|
6560
6575
|
for (const p in d) {
|
|
6561
6576
|
const I = self[u[p]];
|
|
6562
|
-
let
|
|
6577
|
+
let v, h;
|
|
6563
6578
|
if (c.useUniqueIDs)
|
|
6564
|
-
h = d[p],
|
|
6579
|
+
h = d[p], v = a.GetAttributeByUniqueId(g, h);
|
|
6565
6580
|
else {
|
|
6566
6581
|
if (h = a.GetAttributeId(g, o[d[p]]), h === -1) continue;
|
|
6567
|
-
|
|
6582
|
+
v = a.GetAttribute(g, h);
|
|
6568
6583
|
}
|
|
6569
|
-
const f = s(o, a, g, p, I,
|
|
6584
|
+
const f = s(o, a, g, p, I, v);
|
|
6570
6585
|
p === "color" && (f.vertexColorSpace = c.vertexColorSpace), m.attributes.push(f);
|
|
6571
6586
|
}
|
|
6572
6587
|
return b === o.TRIANGULAR_MESH && (m.index = n(o, a, g)), o.destroy(g), m;
|
|
@@ -6578,18 +6593,18 @@ function Sl() {
|
|
|
6578
6593
|
return o._free(g), { array: A, itemSize: 1 };
|
|
6579
6594
|
}
|
|
6580
6595
|
function s(o, a, l, c, d, u) {
|
|
6581
|
-
const g = l.num_points(), A = u.num_components(), b = i(o, d), m = A * d.BYTES_PER_ELEMENT, p = Math.ceil(m / 4) * 4, I = p / d.BYTES_PER_ELEMENT,
|
|
6582
|
-
a.GetAttributeDataArrayForAllPoints(l, u, b,
|
|
6583
|
-
const
|
|
6596
|
+
const g = l.num_points(), A = u.num_components(), b = i(o, d), m = A * d.BYTES_PER_ELEMENT, p = Math.ceil(m / 4) * 4, I = p / d.BYTES_PER_ELEMENT, v = g * m, h = g * p, f = o._malloc(v);
|
|
6597
|
+
a.GetAttributeDataArrayForAllPoints(l, u, b, v, f);
|
|
6598
|
+
const w = new d(o.HEAPF32.buffer, f, v / d.BYTES_PER_ELEMENT);
|
|
6584
6599
|
let D;
|
|
6585
6600
|
if (m === p)
|
|
6586
|
-
D =
|
|
6601
|
+
D = w.slice();
|
|
6587
6602
|
else {
|
|
6588
6603
|
D = new d(h / d.BYTES_PER_ELEMENT);
|
|
6589
6604
|
let O = 0;
|
|
6590
|
-
for (let T = 0, Y =
|
|
6605
|
+
for (let T = 0, Y = w.length; T < Y; T++) {
|
|
6591
6606
|
for (let $ = 0; $ < A; $++)
|
|
6592
|
-
D[O + $] =
|
|
6607
|
+
D[O + $] = w[T * A + $];
|
|
6593
6608
|
O += I;
|
|
6594
6609
|
}
|
|
6595
6610
|
}
|
|
@@ -6629,7 +6644,7 @@ class Ll extends L {
|
|
|
6629
6644
|
*/
|
|
6630
6645
|
constructor(e, t = {}) {
|
|
6631
6646
|
super(e), this.isWater = !0;
|
|
6632
|
-
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ti, p = t.fog !== void 0 ? t.fog : !1, I = new zn(),
|
|
6647
|
+
const n = this, s = t.textureWidth !== void 0 ? t.textureWidth : 512, i = t.textureHeight !== void 0 ? t.textureHeight : 512, o = t.clipBias !== void 0 ? t.clipBias : 0, a = t.alpha !== void 0 ? t.alpha : 1, l = t.time !== void 0 ? t.time : 0, c = t.waterNormals !== void 0 ? t.waterNormals : null, d = t.sunDirection !== void 0 ? t.sunDirection : new P(0.70707, 0.70707, 0), u = new le(t.sunColor !== void 0 ? t.sunColor : 16777215), g = new le(t.waterColor !== void 0 ? t.waterColor : 8355711), A = t.eye !== void 0 ? t.eye : new P(0, 0, 0), b = t.distortionScale !== void 0 ? t.distortionScale : 20, m = t.side !== void 0 ? t.side : ti, p = t.fog !== void 0 ? t.fog : !1, I = new zn(), v = new P(), h = new P(), f = new P(), w = new Ce(), D = new P(0, 0, -1), O = new on(), T = new P(), Y = new P(), $ = new on(), se = new Ce(), ne = new ei(), J = new Gn(s, i, { type: Bn }), Z = {
|
|
6633
6648
|
name: "MirrorShader",
|
|
6634
6649
|
uniforms: is.merge([
|
|
6635
6650
|
rn.fog,
|
|
@@ -6762,8 +6777,8 @@ class Ll extends L {
|
|
|
6762
6777
|
fog: p
|
|
6763
6778
|
});
|
|
6764
6779
|
N.uniforms.mirrorSampler.value = J.texture, N.uniforms.textureMatrix.value = se, N.uniforms.alpha.value = a, N.uniforms.time.value = l, N.uniforms.normalSampler.value = c, N.uniforms.sunColor.value = u, N.uniforms.waterColor.value = g, N.uniforms.sunDirection.value = d, N.uniforms.distortionScale.value = b, N.uniforms.eye.value = A, n.material = N, n.onBeforeRender = function(U, z, _) {
|
|
6765
|
-
if (h.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(_.matrixWorld),
|
|
6766
|
-
T.reflect(
|
|
6780
|
+
if (h.setFromMatrixPosition(n.matrixWorld), f.setFromMatrixPosition(_.matrixWorld), w.extractRotation(n.matrixWorld), v.set(0, 0, 1), v.applyMatrix4(w), T.subVectors(h, f), T.dot(v) > 0) return;
|
|
6781
|
+
T.reflect(v).negate(), T.add(h), w.extractRotation(_.matrixWorld), D.set(0, 0, -1), D.applyMatrix4(w), D.add(f), Y.subVectors(h, D), Y.reflect(v).negate(), Y.add(h), ne.position.copy(T), ne.up.set(0, 1, 0), ne.up.applyMatrix4(w), ne.up.reflect(v), ne.lookAt(Y), ne.far = _.far, ne.updateMatrixWorld(), ne.projectionMatrix.copy(_.projectionMatrix), se.set(
|
|
6767
6782
|
0.5,
|
|
6768
6783
|
0,
|
|
6769
6784
|
0,
|
|
@@ -6780,13 +6795,13 @@ class Ll extends L {
|
|
|
6780
6795
|
0,
|
|
6781
6796
|
0,
|
|
6782
6797
|
1
|
|
6783
|
-
), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(
|
|
6798
|
+
), se.multiply(ne.projectionMatrix), se.multiply(ne.matrixWorldInverse), I.setFromNormalAndCoplanarPoint(v, h), I.applyMatrix4(ne.matrixWorldInverse), O.set(I.normal.x, I.normal.y, I.normal.z, I.constant);
|
|
6784
6799
|
const B = ne.projectionMatrix;
|
|
6785
6800
|
$.x = (Math.sign(O.x) + B.elements[8]) / B.elements[0], $.y = (Math.sign(O.y) + B.elements[9]) / B.elements[5], $.z = -1, $.w = (1 + B.elements[10]) / B.elements[14], O.multiplyScalar(2 / O.dot($)), B.elements[2] = O.x, B.elements[6] = O.y, B.elements[10] = O.z + 1 - o, B.elements[14] = O.w, A.setFromMatrixPosition(_.matrixWorld);
|
|
6786
6801
|
const be = U.getRenderTarget(), Oe = U.xr.enabled, Re = U.shadowMap.autoUpdate;
|
|
6787
6802
|
n.visible = !1, U.xr.enabled = !1, U.shadowMap.autoUpdate = !1, U.setRenderTarget(J), U.state.buffers.depth.setMask(!0), U.autoClear === !1 && U.clear(), U.render(z, ne), n.visible = !0, U.xr.enabled = Oe, U.shadowMap.autoUpdate = Re, U.setRenderTarget(be);
|
|
6788
|
-
const
|
|
6789
|
-
|
|
6803
|
+
const Ve = _.viewport;
|
|
6804
|
+
Ve !== void 0 && U.state.viewport(Ve);
|
|
6790
6805
|
};
|
|
6791
6806
|
}
|
|
6792
6807
|
}
|
|
@@ -7014,7 +7029,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7014
7029
|
l.value ? (H(), k("span", {
|
|
7015
7030
|
key: 0,
|
|
7016
7031
|
class: "toggle-icon",
|
|
7017
|
-
onClick: p[0] || (p[0] = ss((
|
|
7032
|
+
onClick: p[0] || (p[0] = ss((v) => ns(o)(m.node.uuid), ["stop"]))
|
|
7018
7033
|
}, fe(a.value ? "▼" : "▶"), 1)) : (H(), k("span", Hl)),
|
|
7019
7034
|
y("span", kl, fe(A(m.node)), 1),
|
|
7020
7035
|
y("span", jl, fe(b(m.node)), 1),
|
|
@@ -7024,9 +7039,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7024
7039
|
}, "×")
|
|
7025
7040
|
], 2),
|
|
7026
7041
|
a.value && l.value ? (H(), k("div", Fl, [
|
|
7027
|
-
(H(!0), k(Ee, null, At(c.value, (
|
|
7028
|
-
key:
|
|
7029
|
-
node:
|
|
7042
|
+
(H(!0), k(Ee, null, At(c.value, (v) => (H(), vt(I, {
|
|
7043
|
+
key: v.uuid,
|
|
7044
|
+
node: v,
|
|
7030
7045
|
"selected-object": m.selectedObject,
|
|
7031
7046
|
version: m.version,
|
|
7032
7047
|
onSelect: p[1] || (p[1] = (h) => n("select", h)),
|
|
@@ -7104,7 +7119,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7104
7119
|
const I = ts({
|
|
7105
7120
|
intensity: 1
|
|
7106
7121
|
});
|
|
7107
|
-
function
|
|
7122
|
+
function v() {
|
|
7108
7123
|
t.selectedObject && t.selectedObject.type === "DirectionalLight" && (t.selectedObject.intensity = I.intensity);
|
|
7109
7124
|
}
|
|
7110
7125
|
function h(E) {
|
|
@@ -7139,7 +7154,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7139
7154
|
}
|
|
7140
7155
|
}), x;
|
|
7141
7156
|
}
|
|
7142
|
-
function
|
|
7157
|
+
function w(E, x) {
|
|
7143
7158
|
let M = !1;
|
|
7144
7159
|
return E.traverse((S) => {
|
|
7145
7160
|
if (S.type === "Mesh") {
|
|
@@ -7151,7 +7166,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7151
7166
|
}
|
|
7152
7167
|
function D() {
|
|
7153
7168
|
if (t.selectedObject) {
|
|
7154
|
-
const E =
|
|
7169
|
+
const E = w(t.selectedObject, {
|
|
7155
7170
|
metalness: i.metalness,
|
|
7156
7171
|
roughness: i.roughness,
|
|
7157
7172
|
opacity: i.opacity
|
|
@@ -7163,14 +7178,14 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7163
7178
|
const M = E.target.value;
|
|
7164
7179
|
o.value = M;
|
|
7165
7180
|
const S = new le(M);
|
|
7166
|
-
i.color = S.getHex(), t.selectedObject &&
|
|
7181
|
+
i.color = S.getHex(), t.selectedObject && w(t.selectedObject, { color: S.getHex() });
|
|
7167
7182
|
}
|
|
7168
7183
|
function T(E) {
|
|
7169
7184
|
let M = E.target.value.trim();
|
|
7170
7185
|
if (M.startsWith("#") || (M = "#" + M), /^#[0-9a-fA-F]{6}$/.test(M)) {
|
|
7171
7186
|
o.value = M;
|
|
7172
7187
|
const S = new le(M);
|
|
7173
|
-
i.color = S.getHex(), t.selectedObject &&
|
|
7188
|
+
i.color = S.getHex(), t.selectedObject && w(t.selectedObject, { color: S.getHex() });
|
|
7174
7189
|
}
|
|
7175
7190
|
}
|
|
7176
7191
|
function Y(E) {
|
|
@@ -7300,7 +7315,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7300
7315
|
}
|
|
7301
7316
|
});
|
|
7302
7317
|
}
|
|
7303
|
-
const
|
|
7318
|
+
const Ve = tt(() => {
|
|
7304
7319
|
const E = t.selectedObject;
|
|
7305
7320
|
if (!E) return !1;
|
|
7306
7321
|
let x = !1;
|
|
@@ -7520,7 +7535,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7520
7535
|
max: "10",
|
|
7521
7536
|
step: "0.1",
|
|
7522
7537
|
"onUpdate:modelValue": x[9] || (x[9] = (M) => I.intensity = M),
|
|
7523
|
-
onInput:
|
|
7538
|
+
onInput: v
|
|
7524
7539
|
}, null, 544), [
|
|
7525
7540
|
[
|
|
7526
7541
|
W,
|
|
@@ -7536,7 +7551,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7536
7551
|
step: "0.1",
|
|
7537
7552
|
"onUpdate:modelValue": x[10] || (x[10] = (M) => I.intensity = M),
|
|
7538
7553
|
class: "intensity-input",
|
|
7539
|
-
onInput:
|
|
7554
|
+
onInput: v
|
|
7540
7555
|
}, null, 544), [
|
|
7541
7556
|
[
|
|
7542
7557
|
W,
|
|
@@ -7752,7 +7767,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7752
7767
|
]),
|
|
7753
7768
|
a.value ? re("", !0) : (H(), k("div", vc, " ⚠️ 当前材质不支持金属度/粗糙度(仅支持 Standard/Phong) "))
|
|
7754
7769
|
])) : re("", !0),
|
|
7755
|
-
|
|
7770
|
+
Ve.value ? (H(), k("div", Mc, [
|
|
7756
7771
|
x[50] || (x[50] = y("label", null, "水体属性", -1)),
|
|
7757
7772
|
y("div", Tc, [
|
|
7758
7773
|
x[48] || (x[48] = y("span", { class: "slider-label" }, "水体颜色", -1)),
|
|
@@ -7838,9 +7853,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7838
7853
|
function c(h) {
|
|
7839
7854
|
const f = [];
|
|
7840
7855
|
if (h.userData)
|
|
7841
|
-
for (const [
|
|
7842
|
-
typeof
|
|
7843
|
-
key:
|
|
7856
|
+
for (const [w, D] of Object.entries(h.userData))
|
|
7857
|
+
typeof w == "string" && !w.startsWith("_") && f.push({
|
|
7858
|
+
key: w,
|
|
7844
7859
|
value: typeof D == "object" ? JSON.stringify(D) : String(D),
|
|
7845
7860
|
rawType: l(D)
|
|
7846
7861
|
});
|
|
@@ -7852,9 +7867,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7852
7867
|
if (f === "false") return !1;
|
|
7853
7868
|
if (f === "null") return null;
|
|
7854
7869
|
if (f === "undefined") return;
|
|
7855
|
-
const
|
|
7856
|
-
if (f !== "" && !isNaN(
|
|
7857
|
-
return String(
|
|
7870
|
+
const w = Number(f);
|
|
7871
|
+
if (f !== "" && !isNaN(w))
|
|
7872
|
+
return String(w) !== f ? f : w;
|
|
7858
7873
|
if (f.startsWith("{") && f.endsWith("}") || f.startsWith("[") && f.endsWith("]"))
|
|
7859
7874
|
try {
|
|
7860
7875
|
return JSON.parse(f);
|
|
@@ -7882,11 +7897,11 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7882
7897
|
s.value = h;
|
|
7883
7898
|
const f = e.selectedObject;
|
|
7884
7899
|
if (!f) return;
|
|
7885
|
-
const
|
|
7900
|
+
const w = f.userData[h];
|
|
7886
7901
|
try {
|
|
7887
|
-
i.value = JSON.stringify(
|
|
7902
|
+
i.value = JSON.stringify(w, null, 2);
|
|
7888
7903
|
} catch {
|
|
7889
|
-
i.value = String(
|
|
7904
|
+
i.value = String(w);
|
|
7890
7905
|
}
|
|
7891
7906
|
m();
|
|
7892
7907
|
}
|
|
@@ -7909,18 +7924,18 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7909
7924
|
function p(h) {
|
|
7910
7925
|
const f = e.selectedObject;
|
|
7911
7926
|
if (!f) return;
|
|
7912
|
-
const
|
|
7927
|
+
const w = i.value.trim();
|
|
7913
7928
|
try {
|
|
7914
|
-
const D = JSON.parse(
|
|
7929
|
+
const D = JSON.parse(w);
|
|
7915
7930
|
f.userData[h] = D, c(f), s.value = null, i.value = "";
|
|
7916
7931
|
} catch {
|
|
7917
|
-
f.userData[h] =
|
|
7932
|
+
f.userData[h] = w, c(f), s.value = null, i.value = "";
|
|
7918
7933
|
}
|
|
7919
7934
|
}
|
|
7920
7935
|
function I() {
|
|
7921
7936
|
s.value = null, i.value = "";
|
|
7922
7937
|
}
|
|
7923
|
-
function
|
|
7938
|
+
function v() {
|
|
7924
7939
|
const h = e.selectedObject;
|
|
7925
7940
|
if (!h) return;
|
|
7926
7941
|
const f = Us();
|
|
@@ -7942,7 +7957,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7942
7957
|
y("div", Nc, [
|
|
7943
7958
|
j(y("input", {
|
|
7944
7959
|
type: "text",
|
|
7945
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
7960
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => t.value = w),
|
|
7946
7961
|
placeholder: "属性名",
|
|
7947
7962
|
class: "ud-input",
|
|
7948
7963
|
onKeyup: ut(u, ["enter"])
|
|
@@ -7950,7 +7965,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7950
7965
|
[W, t.value]
|
|
7951
7966
|
]),
|
|
7952
7967
|
j(y("textarea", {
|
|
7953
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
7968
|
+
"onUpdate:modelValue": f[1] || (f[1] = (w) => n.value = w),
|
|
7954
7969
|
placeholder: "值",
|
|
7955
7970
|
class: "ud-input ud-textarea",
|
|
7956
7971
|
onKeyup: ut(ss(u, ["prevent"]), ["enter"])
|
|
@@ -7964,21 +7979,21 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7964
7979
|
}, " + ")
|
|
7965
7980
|
]),
|
|
7966
7981
|
a.value.length > 0 ? (H(), k("div", kc, [
|
|
7967
|
-
(H(!0), k(Ee, null, At(a.value, (
|
|
7968
|
-
key:
|
|
7982
|
+
(H(!0), k(Ee, null, At(a.value, (w, D) => (H(), k("div", {
|
|
7983
|
+
key: w.key,
|
|
7969
7984
|
class: Pe(["userdata-item", {
|
|
7970
|
-
readonly:
|
|
7971
|
-
"editing-json": s.value ===
|
|
7985
|
+
readonly: w.key === "isMovable",
|
|
7986
|
+
"editing-json": s.value === w.key
|
|
7972
7987
|
}])
|
|
7973
7988
|
}, [
|
|
7974
|
-
y("span", jc, fe(
|
|
7975
|
-
|
|
7976
|
-
s.value !==
|
|
7977
|
-
y("span", Uc, fe(A(
|
|
7989
|
+
y("span", jc, fe(w.key), 1),
|
|
7990
|
+
w.key === "isMovable" ? (H(), k("span", Fc, fe(String(w.value)) + " 🔒 ", 1)) : w.key !== "isMovable" ? (H(), k(Ee, { key: 1 }, [
|
|
7991
|
+
s.value !== w.key ? (H(), k(Ee, { key: 0 }, [
|
|
7992
|
+
y("span", Uc, fe(A(w.value)), 1),
|
|
7978
7993
|
y("button", {
|
|
7979
7994
|
class: "ud-btn edit-json-btn",
|
|
7980
7995
|
title: "编辑对象",
|
|
7981
|
-
onClick: (O) => b(
|
|
7996
|
+
onClick: (O) => b(w.key)
|
|
7982
7997
|
}, " ✎ ", 8, zc)
|
|
7983
7998
|
], 64)) : (H(), k(Ee, { key: 1 }, [
|
|
7984
7999
|
o.value ? (H(), k("div", Wc, " ⚠ " + fe(o.value), 1)) : re("", !0),
|
|
@@ -7994,7 +8009,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7994
8009
|
y("button", {
|
|
7995
8010
|
class: "ud-btn apply-btn",
|
|
7996
8011
|
title: "应用修改",
|
|
7997
|
-
onClick: (O) => p(
|
|
8012
|
+
onClick: (O) => p(w.key)
|
|
7998
8013
|
}, " ✓ ", 8, Bc),
|
|
7999
8014
|
y("button", {
|
|
8000
8015
|
class: "ud-btn cancel-btn",
|
|
@@ -8003,18 +8018,18 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8003
8018
|
}, " ✕ ")
|
|
8004
8019
|
])
|
|
8005
8020
|
], 64)),
|
|
8006
|
-
s.value !==
|
|
8021
|
+
s.value !== w.key ? (H(), k("button", {
|
|
8007
8022
|
key: 2,
|
|
8008
8023
|
class: "ud-btn del-btn",
|
|
8009
8024
|
title: "删除",
|
|
8010
|
-
onClick: (O) => g(
|
|
8025
|
+
onClick: (O) => g(w.key)
|
|
8011
8026
|
}, " ✕ ", 8, Xc)) : re("", !0)
|
|
8012
8027
|
], 64)) : re("", !0)
|
|
8013
8028
|
], 2))), 128))
|
|
8014
8029
|
])) : (H(), k("div", Vc, "暂无自定义数据")),
|
|
8015
8030
|
y("button", {
|
|
8016
8031
|
class: "get-camera-btn",
|
|
8017
|
-
onClick:
|
|
8032
|
+
onClick: v
|
|
8018
8033
|
}, " 添加当前相机位置 ")
|
|
8019
8034
|
])
|
|
8020
8035
|
]));
|
|
@@ -8047,9 +8062,9 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8047
8062
|
}
|
|
8048
8063
|
Me(t, () => p()), Me(n, () => p(), { deep: !0 });
|
|
8049
8064
|
function I(h) {
|
|
8050
|
-
n.value = n.value.filter((f,
|
|
8065
|
+
n.value = n.value.filter((f, w) => w !== h), p();
|
|
8051
8066
|
}
|
|
8052
|
-
function
|
|
8067
|
+
function v() {
|
|
8053
8068
|
!c.value.trim() || !d.value.trim() || (n.value = [
|
|
8054
8069
|
...n.value,
|
|
8055
8070
|
{
|
|
@@ -8077,7 +8092,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8077
8092
|
y("label", _c, [
|
|
8078
8093
|
j(y("input", {
|
|
8079
8094
|
type: "checkbox",
|
|
8080
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
8095
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => s.value = w)
|
|
8081
8096
|
}, null, 512), [
|
|
8082
8097
|
[Yi, s.value]
|
|
8083
8098
|
]),
|
|
@@ -8091,7 +8106,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8091
8106
|
j(y("input", {
|
|
8092
8107
|
type: "text",
|
|
8093
8108
|
class: "dp-input",
|
|
8094
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
8109
|
+
"onUpdate:modelValue": f[1] || (f[1] = (w) => t.value = w),
|
|
8095
8110
|
placeholder: "面板标题"
|
|
8096
8111
|
}, null, 512), [
|
|
8097
8112
|
[W, t.value]
|
|
@@ -8107,7 +8122,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8107
8122
|
min: "10",
|
|
8108
8123
|
max: "40",
|
|
8109
8124
|
step: "1",
|
|
8110
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
8125
|
+
"onUpdate:modelValue": f[2] || (f[2] = (w) => l.value = w)
|
|
8111
8126
|
}, null, 512), [
|
|
8112
8127
|
[
|
|
8113
8128
|
W,
|
|
@@ -8130,7 +8145,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8130
8145
|
min: "-5",
|
|
8131
8146
|
max: "5",
|
|
8132
8147
|
step: "0.01",
|
|
8133
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
8148
|
+
"onUpdate:modelValue": f[3] || (f[3] = (w) => o.value = w)
|
|
8134
8149
|
}, null, 512), [
|
|
8135
8150
|
[
|
|
8136
8151
|
W,
|
|
@@ -8143,7 +8158,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8143
8158
|
j(y("input", {
|
|
8144
8159
|
type: "number",
|
|
8145
8160
|
class: "dp-input dp-input-number",
|
|
8146
|
-
"onUpdate:modelValue": f[4] || (f[4] = (
|
|
8161
|
+
"onUpdate:modelValue": f[4] || (f[4] = (w) => o.value = w),
|
|
8147
8162
|
step: "0.01"
|
|
8148
8163
|
}, null, 512), [
|
|
8149
8164
|
[
|
|
@@ -8165,7 +8180,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8165
8180
|
min: "-5",
|
|
8166
8181
|
max: "5",
|
|
8167
8182
|
step: "0.01",
|
|
8168
|
-
"onUpdate:modelValue": f[5] || (f[5] = (
|
|
8183
|
+
"onUpdate:modelValue": f[5] || (f[5] = (w) => i.value = w)
|
|
8169
8184
|
}, null, 512), [
|
|
8170
8185
|
[
|
|
8171
8186
|
W,
|
|
@@ -8178,7 +8193,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8178
8193
|
j(y("input", {
|
|
8179
8194
|
type: "number",
|
|
8180
8195
|
class: "dp-input dp-input-number",
|
|
8181
|
-
"onUpdate:modelValue": f[6] || (f[6] = (
|
|
8196
|
+
"onUpdate:modelValue": f[6] || (f[6] = (w) => i.value = w),
|
|
8182
8197
|
step: "0.01"
|
|
8183
8198
|
}, null, 512), [
|
|
8184
8199
|
[
|
|
@@ -8200,7 +8215,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8200
8215
|
min: "-5",
|
|
8201
8216
|
max: "5",
|
|
8202
8217
|
step: "0.01",
|
|
8203
|
-
"onUpdate:modelValue": f[7] || (f[7] = (
|
|
8218
|
+
"onUpdate:modelValue": f[7] || (f[7] = (w) => a.value = w)
|
|
8204
8219
|
}, null, 512), [
|
|
8205
8220
|
[
|
|
8206
8221
|
W,
|
|
@@ -8213,7 +8228,7 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8213
8228
|
j(y("input", {
|
|
8214
8229
|
type: "number",
|
|
8215
8230
|
class: "dp-input dp-input-number",
|
|
8216
|
-
"onUpdate:modelValue": f[8] || (f[8] = (
|
|
8231
|
+
"onUpdate:modelValue": f[8] || (f[8] = (w) => a.value = w),
|
|
8217
8232
|
step: "0.01"
|
|
8218
8233
|
}, null, 512), [
|
|
8219
8234
|
[
|
|
@@ -8228,41 +8243,41 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8228
8243
|
y("div", uu, [
|
|
8229
8244
|
f[28] || (f[28] = y("span", { class: "dp-label-sm" }, "数据项", -1)),
|
|
8230
8245
|
y("div", du, [
|
|
8231
|
-
(H(!0), k(Ee, null, At(n.value, (
|
|
8246
|
+
(H(!0), k(Ee, null, At(n.value, (w, D) => (H(), k("div", {
|
|
8232
8247
|
key: D,
|
|
8233
8248
|
class: "dp-item"
|
|
8234
8249
|
}, [
|
|
8235
8250
|
j(y("input", {
|
|
8236
8251
|
type: "text",
|
|
8237
8252
|
class: "dp-input dp-input-sm",
|
|
8238
|
-
"onUpdate:modelValue": (O) =>
|
|
8253
|
+
"onUpdate:modelValue": (O) => w.label = O,
|
|
8239
8254
|
placeholder: "标签"
|
|
8240
8255
|
}, null, 8, fu), [
|
|
8241
|
-
[W,
|
|
8256
|
+
[W, w.label]
|
|
8242
8257
|
]),
|
|
8243
8258
|
j(y("input", {
|
|
8244
8259
|
type: "text",
|
|
8245
8260
|
class: "dp-input dp-input-sm",
|
|
8246
|
-
"onUpdate:modelValue": (O) =>
|
|
8261
|
+
"onUpdate:modelValue": (O) => w.value = O,
|
|
8247
8262
|
placeholder: "值"
|
|
8248
8263
|
}, null, 8, hu), [
|
|
8249
|
-
[W,
|
|
8264
|
+
[W, w.value]
|
|
8250
8265
|
]),
|
|
8251
8266
|
j(y("input", {
|
|
8252
8267
|
type: "text",
|
|
8253
8268
|
class: "dp-input dp-input-xs",
|
|
8254
|
-
"onUpdate:modelValue": (O) =>
|
|
8269
|
+
"onUpdate:modelValue": (O) => w.unit = O,
|
|
8255
8270
|
placeholder: "单位"
|
|
8256
8271
|
}, null, 8, pu), [
|
|
8257
|
-
[W,
|
|
8272
|
+
[W, w.unit]
|
|
8258
8273
|
]),
|
|
8259
8274
|
j(y("input", {
|
|
8260
8275
|
type: "text",
|
|
8261
8276
|
class: "dp-input dp-input-xs",
|
|
8262
|
-
"onUpdate:modelValue": (O) =>
|
|
8277
|
+
"onUpdate:modelValue": (O) => w.code = O,
|
|
8263
8278
|
placeholder: "编码"
|
|
8264
8279
|
}, null, 8, Au), [
|
|
8265
|
-
[W,
|
|
8280
|
+
[W, w.code]
|
|
8266
8281
|
]),
|
|
8267
8282
|
y("button", {
|
|
8268
8283
|
class: "dp-btn dp-btn-del",
|
|
@@ -8275,42 +8290,42 @@ const Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
8275
8290
|
j(y("input", {
|
|
8276
8291
|
type: "text",
|
|
8277
8292
|
class: "dp-input dp-input-sm",
|
|
8278
|
-
"onUpdate:modelValue": f[9] || (f[9] = (
|
|
8293
|
+
"onUpdate:modelValue": f[9] || (f[9] = (w) => c.value = w),
|
|
8279
8294
|
placeholder: "标签",
|
|
8280
|
-
onKeyup: ut(
|
|
8295
|
+
onKeyup: ut(v, ["enter"])
|
|
8281
8296
|
}, null, 544), [
|
|
8282
8297
|
[W, c.value]
|
|
8283
8298
|
]),
|
|
8284
8299
|
j(y("input", {
|
|
8285
8300
|
type: "text",
|
|
8286
8301
|
class: "dp-input dp-input-sm",
|
|
8287
|
-
"onUpdate:modelValue": f[10] || (f[10] = (
|
|
8302
|
+
"onUpdate:modelValue": f[10] || (f[10] = (w) => d.value = w),
|
|
8288
8303
|
placeholder: "值",
|
|
8289
|
-
onKeyup: ut(
|
|
8304
|
+
onKeyup: ut(v, ["enter"])
|
|
8290
8305
|
}, null, 544), [
|
|
8291
8306
|
[W, d.value]
|
|
8292
8307
|
]),
|
|
8293
8308
|
j(y("input", {
|
|
8294
8309
|
type: "text",
|
|
8295
8310
|
class: "dp-input dp-input-xs",
|
|
8296
|
-
"onUpdate:modelValue": f[11] || (f[11] = (
|
|
8311
|
+
"onUpdate:modelValue": f[11] || (f[11] = (w) => u.value = w),
|
|
8297
8312
|
placeholder: "单位",
|
|
8298
|
-
onKeyup: ut(
|
|
8313
|
+
onKeyup: ut(v, ["enter"])
|
|
8299
8314
|
}, null, 544), [
|
|
8300
8315
|
[W, u.value]
|
|
8301
8316
|
]),
|
|
8302
8317
|
j(y("input", {
|
|
8303
8318
|
type: "text",
|
|
8304
8319
|
class: "dp-input dp-input-xs",
|
|
8305
|
-
"onUpdate:modelValue": f[12] || (f[12] = (
|
|
8320
|
+
"onUpdate:modelValue": f[12] || (f[12] = (w) => g.value = w),
|
|
8306
8321
|
placeholder: "编码",
|
|
8307
|
-
onKeyup: ut(
|
|
8322
|
+
onKeyup: ut(v, ["enter"])
|
|
8308
8323
|
}, null, 544), [
|
|
8309
8324
|
[W, g.value]
|
|
8310
8325
|
]),
|
|
8311
8326
|
y("button", {
|
|
8312
8327
|
class: "dp-btn dp-btn-add",
|
|
8313
|
-
onClick:
|
|
8328
|
+
onClick: v,
|
|
8314
8329
|
title: "添加"
|
|
8315
8330
|
}, "+")
|
|
8316
8331
|
])
|
|
@@ -8370,16 +8385,16 @@ const Iu = {
|
|
|
8370
8385
|
emits: ["propertyChange", "treeSelect", "treeDelete", "transformModeChange"],
|
|
8371
8386
|
setup(r, { emit: e }) {
|
|
8372
8387
|
const t = r, n = e, s = G("translate");
|
|
8373
|
-
function i(
|
|
8374
|
-
s.value =
|
|
8388
|
+
function i(v) {
|
|
8389
|
+
s.value = v, n("transformModeChange", v);
|
|
8375
8390
|
}
|
|
8376
8391
|
const o = () => n("propertyChange"), a = G("transform"), l = tt(() => {
|
|
8377
|
-
var
|
|
8378
|
-
return !!(t.selectedObject && ((
|
|
8392
|
+
var v;
|
|
8393
|
+
return !!(t.selectedObject && ((v = t.selectedObject.userData) != null && v._hasDataPanel));
|
|
8379
8394
|
}), c = G(0), d = Ki(t, "selectedObject"), { expandedSet: u, toggleExpand: g } = xu(d);
|
|
8380
8395
|
Zi("treeExpand", { expandedSet: u, toggleExpand: g });
|
|
8381
|
-
const A = (
|
|
8382
|
-
c.value++, n("treeDelete",
|
|
8396
|
+
const A = (v) => {
|
|
8397
|
+
c.value++, n("treeDelete", v);
|
|
8383
8398
|
}, b = () => {
|
|
8384
8399
|
Na({
|
|
8385
8400
|
name: "",
|
|
@@ -8389,32 +8404,32 @@ if (selectedObject) {
|
|
|
8389
8404
|
moveTo(selectedObject, { x: 0, y: 2, z: 0 }, 1000);
|
|
8390
8405
|
}`
|
|
8391
8406
|
});
|
|
8392
|
-
}, m = (
|
|
8407
|
+
}, m = (v) => Ha(v), p = G("");
|
|
8393
8408
|
Me(
|
|
8394
8409
|
() => t.selectedObject,
|
|
8395
|
-
(
|
|
8396
|
-
p.value = (
|
|
8410
|
+
(v) => {
|
|
8411
|
+
p.value = (v == null ? void 0 : v.name) ?? "";
|
|
8397
8412
|
},
|
|
8398
8413
|
{ immediate: !0 }
|
|
8399
8414
|
);
|
|
8400
8415
|
const I = () => {
|
|
8401
8416
|
if (!t.selectedObject) return;
|
|
8402
|
-
const
|
|
8403
|
-
t.selectedObject.name =
|
|
8417
|
+
const v = p.value.trim();
|
|
8418
|
+
t.selectedObject.name = v || "未命名", p.value = t.selectedObject.name, c.value++;
|
|
8404
8419
|
};
|
|
8405
|
-
return (
|
|
8420
|
+
return (v, h) => v.transform ? (H(), k("div", Iu, [
|
|
8406
8421
|
y("div", Cu, [
|
|
8407
8422
|
h[8] || (h[8] = y("label", null, "场景物体", -1)),
|
|
8408
8423
|
y("div", wu, [
|
|
8409
|
-
(H(!0), k(Ee, null, At(
|
|
8424
|
+
(H(!0), k(Ee, null, At(v.treeData, (f) => (H(), vt(zl, {
|
|
8410
8425
|
key: f.uuid,
|
|
8411
8426
|
node: f,
|
|
8412
|
-
"selected-object":
|
|
8427
|
+
"selected-object": v.selectedObject,
|
|
8413
8428
|
version: c.value,
|
|
8414
|
-
onSelect: h[0] || (h[0] = (
|
|
8429
|
+
onSelect: h[0] || (h[0] = (w) => n("treeSelect", w)),
|
|
8415
8430
|
onDelete: A
|
|
8416
8431
|
}, null, 8, ["node", "selected-object", "version"]))), 128)),
|
|
8417
|
-
|
|
8432
|
+
v.treeData.length === 0 ? (H(), k("div", vu, "暂无物体")) : re("", !0)
|
|
8418
8433
|
])
|
|
8419
8434
|
]),
|
|
8420
8435
|
y("div", Mu, [
|
|
@@ -8451,7 +8466,7 @@ if (selectedObject) {
|
|
|
8451
8466
|
}, [
|
|
8452
8467
|
y("div", Du, [
|
|
8453
8468
|
j(y("input", {
|
|
8454
|
-
"onUpdate:modelValue": (
|
|
8469
|
+
"onUpdate:modelValue": (w) => f.name = w,
|
|
8455
8470
|
class: "script-name-input",
|
|
8456
8471
|
placeholder: "函数名称(按钮显示文字)",
|
|
8457
8472
|
spellcheck: "false"
|
|
@@ -8461,11 +8476,11 @@ if (selectedObject) {
|
|
|
8461
8476
|
y("button", {
|
|
8462
8477
|
class: "script-del-btn",
|
|
8463
8478
|
title: "删除该脚本",
|
|
8464
|
-
onClick: (
|
|
8479
|
+
onClick: (w) => m(f.id)
|
|
8465
8480
|
}, "✕", 8, Ru)
|
|
8466
8481
|
]),
|
|
8467
8482
|
j(y("textarea", {
|
|
8468
|
-
"onUpdate:modelValue": (
|
|
8483
|
+
"onUpdate:modelValue": (w) => f.code = w,
|
|
8469
8484
|
class: "script-code-input",
|
|
8470
8485
|
rows: "6",
|
|
8471
8486
|
spellcheck: "false",
|
|
@@ -8499,7 +8514,7 @@ function myFunc() {
|
|
|
8499
8514
|
ns(Se).scripts.length === 0 ? (H(), k("div", Su, " 暂无脚本,点击“+ 添加脚本”创建(画布底部会为每个脚本生成一个触发按钮) ")) : re("", !0)
|
|
8500
8515
|
])
|
|
8501
8516
|
]),
|
|
8502
|
-
|
|
8517
|
+
v.selectedObject ? (H(), k("div", Lu, [
|
|
8503
8518
|
h[11] || (h[11] = y("label", null, "物体名称", -1)),
|
|
8504
8519
|
j(y("input", {
|
|
8505
8520
|
"onUpdate:modelValue": h[4] || (h[4] = (f) => p.value = f),
|
|
@@ -8511,7 +8526,7 @@ function myFunc() {
|
|
|
8511
8526
|
[W, p.value]
|
|
8512
8527
|
])
|
|
8513
8528
|
])) : re("", !0),
|
|
8514
|
-
|
|
8529
|
+
v.selectedObject ? (H(), k("div", Nu, [
|
|
8515
8530
|
y("button", {
|
|
8516
8531
|
class: Pe(["tab-btn", { active: a.value === "transform" }]),
|
|
8517
8532
|
onClick: h[5] || (h[5] = (f) => a.value = "transform")
|
|
@@ -8526,18 +8541,18 @@ function myFunc() {
|
|
|
8526
8541
|
onClick: h[7] || (h[7] = (f) => a.value = "datapanel")
|
|
8527
8542
|
}, " 📊 数据面板 ", 2)) : re("", !0)
|
|
8528
8543
|
])) : re("", !0),
|
|
8529
|
-
|
|
8544
|
+
v.selectedObject ? (H(), k("div", Hu, [
|
|
8530
8545
|
j(gs(Pc, {
|
|
8531
|
-
transform:
|
|
8532
|
-
"selected-object":
|
|
8546
|
+
transform: v.transform,
|
|
8547
|
+
"selected-object": v.selectedObject,
|
|
8533
8548
|
onPropertyChange: o
|
|
8534
8549
|
}, null, 8, ["transform", "selected-object"]), [
|
|
8535
8550
|
[st, a.value === "transform"]
|
|
8536
8551
|
]),
|
|
8537
|
-
j(gs(Yc, { "selected-object":
|
|
8552
|
+
j(gs(Yc, { "selected-object": v.selectedObject }, null, 8, ["selected-object"]), [
|
|
8538
8553
|
[st, a.value === "userdata"]
|
|
8539
8554
|
]),
|
|
8540
|
-
j(gs(bu, { "selected-object":
|
|
8555
|
+
j(gs(bu, { "selected-object": v.selectedObject }, null, 8, ["selected-object"]), [
|
|
8541
8556
|
[st, a.value === "datapanel"]
|
|
8542
8557
|
])
|
|
8543
8558
|
])) : re("", !0)
|
|
@@ -8748,11 +8763,11 @@ function myFunc() {
|
|
|
8748
8763
|
mi(h);
|
|
8749
8764
|
}, m = (h) => Fa(h), p = tt(
|
|
8750
8765
|
() => Se.scripts.filter((h) => !fi(h))
|
|
8751
|
-
), I = G(null),
|
|
8766
|
+
), I = G(null), v = async () => {
|
|
8752
8767
|
I.value && await Wa(I.value, e.mode, e.sceneData), u();
|
|
8753
8768
|
};
|
|
8754
8769
|
return Qi(() => {
|
|
8755
|
-
|
|
8770
|
+
v(), I.value && vr(I.value);
|
|
8756
8771
|
}), Ji(() => {
|
|
8757
8772
|
console.log("endset_three_editor destroy"), vl();
|
|
8758
8773
|
}), (h, f) => (H(), k("div", Qu, [
|
|
@@ -8774,12 +8789,12 @@ function myFunc() {
|
|
|
8774
8789
|
ref: I
|
|
8775
8790
|
}, [
|
|
8776
8791
|
p.value.length > 0 ? (H(), k("div", _u, [
|
|
8777
|
-
(H(!0), k(Ee, null, At(p.value, (
|
|
8778
|
-
key:
|
|
8792
|
+
(H(!0), k(Ee, null, At(p.value, (w, D) => (H(), k("button", {
|
|
8793
|
+
key: w.id,
|
|
8779
8794
|
class: "script-trigger-btn",
|
|
8780
|
-
title:
|
|
8781
|
-
onClick: ss((O) => m(
|
|
8782
|
-
}, " ▶ " + fe(ns(Ua)(
|
|
8795
|
+
title: w.code,
|
|
8796
|
+
onClick: ss((O) => m(w.id), ["stop"])
|
|
8797
|
+
}, " ▶ " + fe(ns(Ua)(w, D)), 9, $u))), 128))
|
|
8783
8798
|
])) : re("", !0)
|
|
8784
8799
|
], 2),
|
|
8785
8800
|
h.mode === "edit" ? (H(), vt(Fu, {
|