endset_three_editor 0.10.13 → 0.10.14
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
|
@@ -5304,7 +5304,7 @@ function el(r) {
|
|
|
5304
5304
|
), n = new O.Raycaster();
|
|
5305
5305
|
n.setFromCamera(t, C.camera);
|
|
5306
5306
|
const s = [], i = (a) => {
|
|
5307
|
-
a.isTransformControlsRoot || ((a.userData.isMovable || a.userData.type === "lightHelper") && s.push(a), a.children.forEach(i));
|
|
5307
|
+
a.isTransformControlsRoot || a.isGridHelper || a.type === "Line" || a.type === "LineSegments" || ((a.userData.isMovable || a.userData.type === "lightHelper") && s.push(a), a.children.forEach(i));
|
|
5308
5308
|
};
|
|
5309
5309
|
i(C.scene);
|
|
5310
5310
|
const o = n.intersectObjects(s);
|
|
@@ -5842,30 +5842,26 @@ async function wl(r, e = "edit", t, n, s, i, o) {
|
|
|
5842
5842
|
const a = Cl(r);
|
|
5843
5843
|
if (a) {
|
|
5844
5844
|
const m = await new ai().parseAsync(a, ""), A = m.scene || ((l = m.scenes) == null ? void 0 : l[0]), I = (c = C.scene) == null ? void 0 : c.environment;
|
|
5845
|
-
if (C.scene = A, !A.children.some((
|
|
5845
|
+
if (C.scene = A, !A.children.some((w) => w.type === "AmbientLight"))
|
|
5846
5846
|
if (i) {
|
|
5847
|
-
const
|
|
5848
|
-
|
|
5847
|
+
const w = new O.AmbientLight(i.color, i.intensity);
|
|
5848
|
+
w.name = i.name || "环境光", w.visible = i.visible ?? !0, i.position && w.position.fromArray(i.position), A.add(w);
|
|
5849
5849
|
} else
|
|
5850
5850
|
hi(A);
|
|
5851
5851
|
if (I)
|
|
5852
5852
|
C.scene.environment = I, C.scene.environmentIntensity = 1;
|
|
5853
5853
|
else if (C.renderer) {
|
|
5854
|
-
const
|
|
5855
|
-
|
|
5854
|
+
const w = Jt(C.renderer);
|
|
5855
|
+
w && (C.scene.environment = w, C.scene.environmentIntensity = 1);
|
|
5856
5856
|
}
|
|
5857
5857
|
if (!C.scene.environment && C.renderer) {
|
|
5858
|
-
const
|
|
5859
|
-
|
|
5860
|
-
}
|
|
5861
|
-
bi(A)
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
const h = f.material;
|
|
5866
|
-
f.userData.isWater && h && !h.uniforms && !f.userData.waterSpeed && (f.userData.waterSpeed = { x: 5e-4, y: 5e-4 }), f.children.forEach(w);
|
|
5867
|
-
};
|
|
5868
|
-
w(A);
|
|
5858
|
+
const w = Jt(C.renderer);
|
|
5859
|
+
w ? (C.scene.environment = w, C.scene.environmentIntensity = 1, console.warn("[导入] 原环境贴图不可用,已重新生成")) : console.error("[导入] 环境贴图生成失败,场景将没有 IBL 间接光照,模型会偏暗");
|
|
5860
|
+
}
|
|
5861
|
+
bi(A), A.traverse((w) => {
|
|
5862
|
+
const f = w.material;
|
|
5863
|
+
w.userData.isWater && f && !f.uniforms && !w.userData.waterSpeed && (w.userData.waterSpeed = { x: 5e-4, y: 5e-4 });
|
|
5864
|
+
});
|
|
5869
5865
|
} else {
|
|
5870
5866
|
const m = typeof r == "string" ? JSON.parse(r) : r, I = new O.ObjectLoader().parse(m);
|
|
5871
5867
|
if (I.type === "Scene") {
|