@roomle/web-sdk 3.6.0-alpha.2 → 3.6.0-alpha.3
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/lib/{BufferGeometry-BZdSmtHt.mjs → BufferGeometry-C1o0MiFL.mjs} +2 -2
- package/lib/{BufferGeometry-BZdSmtHt.mjs.map → BufferGeometry-C1o0MiFL.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.js +2 -2
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-DiE_HuI6.mjs → GLTFExporter-CXMBueJw.mjs} +510 -473
- package/lib/GLTFExporter-CXMBueJw.mjs.map +1 -0
- package/lib/{PointLightHelper-BvRpTX7D.mjs → PointLightHelper-ICWLqwjK.mjs} +3 -3
- package/lib/{PointLightHelper-BvRpTX7D.mjs.map → PointLightHelper-ICWLqwjK.mjs.map} +1 -1
- package/lib/RoomleCore.js +4 -4
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-Byg39thi.mjs → SpotLightHelper-CW5lDGFp.mjs} +3 -3
- package/lib/{SpotLightHelper-Byg39thi.mjs.map → SpotLightHelper-CW5lDGFp.mjs.map} +1 -1
- package/lib/{USDZExporter-VBx9xybH.mjs → USDZExporter-CUp3dX08.mjs} +218 -211
- package/lib/USDZExporter-CUp3dX08.mjs.map +1 -0
- package/lib/asset-loader.worker.js +1 -1
- package/lib/{banana-for-scale-C9_AyZkI.mjs → banana-for-scale-CfQ8dnY2.mjs} +2 -2
- package/lib/{banana-for-scale-C9_AyZkI.mjs.map → banana-for-scale-CfQ8dnY2.mjs.map} +1 -1
- package/lib/component-dimensioning-C9AWhxvj.mjs +237 -0
- package/lib/component-dimensioning-C9AWhxvj.mjs.map +1 -0
- package/lib/{continuous-drawing-helper-BNHRsd4B.mjs → continuous-drawing-helper-B5BlbPPz.mjs} +2 -2
- package/lib/{continuous-drawing-helper-BNHRsd4B.mjs.map → continuous-drawing-helper-B5BlbPPz.mjs.map} +1 -1
- package/lib/{homag-intelligence-BraN723F.mjs → homag-intelligence-UFo9Z8FS.mjs} +42 -38
- package/lib/homag-intelligence-UFo9Z8FS.mjs.map +1 -0
- package/lib/{imos-ix-poc-export-helper-D7ubISCJ.mjs → imos-ix-poc-export-helper-CGSk-8yx.mjs} +2 -2
- package/lib/{imos-ix-poc-export-helper-D7ubISCJ.mjs.map → imos-ix-poc-export-helper-CGSk-8yx.mjs.map} +1 -1
- package/lib/{index-C-Prfui2.mjs → index-DIyMlQBA.mjs} +46178 -18733
- package/lib/index-DIyMlQBA.mjs.map +1 -0
- package/lib/{material-viewer-DyVGp6Xm.mjs → material-viewer-QTlidNBs.mjs} +7 -6
- package/lib/material-viewer-QTlidNBs.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +287 -132
- package/lib/roomle-sdk.js +29 -29
- package/lib/static/asset-loader.worker.js +1 -1
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.js +2 -2
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleCore.js +4 -4
- package/lib/static/roomle-core-hsc/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleToolsCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/configurableObject.d.ts +2 -2
- package/lib/static/roomle-core-hsc/configurableObject.js +6 -6
- package/lib/static/roomle-core-hsc/configurableObject.js.map +1 -1
- package/lib/static/roomle-core-hsc/configurationLoader.js +1 -5
- package/lib/static/roomle-core-hsc/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/configurationManager.d.ts +1 -0
- package/lib/static/roomle-core-hsc/configurationManager.js +6 -0
- package/lib/static/roomle-core-hsc/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/configuratorCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/configuratorCoreInterface.d.ts +22 -29
- package/lib/static/roomle-core-hsc/embind/configuratorCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.d.ts +22 -29
- package/lib/static/roomle-core-hsc/embind/plannerCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/embind/plannerCoreCallback.d.ts +1 -1
- package/lib/static/roomle-core-hsc/embind/plannerCoreCallback.js +1 -1
- package/lib/static/roomle-core-hsc/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.d.ts +74 -81
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.js +1 -6
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/loader/configurableObject.d.ts +2 -2
- package/lib/static/roomle-core-hsc/loader/configurableObject.js +6 -6
- package/lib/static/roomle-core-hsc/loader/configurableObject.js.map +1 -1
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js +1 -5
- package/lib/static/roomle-core-hsc/loader/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/loader/configurationManager.d.ts +1 -0
- package/lib/static/roomle-core-hsc/loader/configurationManager.js +6 -0
- package/lib/static/roomle-core-hsc/loader/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/loader/planElementManager.d.ts +2 -2
- package/lib/static/roomle-core-hsc/loader/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/planElementManager.d.ts +2 -2
- package/lib/static/roomle-core-hsc/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/plannerCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/plannerCoreCallback.d.ts +1 -1
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js +1 -1
- package/lib/static/roomle-core-hsc/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/plannerCoreInterface.d.ts +74 -81
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js +1 -6
- package/lib/static/roomle-core-hsc/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/embind/configuratorCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +22 -29
- package/lib/static/roomle-core-hsc/src/embind/plannerCore.d.ts +1 -2
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js +1 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +74 -81
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js +1 -6
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.d.ts +2 -2
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.js +6 -6
- package/lib/static/roomle-core-hsc/src/loader/configurableObject.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js +1 -5
- package/lib/static/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.d.ts +1 -0
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js +6 -0
- package/lib/static/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.d.ts +2 -2
- package/lib/static/roomle-core-hsc/src/loader/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +2 -2
- package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.js +4 -4
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-UQlUyOTj.mjs → stats-helper-cTITQsAT.mjs} +2 -2
- package/lib/{stats-helper-UQlUyOTj.mjs.map → stats-helper-cTITQsAT.mjs.map} +1 -1
- package/lib/{tools-core-wkPFRdnH.mjs → tools-core-CCWbo8fD.mjs} +2 -2
- package/lib/{tools-core-wkPFRdnH.mjs.map → tools-core-CCWbo8fD.mjs.map} +1 -1
- package/package.json +3 -3
- package/lib/GLTFExporter-DiE_HuI6.mjs.map +0 -1
- package/lib/USDZExporter-VBx9xybH.mjs.map +0 -1
- package/lib/component-dimensioning-DHTSa-If.mjs +0 -229
- package/lib/component-dimensioning-DHTSa-If.mjs.map +0 -1
- package/lib/homag-intelligence-BraN723F.mjs.map +0 -1
- package/lib/index-C-Prfui2.mjs.map +0 -1
- package/lib/material-viewer-DyVGp6Xm.mjs.map +0 -1
- package/lib/three.webgpu-sHJcp001.mjs +0 -27625
- package/lib/three.webgpu-sHJcp001.mjs.map +0 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aH as b, aI as k, j as A, f as v, aJ as D } from "./index-DIyMlQBA.mjs";
|
|
2
2
|
class $ {
|
|
3
|
-
constructor(
|
|
4
|
-
this.name =
|
|
3
|
+
constructor(r, e = "", n = [], o = []) {
|
|
4
|
+
this.name = r, this.type = e, this.metadata = n, this.properties = o, this.children = [];
|
|
5
5
|
}
|
|
6
|
-
addMetadata(
|
|
7
|
-
this.metadata.push({ key:
|
|
6
|
+
addMetadata(r, e) {
|
|
7
|
+
this.metadata.push({ key: r, value: e });
|
|
8
8
|
}
|
|
9
|
-
addProperty(
|
|
10
|
-
this.properties.push({ property:
|
|
9
|
+
addProperty(r, e = []) {
|
|
10
|
+
this.properties.push({ property: r, metadata: e });
|
|
11
11
|
}
|
|
12
|
-
addChild(
|
|
13
|
-
this.children.push(
|
|
12
|
+
addChild(r) {
|
|
13
|
+
this.children.push(r);
|
|
14
14
|
}
|
|
15
|
-
toString(
|
|
16
|
-
const e = " ".repeat(
|
|
17
|
-
const
|
|
18
|
-
if (Array.isArray(
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
}),
|
|
15
|
+
toString(r = 0) {
|
|
16
|
+
const e = " ".repeat(r), n = this.metadata.map((c) => {
|
|
17
|
+
const y = c.key, f = c.value;
|
|
18
|
+
if (Array.isArray(f)) {
|
|
19
|
+
const p = [];
|
|
20
|
+
return p.push(`${y} = {`), f.forEach((g) => {
|
|
21
|
+
p.push(`${e} ${g}`);
|
|
22
|
+
}), p.push(`${e} }`), p.join(`
|
|
23
23
|
`);
|
|
24
24
|
} else
|
|
25
|
-
return `${
|
|
26
|
-
}), o =
|
|
27
|
-
${
|
|
25
|
+
return `${y} = ${f}`;
|
|
26
|
+
}), o = n.length ? ` (
|
|
27
|
+
${n.map((c) => `${e} ${c}`).join(`
|
|
28
28
|
`)}
|
|
29
29
|
${e})` : "", s = this.properties.map((c) => {
|
|
30
|
-
const
|
|
31
|
-
${c.metadata.map((
|
|
30
|
+
const y = c.property, f = c.metadata.length ? ` (
|
|
31
|
+
${c.metadata.map((p) => `${e} ${p}`).join(`
|
|
32
32
|
`)}
|
|
33
33
|
${e} )` : "";
|
|
34
|
-
return `${e} ${
|
|
35
|
-
}), i = this.children.map((c) => c.toString(
|
|
36
|
-
if (s.length > 0 &&
|
|
37
|
-
s.length > 0 &&
|
|
34
|
+
return `${e} ${y}${f}`;
|
|
35
|
+
}), i = this.children.map((c) => c.toString(r + 1)), a = [];
|
|
36
|
+
if (s.length > 0 && a.push(...s), i.length > 0) {
|
|
37
|
+
s.length > 0 && a.push("");
|
|
38
38
|
for (let c = 0; c < i.length; c++)
|
|
39
|
-
|
|
39
|
+
a.push(i[c]), c < i.length - 1 && a.push("");
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const d = a.join(`
|
|
42
42
|
`), l = this.type ? this.type + " " : "";
|
|
43
43
|
return `${e}def ${l}"${this.name}"${o}
|
|
44
44
|
${e}{
|
|
45
|
-
${
|
|
45
|
+
${d}
|
|
46
46
|
${e}}`;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
class
|
|
49
|
+
class Y {
|
|
50
50
|
/**
|
|
51
51
|
* Constructs a new USDZ exporter.
|
|
52
52
|
*/
|
|
@@ -61,8 +61,8 @@ class W {
|
|
|
61
61
|
*
|
|
62
62
|
* @param {WebGLTextureUtils|WebGPUTextureUtils} utils - The texture utils.
|
|
63
63
|
*/
|
|
64
|
-
setTextureUtils(
|
|
65
|
-
this.textureUtils =
|
|
64
|
+
setTextureUtils(r) {
|
|
65
|
+
this.textureUtils = r;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* Parse the given 3D object and generates the USDZ output.
|
|
@@ -72,8 +72,8 @@ class W {
|
|
|
72
72
|
* @param {USDZExporter~OnError} onError - A callback function that is executed when an error happens.
|
|
73
73
|
* @param {USDZExporter~Options} options - The export options.
|
|
74
74
|
*/
|
|
75
|
-
parse(
|
|
76
|
-
this.parseAsync(
|
|
75
|
+
parse(r, e, n, o) {
|
|
76
|
+
this.parseAsync(r, o).then(e).catch(n);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Async version of {@link USDZExporter#parse}.
|
|
@@ -83,7 +83,7 @@ class W {
|
|
|
83
83
|
* @param {USDZExporter~Options} options - The export options.
|
|
84
84
|
* @return {Promise<ArrayBuffer>} A Promise that resolved with the exported USDZ data.
|
|
85
85
|
*/
|
|
86
|
-
async parseAsync(
|
|
86
|
+
async parseAsync(r, e = {}) {
|
|
87
87
|
e = Object.assign(
|
|
88
88
|
{
|
|
89
89
|
ar: {
|
|
@@ -97,81 +97,81 @@ class W {
|
|
|
97
97
|
},
|
|
98
98
|
e
|
|
99
99
|
);
|
|
100
|
-
const
|
|
100
|
+
const n = /* @__PURE__ */ new Set(), o = {}, s = "model.usda";
|
|
101
101
|
o[s] = null;
|
|
102
|
-
const i = new $("Root", "Xform"),
|
|
103
|
-
|
|
104
|
-
const
|
|
102
|
+
const i = new $("Root", "Xform"), a = new $("Scenes", "Scope");
|
|
103
|
+
a.addMetadata("kind", '"sceneLibrary"'), i.addChild(a);
|
|
104
|
+
const d = "Scene", l = new $(d, "Xform");
|
|
105
105
|
l.addMetadata("customData", [
|
|
106
106
|
"bool preliminary_collidesWithEnvironment = 0",
|
|
107
|
-
`string sceneName = "${
|
|
108
|
-
]), l.addMetadata("sceneName", `"${
|
|
107
|
+
`string sceneName = "${d}"`
|
|
108
|
+
]), l.addMetadata("sceneName", `"${d}"`), e.includeAnchoringProperties && (l.addProperty(
|
|
109
109
|
`token preliminary:anchoring:type = "${e.ar.anchoring.type}"`
|
|
110
110
|
), l.addProperty(
|
|
111
111
|
`token preliminary:planeAnchoring:alignment = "${e.ar.planeAnchoring.alignment}"`
|
|
112
|
-
)),
|
|
112
|
+
)), a.addChild(l);
|
|
113
113
|
let c;
|
|
114
|
-
const
|
|
115
|
-
T(
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
const y = {}, f = {};
|
|
115
|
+
T(r, l, y, n, o, e);
|
|
116
|
+
const p = X(
|
|
117
|
+
y,
|
|
118
|
+
f,
|
|
119
119
|
e.quickLookCompatible
|
|
120
120
|
);
|
|
121
121
|
c = E() + `
|
|
122
122
|
` + i.toString() + `
|
|
123
123
|
|
|
124
|
-
` +
|
|
125
|
-
for (const
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
124
|
+
` + p.toString(), o[s] = b(c), c = null;
|
|
125
|
+
for (const M in f) {
|
|
126
|
+
let x = f[M];
|
|
127
|
+
if (x.isCompressedTexture === !0) {
|
|
128
128
|
if (this.textureUtils === null)
|
|
129
129
|
throw new Error(
|
|
130
130
|
"THREE.USDZExporter: setTextureUtils() must be called to process compressed textures."
|
|
131
131
|
);
|
|
132
|
-
|
|
132
|
+
x = await this.textureUtils.decompress(x);
|
|
133
133
|
}
|
|
134
134
|
const m = I(
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
x.image,
|
|
136
|
+
x.flipY,
|
|
137
137
|
e.maxTextureSize
|
|
138
|
-
),
|
|
139
|
-
(
|
|
138
|
+
), P = await new Promise(
|
|
139
|
+
(h) => m.toBlob(h, "image/png", 1)
|
|
140
140
|
);
|
|
141
|
-
o[`textures/Texture_${
|
|
142
|
-
await
|
|
141
|
+
o[`textures/Texture_${M}.png`] = new Uint8Array(
|
|
142
|
+
await P.arrayBuffer()
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
|
-
let
|
|
146
|
-
for (const
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
const
|
|
152
|
-
o[
|
|
145
|
+
let g = 0;
|
|
146
|
+
for (const M in o) {
|
|
147
|
+
const x = o[M], m = 34 + M.length;
|
|
148
|
+
g += m;
|
|
149
|
+
const P = g & 63;
|
|
150
|
+
if (P !== 4) {
|
|
151
|
+
const h = 64 - P, U = new Uint8Array(h);
|
|
152
|
+
o[M] = [x, { extra: { 12345: U } }];
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
g = x.length;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return k(o, { level: 0 });
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function N(t,
|
|
159
|
+
function N(t, r) {
|
|
160
160
|
let e = t.name;
|
|
161
|
-
return e = e.replace(/[^A-Za-z0-9_]/g, ""), /^[0-9]/.test(e) && (e = "_" + e), e === "" && (t.isCamera ? e = "Camera" : e = "Object"),
|
|
161
|
+
return e = e.replace(/[^A-Za-z0-9_]/g, ""), /^[0-9]/.test(e) && (e = "_" + e), e === "" && (t.isCamera ? e = "Camera" : e = "Object"), r.has(e) && (e = e + "_" + t.id), r.add(e), e;
|
|
162
162
|
}
|
|
163
|
-
function I(t,
|
|
163
|
+
function I(t, r, e) {
|
|
164
164
|
if (typeof HTMLImageElement < "u" && t instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && t instanceof OffscreenCanvas || typeof ImageBitmap < "u" && t instanceof ImageBitmap) {
|
|
165
|
-
const
|
|
166
|
-
o.width = t.width * Math.min(1,
|
|
165
|
+
const n = e / Math.max(t.width, t.height), o = document.createElement("canvas");
|
|
166
|
+
o.width = t.width * Math.min(1, n), o.height = t.height * Math.min(1, n);
|
|
167
167
|
const s = o.getContext("2d");
|
|
168
|
-
return
|
|
168
|
+
return r === !0 && (s.translate(0, o.height), s.scale(1, -1)), s.drawImage(t, 0, 0, o.width, o.height), o;
|
|
169
169
|
} else
|
|
170
170
|
throw new Error(
|
|
171
171
|
"THREE.USDZExporter: No valid image data found. Unable to process texture."
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const u = 7;
|
|
175
175
|
function E() {
|
|
176
176
|
return `#usda 1.0
|
|
177
177
|
(
|
|
@@ -184,192 +184,199 @@ function E() {
|
|
|
184
184
|
)
|
|
185
185
|
`;
|
|
186
186
|
}
|
|
187
|
-
function T(t,
|
|
188
|
-
for (let i = 0,
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
187
|
+
function T(t, r, e, n, o, s) {
|
|
188
|
+
for (let i = 0, a = t.children.length; i < a; i++) {
|
|
189
|
+
const d = t.children[i];
|
|
190
|
+
if (d.visible === !1 && s.onlyVisible === !0) continue;
|
|
191
191
|
let l;
|
|
192
|
-
if (
|
|
193
|
-
const c =
|
|
194
|
-
if (
|
|
195
|
-
const
|
|
196
|
-
if (!(
|
|
197
|
-
const
|
|
198
|
-
o[
|
|
192
|
+
if (d.isMesh) {
|
|
193
|
+
const c = d.geometry, y = d.material;
|
|
194
|
+
if (y.isMeshStandardMaterial) {
|
|
195
|
+
const f = "geometries/Geometry_" + c.id + ".usda";
|
|
196
|
+
if (!(f in o)) {
|
|
197
|
+
const p = Z(c);
|
|
198
|
+
o[f] = b(
|
|
199
199
|
E() + `
|
|
200
|
-
` +
|
|
200
|
+
` + p.toString()
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
y.uuid in e || (e[y.uuid] = y), l = H(
|
|
204
|
+
d,
|
|
205
205
|
c,
|
|
206
|
-
e[
|
|
207
|
-
|
|
206
|
+
e[y.uuid],
|
|
207
|
+
n
|
|
208
208
|
);
|
|
209
209
|
} else
|
|
210
210
|
console.warn(
|
|
211
211
|
"THREE.USDZExporter: Unsupported material type (USDZ only supports MeshStandardMaterial)",
|
|
212
|
-
|
|
212
|
+
d
|
|
213
213
|
);
|
|
214
|
-
} else
|
|
215
|
-
l && (
|
|
214
|
+
} else d.isCamera ? l = F(d, n) : l = R(d, n);
|
|
215
|
+
l && (r.addChild(l), T(d, l, e, n, o, s));
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function R(t,
|
|
219
|
-
const e = N(t,
|
|
218
|
+
function R(t, r) {
|
|
219
|
+
const e = N(t, r);
|
|
220
220
|
t.matrix.determinant() < 0 && console.warn(
|
|
221
221
|
"THREE.USDZExporter: USDZ does not support negative scales",
|
|
222
222
|
t
|
|
223
223
|
);
|
|
224
|
-
const
|
|
225
|
-
|
|
224
|
+
const n = new $(e, "Xform");
|
|
225
|
+
if (t.pivot !== null) {
|
|
226
|
+
const o = t.position, s = t.quaternion, i = t.scale, a = t.pivot;
|
|
227
|
+
n.addProperty(`float3 xformOp:translate = (${o.x.toPrecision(u)}, ${o.y.toPrecision(u)}, ${o.z.toPrecision(u)})`), n.addProperty(`float3 xformOp:translate:pivot = (${a.x.toPrecision(u)}, ${a.y.toPrecision(u)}, ${a.z.toPrecision(u)})`), n.addProperty(`quatf xformOp:orient = (${s.w.toPrecision(u)}, ${s.x.toPrecision(u)}, ${s.y.toPrecision(u)}, ${s.z.toPrecision(u)})`), n.addProperty(`float3 xformOp:scale = (${i.x.toPrecision(u)}, ${i.y.toPrecision(u)}, ${i.z.toPrecision(u)})`), n.addProperty('uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:translate:pivot", "xformOp:orient", "xformOp:scale", "!invert!xformOp:translate:pivot"]');
|
|
228
|
+
} else {
|
|
229
|
+
const o = O(t.matrix);
|
|
230
|
+
n.addProperty(`matrix4d xformOp:transform = ${o}`), n.addProperty('uniform token[] xformOpOrder = ["xformOp:transform"]');
|
|
231
|
+
}
|
|
232
|
+
return n;
|
|
226
233
|
}
|
|
227
|
-
function
|
|
228
|
-
const o = R(t,
|
|
234
|
+
function H(t, r, e, n) {
|
|
235
|
+
const o = R(t, n);
|
|
229
236
|
return o.addMetadata(
|
|
230
237
|
"prepend references",
|
|
231
|
-
`@./geometries/Geometry_${
|
|
238
|
+
`@./geometries/Geometry_${r.id}.usda@</Geometry>`
|
|
232
239
|
), o.addMetadata("prepend apiSchemas", '["MaterialBindingAPI"]'), o.addProperty(
|
|
233
240
|
`rel material:binding = </Materials/Material_${e.id}>`
|
|
234
241
|
), o;
|
|
235
242
|
}
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
return `( ${
|
|
239
|
-
|
|
243
|
+
function O(t) {
|
|
244
|
+
const r = t.elements;
|
|
245
|
+
return `( ${C(r, 0)}, ${C(
|
|
246
|
+
r,
|
|
240
247
|
4
|
|
241
|
-
)}, ${
|
|
248
|
+
)}, ${C(r, 8)}, ${C(r, 12)} )`;
|
|
242
249
|
}
|
|
243
|
-
function
|
|
244
|
-
return `(${t[
|
|
250
|
+
function C(t, r) {
|
|
251
|
+
return `(${t[r + 0]}, ${t[r + 1]}, ${t[r + 2]}, ${t[r + 3]})`;
|
|
245
252
|
}
|
|
246
|
-
function
|
|
247
|
-
const
|
|
248
|
-
return
|
|
253
|
+
function Z(t) {
|
|
254
|
+
const r = new $("Geometry"), e = z(t);
|
|
255
|
+
return r.addChild(e), r;
|
|
249
256
|
}
|
|
250
|
-
function
|
|
251
|
-
const
|
|
257
|
+
function z(t) {
|
|
258
|
+
const r = "Geometry", e = t.attributes, n = e.position.count, o = new $(r, "Mesh");
|
|
252
259
|
o.addProperty(
|
|
253
|
-
`int[] faceVertexCounts = [${
|
|
260
|
+
`int[] faceVertexCounts = [${L(t)}]`
|
|
254
261
|
), o.addProperty(
|
|
255
262
|
`int[] faceVertexIndices = [${V(t)}]`
|
|
256
263
|
), o.addProperty(
|
|
257
|
-
`normal3f[] normals = [${
|
|
264
|
+
`normal3f[] normals = [${_(e.normal, n)}]`,
|
|
258
265
|
['interpolation = "vertex"']
|
|
259
266
|
), o.addProperty(
|
|
260
|
-
`point3f[] points = [${
|
|
267
|
+
`point3f[] points = [${_(e.position, n)}]`
|
|
261
268
|
);
|
|
262
269
|
for (let i = 0; i < 4; i++) {
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
`texCoord2f[] primvars:st${
|
|
270
|
+
const a = i > 0 ? i : "", d = e["uv" + a];
|
|
271
|
+
d !== void 0 && o.addProperty(
|
|
272
|
+
`texCoord2f[] primvars:st${a} = [${G(d)}]`,
|
|
266
273
|
['interpolation = "vertex"']
|
|
267
274
|
);
|
|
268
275
|
}
|
|
269
276
|
const s = e.color;
|
|
270
277
|
return s !== void 0 && o.addProperty(
|
|
271
|
-
`color3f[] primvars:displayColor = [${
|
|
278
|
+
`color3f[] primvars:displayColor = [${_(
|
|
272
279
|
s,
|
|
273
|
-
|
|
280
|
+
n
|
|
274
281
|
)}]`,
|
|
275
282
|
['interpolation = "vertex"']
|
|
276
283
|
), o.addProperty('uniform token subdivisionScheme = "none"'), o;
|
|
277
284
|
}
|
|
278
|
-
function
|
|
279
|
-
const
|
|
280
|
-
return Array(
|
|
285
|
+
function L(t) {
|
|
286
|
+
const r = t.index !== null ? t.index.count : t.attributes.position.count;
|
|
287
|
+
return Array(r / 3).fill(3).join(", ");
|
|
281
288
|
}
|
|
282
289
|
function V(t) {
|
|
283
|
-
const
|
|
284
|
-
if (
|
|
285
|
-
for (let
|
|
286
|
-
e.push(
|
|
290
|
+
const r = t.index, e = [];
|
|
291
|
+
if (r !== null)
|
|
292
|
+
for (let n = 0; n < r.count; n++)
|
|
293
|
+
e.push(r.getX(n));
|
|
287
294
|
else {
|
|
288
|
-
const
|
|
289
|
-
for (let o = 0; o <
|
|
295
|
+
const n = t.attributes.position.count;
|
|
296
|
+
for (let o = 0; o < n; o++)
|
|
290
297
|
e.push(o);
|
|
291
298
|
}
|
|
292
299
|
return e.join(", ");
|
|
293
300
|
}
|
|
294
|
-
function
|
|
301
|
+
function _(t, r) {
|
|
295
302
|
if (t === void 0)
|
|
296
|
-
return console.warn("USDZExporter: Normals missing."), Array(
|
|
303
|
+
return console.warn("USDZExporter: Normals missing."), Array(r).fill("(0, 0, 0)").join(", ");
|
|
297
304
|
const e = [];
|
|
298
|
-
for (let
|
|
299
|
-
const o = t.getX(
|
|
305
|
+
for (let n = 0; n < t.count; n++) {
|
|
306
|
+
const o = t.getX(n), s = t.getY(n), i = t.getZ(n);
|
|
300
307
|
e.push(
|
|
301
|
-
`(${o.toPrecision(
|
|
302
|
-
|
|
303
|
-
)}, ${i.toPrecision(
|
|
308
|
+
`(${o.toPrecision(u)}, ${s.toPrecision(
|
|
309
|
+
u
|
|
310
|
+
)}, ${i.toPrecision(u)})`
|
|
304
311
|
);
|
|
305
312
|
}
|
|
306
313
|
return e.join(", ");
|
|
307
314
|
}
|
|
308
|
-
function
|
|
309
|
-
const
|
|
315
|
+
function G(t) {
|
|
316
|
+
const r = [];
|
|
310
317
|
for (let e = 0; e < t.count; e++) {
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
`(${
|
|
318
|
+
const n = t.getX(e), o = t.getY(e);
|
|
319
|
+
r.push(
|
|
320
|
+
`(${n.toPrecision(u)}, ${1 - o.toPrecision(u)})`
|
|
314
321
|
);
|
|
315
322
|
}
|
|
316
|
-
return
|
|
323
|
+
return r.join(", ");
|
|
317
324
|
}
|
|
318
|
-
function
|
|
319
|
-
const
|
|
325
|
+
function X(t, r, e = !1) {
|
|
326
|
+
const n = new $("Materials");
|
|
320
327
|
for (const o in t) {
|
|
321
328
|
const s = t[o];
|
|
322
|
-
|
|
323
|
-
|
|
329
|
+
n.addChild(
|
|
330
|
+
j(s, r, e)
|
|
324
331
|
);
|
|
325
332
|
}
|
|
326
|
-
return
|
|
333
|
+
return n;
|
|
327
334
|
}
|
|
328
|
-
function
|
|
329
|
-
const
|
|
330
|
-
function o(i,
|
|
335
|
+
function j(t, r, e = !1) {
|
|
336
|
+
const n = new $(`Material_${t.id}`, "Material");
|
|
337
|
+
function o(i, a, d) {
|
|
331
338
|
const l = i.source.id + "_" + i.flipY;
|
|
332
|
-
|
|
333
|
-
const c = i.channel > 0 ? "st" + i.channel : "st",
|
|
339
|
+
r[l] = i;
|
|
340
|
+
const c = i.channel > 0 ? "st" + i.channel : "st", y = {
|
|
334
341
|
1e3: "repeat",
|
|
335
342
|
// RepeatWrapping
|
|
336
343
|
1001: "clamp",
|
|
337
344
|
// ClampToEdgeWrapping
|
|
338
345
|
1002: "mirror"
|
|
339
346
|
// MirroredRepeatWrapping
|
|
340
|
-
},
|
|
341
|
-
|
|
342
|
-
const m = new $(`PrimvarReader_${
|
|
347
|
+
}, f = i.repeat.clone(), p = i.offset.clone(), g = i.rotation, M = Math.sin(g), x = Math.cos(g);
|
|
348
|
+
p.y = 1 - p.y - f.y, e ? (p.x = p.x / f.x, p.y = p.y / f.y, p.x += M / f.x, p.y += x - 1) : (p.x += M * f.x, p.y += (1 - x) * f.y);
|
|
349
|
+
const m = new $(`PrimvarReader_${a}`, "Shader");
|
|
343
350
|
m.addProperty(
|
|
344
351
|
'uniform token info:id = "UsdPrimvarReader_float2"'
|
|
345
352
|
), m.addProperty("float2 inputs:fallback = (0.0, 0.0)"), m.addProperty(`string inputs:varname = "${c}"`), m.addProperty("float2 outputs:result");
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
`float2 inputs:in.connect = </Materials/Material_${t.id}/PrimvarReader_${
|
|
349
|
-
),
|
|
350
|
-
`float inputs:rotation = ${(
|
|
351
|
-
|
|
353
|
+
const P = new $(`Transform2d_${a}`, "Shader");
|
|
354
|
+
P.addProperty('uniform token info:id = "UsdTransform2d"'), P.addProperty(
|
|
355
|
+
`float2 inputs:in.connect = </Materials/Material_${t.id}/PrimvarReader_${a}.outputs:result>`
|
|
356
|
+
), P.addProperty(
|
|
357
|
+
`float inputs:rotation = ${(g * (180 / Math.PI)).toFixed(
|
|
358
|
+
u
|
|
352
359
|
)}`
|
|
353
|
-
),
|
|
354
|
-
`float2 inputs:scale = ${
|
|
355
|
-
),
|
|
356
|
-
`float2 inputs:translation = ${
|
|
357
|
-
),
|
|
358
|
-
const
|
|
359
|
-
`Texture_${i.id}_${
|
|
360
|
+
), P.addProperty(
|
|
361
|
+
`float2 inputs:scale = ${S(f)}`
|
|
362
|
+
), P.addProperty(
|
|
363
|
+
`float2 inputs:translation = ${S(p)}`
|
|
364
|
+
), P.addProperty("float2 outputs:result");
|
|
365
|
+
const h = new $(
|
|
366
|
+
`Texture_${i.id}_${a}`,
|
|
360
367
|
"Shader"
|
|
361
368
|
);
|
|
362
|
-
return
|
|
363
|
-
`float2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${
|
|
364
|
-
),
|
|
369
|
+
return h.addProperty('uniform token info:id = "UsdUVTexture"'), h.addProperty(`asset inputs:file = @textures/Texture_${l}.png@`), h.addProperty(
|
|
370
|
+
`float2 inputs:st.connect = </Materials/Material_${t.id}/Transform2d_${a}.outputs:result>`
|
|
371
|
+
), d !== void 0 && h.addProperty(`float4 inputs:scale = ${B(d)}`), a === "normal" && (h.addProperty("float4 inputs:scale = (2, 2, 2, 1)"), h.addProperty("float4 inputs:bias = (-1, -1, -1, 0)")), h.addProperty(
|
|
365
372
|
`token inputs:sourceColorSpace = "${i.colorSpace === D ? "raw" : "sRGB"}"`
|
|
366
|
-
),
|
|
367
|
-
`token inputs:wrapS = "${
|
|
368
|
-
),
|
|
369
|
-
`token inputs:wrapT = "${
|
|
370
|
-
),
|
|
373
|
+
), h.addProperty(
|
|
374
|
+
`token inputs:wrapS = "${y[i.wrapS]}"`
|
|
375
|
+
), h.addProperty(
|
|
376
|
+
`token inputs:wrapT = "${y[i.wrapT]}"`
|
|
377
|
+
), h.addProperty("float outputs:r"), h.addProperty("float outputs:g"), h.addProperty("float outputs:b"), h.addProperty("float3 outputs:rgb"), (t.transparent || t.alphaTest > 0) && h.addProperty("float outputs:a"), [m, P, h];
|
|
371
378
|
}
|
|
372
|
-
t.side ===
|
|
379
|
+
t.side === A && console.warn(
|
|
373
380
|
"THREE.USDZExporter: USDZ does not support double sided materials",
|
|
374
381
|
t
|
|
375
382
|
);
|
|
@@ -386,13 +393,13 @@ function X(t, n, e = !1) {
|
|
|
386
393
|
t.map,
|
|
387
394
|
"diffuse",
|
|
388
395
|
t.color
|
|
389
|
-
).forEach((
|
|
390
|
-
`color3f inputs:diffuseColor = ${
|
|
396
|
+
).forEach((a) => n.addChild(a))) : s.addProperty(
|
|
397
|
+
`color3f inputs:diffuseColor = ${w(t.color)}`
|
|
391
398
|
), t.emissiveMap !== null) {
|
|
392
399
|
s.addProperty(
|
|
393
400
|
`color3f inputs:emissiveColor.connect = </Materials/Material_${t.id}/Texture_${t.emissiveMap.id}_emissive.outputs:rgb>`
|
|
394
401
|
);
|
|
395
|
-
const i = new
|
|
402
|
+
const i = new v(
|
|
396
403
|
t.emissive.r * t.emissiveIntensity,
|
|
397
404
|
t.emissive.g * t.emissiveIntensity,
|
|
398
405
|
t.emissive.b * t.emissiveIntensity
|
|
@@ -401,17 +408,17 @@ function X(t, n, e = !1) {
|
|
|
401
408
|
t.emissiveMap,
|
|
402
409
|
"emissive",
|
|
403
410
|
i
|
|
404
|
-
).forEach((
|
|
411
|
+
).forEach((d) => n.addChild(d));
|
|
405
412
|
} else t.emissive.getHex() > 0 && s.addProperty(
|
|
406
|
-
`color3f inputs:emissiveColor = ${
|
|
413
|
+
`color3f inputs:emissiveColor = ${w(t.emissive)}`
|
|
407
414
|
);
|
|
408
415
|
if (t.normalMap !== null && (s.addProperty(
|
|
409
416
|
`normal3f inputs:normal.connect = </Materials/Material_${t.id}/Texture_${t.normalMap.id}_normal.outputs:rgb>`
|
|
410
|
-
), o(t.normalMap, "normal").forEach((
|
|
417
|
+
), o(t.normalMap, "normal").forEach((a) => n.addChild(a))), t.aoMap !== null) {
|
|
411
418
|
s.addProperty(
|
|
412
419
|
`float inputs:occlusion.connect = </Materials/Material_${t.id}/Texture_${t.aoMap.id}_occlusion.outputs:r>`
|
|
413
420
|
);
|
|
414
|
-
const i = new
|
|
421
|
+
const i = new v(
|
|
415
422
|
t.aoMapIntensity,
|
|
416
423
|
t.aoMapIntensity,
|
|
417
424
|
t.aoMapIntensity
|
|
@@ -420,13 +427,13 @@ function X(t, n, e = !1) {
|
|
|
420
427
|
t.aoMap,
|
|
421
428
|
"occlusion",
|
|
422
429
|
i
|
|
423
|
-
).forEach((
|
|
430
|
+
).forEach((d) => n.addChild(d));
|
|
424
431
|
}
|
|
425
432
|
if (t.roughnessMap !== null) {
|
|
426
433
|
s.addProperty(
|
|
427
434
|
`float inputs:roughness.connect = </Materials/Material_${t.id}/Texture_${t.roughnessMap.id}_roughness.outputs:g>`
|
|
428
435
|
);
|
|
429
|
-
const i = new
|
|
436
|
+
const i = new v(
|
|
430
437
|
t.roughness,
|
|
431
438
|
t.roughness,
|
|
432
439
|
t.roughness
|
|
@@ -435,7 +442,7 @@ function X(t, n, e = !1) {
|
|
|
435
442
|
t.roughnessMap,
|
|
436
443
|
"roughness",
|
|
437
444
|
i
|
|
438
|
-
).forEach((
|
|
445
|
+
).forEach((d) => n.addChild(d));
|
|
439
446
|
} else
|
|
440
447
|
s.addProperty(
|
|
441
448
|
`float inputs:roughness = ${t.roughness}`
|
|
@@ -444,7 +451,7 @@ function X(t, n, e = !1) {
|
|
|
444
451
|
s.addProperty(
|
|
445
452
|
`float inputs:metallic.connect = </Materials/Material_${t.id}/Texture_${t.metalnessMap.id}_metallic.outputs:b>`
|
|
446
453
|
);
|
|
447
|
-
const i = new
|
|
454
|
+
const i = new v(
|
|
448
455
|
t.metalness,
|
|
449
456
|
t.metalness,
|
|
450
457
|
t.metalness
|
|
@@ -453,21 +460,21 @@ function X(t, n, e = !1) {
|
|
|
453
460
|
t.metalnessMap,
|
|
454
461
|
"metallic",
|
|
455
462
|
i
|
|
456
|
-
).forEach((
|
|
463
|
+
).forEach((d) => n.addChild(d));
|
|
457
464
|
} else
|
|
458
465
|
s.addProperty(
|
|
459
466
|
`float inputs:metallic = ${t.metalness}`
|
|
460
467
|
);
|
|
461
468
|
if (t.alphaMap !== null ? (s.addProperty(
|
|
462
469
|
`float inputs:opacity.connect = </Materials/Material_${t.id}/Texture_${t.alphaMap.id}_opacity.outputs:r>`
|
|
463
|
-
), s.addProperty("float inputs:opacityThreshold = 0.0001"), o(t.alphaMap, "opacity").forEach((
|
|
470
|
+
), s.addProperty("float inputs:opacityThreshold = 0.0001"), o(t.alphaMap, "opacity").forEach((a) => n.addChild(a))) : s.addProperty(
|
|
464
471
|
`float inputs:opacity = ${t.opacity}`
|
|
465
472
|
), t.isMeshPhysicalMaterial) {
|
|
466
473
|
if (t.clearcoatMap !== null) {
|
|
467
474
|
s.addProperty(
|
|
468
475
|
`float inputs:clearcoat.connect = </Materials/Material_${t.id}/Texture_${t.clearcoatMap.id}_clearcoat.outputs:r>`
|
|
469
476
|
);
|
|
470
|
-
const i = new
|
|
477
|
+
const i = new v(
|
|
471
478
|
t.clearcoat,
|
|
472
479
|
t.clearcoat,
|
|
473
480
|
t.clearcoat
|
|
@@ -476,7 +483,7 @@ function X(t, n, e = !1) {
|
|
|
476
483
|
t.clearcoatMap,
|
|
477
484
|
"clearcoat",
|
|
478
485
|
i
|
|
479
|
-
).forEach((
|
|
486
|
+
).forEach((d) => n.addChild(d));
|
|
480
487
|
} else
|
|
481
488
|
s.addProperty(
|
|
482
489
|
`float inputs:clearcoat = ${t.clearcoat}`
|
|
@@ -485,7 +492,7 @@ function X(t, n, e = !1) {
|
|
|
485
492
|
s.addProperty(
|
|
486
493
|
`float inputs:clearcoatRoughness.connect = </Materials/Material_${t.id}/Texture_${t.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`
|
|
487
494
|
);
|
|
488
|
-
const i = new
|
|
495
|
+
const i = new v(
|
|
489
496
|
t.clearcoatRoughness,
|
|
490
497
|
t.clearcoatRoughness,
|
|
491
498
|
t.clearcoatRoughness
|
|
@@ -494,52 +501,52 @@ function X(t, n, e = !1) {
|
|
|
494
501
|
t.clearcoatRoughnessMap,
|
|
495
502
|
"clearcoatRoughness",
|
|
496
503
|
i
|
|
497
|
-
).forEach((
|
|
504
|
+
).forEach((d) => n.addChild(d));
|
|
498
505
|
} else
|
|
499
506
|
s.addProperty(
|
|
500
507
|
`float inputs:clearcoatRoughness = ${t.clearcoatRoughness}`
|
|
501
508
|
);
|
|
502
509
|
s.addProperty(`float inputs:ior = ${t.ior}`);
|
|
503
510
|
}
|
|
504
|
-
return s.addProperty("int inputs:useSpecularWorkflow = 0"), s.addProperty("token outputs:surface"),
|
|
511
|
+
return s.addProperty("int inputs:useSpecularWorkflow = 0"), s.addProperty("token outputs:surface"), n.addChild(s), n.addProperty(
|
|
505
512
|
`token outputs:surface.connect = </Materials/Material_${t.id}/PreviewSurface.outputs:surface>`
|
|
506
|
-
),
|
|
513
|
+
), n;
|
|
507
514
|
}
|
|
508
|
-
function
|
|
515
|
+
function w(t) {
|
|
509
516
|
return `(${t.r}, ${t.g}, ${t.b})`;
|
|
510
517
|
}
|
|
511
518
|
function B(t) {
|
|
512
519
|
return `(${t.r}, ${t.g}, ${t.b}, 1.0)`;
|
|
513
520
|
}
|
|
514
|
-
function
|
|
521
|
+
function S(t) {
|
|
515
522
|
return `(${t.x}, ${t.y})`;
|
|
516
523
|
}
|
|
517
|
-
function F(t,
|
|
518
|
-
const e = N(t,
|
|
524
|
+
function F(t, r) {
|
|
525
|
+
const e = N(t, r), n = O(t.matrix);
|
|
519
526
|
t.matrix.determinant() < 0 && console.warn(
|
|
520
527
|
"THREE.USDZExporter: USDZ does not support negative scales",
|
|
521
528
|
t
|
|
522
529
|
);
|
|
523
530
|
const o = new $(e, "Camera");
|
|
524
|
-
o.addProperty(`matrix4d xformOp:transform = ${
|
|
531
|
+
o.addProperty(`matrix4d xformOp:transform = ${n}`), o.addProperty('uniform token[] xformOpOrder = ["xformOp:transform"]');
|
|
525
532
|
const s = t.isOrthographicCamera ? "orthographic" : "perspective";
|
|
526
533
|
o.addProperty(`token projection = "${s}"`);
|
|
527
534
|
const i = `(${t.near.toPrecision(
|
|
528
|
-
|
|
529
|
-
)}, ${t.far.toPrecision(
|
|
535
|
+
u
|
|
536
|
+
)}, ${t.far.toPrecision(u)})`;
|
|
530
537
|
o.addProperty(`float2 clippingRange = ${i}`);
|
|
531
|
-
let d;
|
|
532
|
-
t.isOrthographicCamera ? d = ((Math.abs(t.left) + Math.abs(t.right)) * 10).toPrecision(y) : d = t.getFilmWidth().toPrecision(y), o.addProperty(`float horizontalAperture = ${d}`);
|
|
533
538
|
let a;
|
|
534
|
-
|
|
535
|
-
|
|
539
|
+
t.isOrthographicCamera ? a = ((Math.abs(t.left) + Math.abs(t.right)) * 10).toPrecision(u) : a = t.getFilmWidth().toPrecision(u), o.addProperty(`float horizontalAperture = ${a}`);
|
|
540
|
+
let d;
|
|
541
|
+
if (t.isOrthographicCamera ? d = ((Math.abs(t.top) + Math.abs(t.bottom)) * 10).toPrecision(u) : d = t.getFilmHeight().toPrecision(u), o.addProperty(`float verticalAperture = ${d}`), t.isPerspectiveCamera) {
|
|
542
|
+
const l = t.getFocalLength().toPrecision(u);
|
|
536
543
|
o.addProperty(`float focalLength = ${l}`);
|
|
537
|
-
const c = t.focus.toPrecision(
|
|
544
|
+
const c = t.focus.toPrecision(u);
|
|
538
545
|
o.addProperty(`float focusDistance = ${c}`);
|
|
539
546
|
}
|
|
540
547
|
return o;
|
|
541
548
|
}
|
|
542
549
|
export {
|
|
543
|
-
|
|
550
|
+
Y as USDZExporter
|
|
544
551
|
};
|
|
545
|
-
//# sourceMappingURL=USDZExporter-
|
|
552
|
+
//# sourceMappingURL=USDZExporter-CUp3dX08.mjs.map
|