@figurosity/consumer-three-dimension-tool 0.5.0 → 0.8.1
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/consumer-three-dimension-tool.js +1503 -1253
- package/package.json +1 -1
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { watch as
|
|
3
|
-
import {
|
|
4
|
-
import { CBaseButton as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import { SKINS as
|
|
9
|
-
import { OrbitControls as Ss } from "three/examples/jsm/controls/OrbitControls.js";
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}:has(>.frozen-overlay){position:relative}.frozen-overlay{position:absolute;z-index:10;top:0;left:0;bottom:0;right:0}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid #333}.debug-color .label{font-weight:700}.debug-value span{margin-top:2px;min-width:60px;font-size:11px}.debug-vector{min-width:130px}.debug-vector>div{font-size:10px}.debug-vector>div>span{min-width:20px;font-weight:700}.debug-boolean .indicator{margin-top:6px;margin-right:4px;height:10px;width:10px;border-radius:10px;border:1px solid #333;display:inline-block;background:red}.debug-boolean .indicator.on{background:#adff2f}.debug3D{position:absolute;z-index:14400;top:20px;left:40px;padding:20px;border:1px solid #ccc;border-radius:10px;background-color:#ffffffb3}.debug3D .color-square{display:inline-block;height:15px;width:15px;margin-bottom:-3px;border:1px dotted black}.three-dimension-tool{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100}.three-dimension-tool .tres{width:100%;height:100vh}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { watch as G, ref as he, nextTick as cs, onUnmounted as Ut, computed as C, onMounted as $t, openBlock as at, createElementBlock as us, createCommentVNode as wt, createElementVNode as ds, onBeforeMount as ps, defineComponent as V, h as d, withDirectives as ms, vShow as fs, inject as Ze, useModel as hs, onBeforeUnmount as gs, createBlock as vt, unref as bt, withCtx as yt, createVNode as vs, mergeModels as bs } from "vue";
|
|
3
|
+
import { Platform as Ct, useQuasar as ys, QBtn as qt, QSeparator as ye } from "quasar";
|
|
4
|
+
import { CBaseButton as ie, CColorPickerPopup as Ss, CExpansion as Ve, CToggle as Ht, CSlider as We, CBaseButtons as Jt, CDraggableDrawer as Te, CDraggableDrawers as xs, CToolPage as ws } from "@figurosity/consumer-controls";
|
|
5
|
+
import { defineStore as Ye, storeToRefs as O, getActivePinia as Cs } from "pinia";
|
|
6
|
+
import * as k from "three";
|
|
7
|
+
import Qe from "lodash.isequal";
|
|
8
|
+
import { DEFAULT as lt, SKINS as ee, COLORS as ne, GRID as Ce, LIGHTS as fe, RELATED as Ee, getConfig as Es, useDynamicImages as ks } from "@figurosity/toolbox";
|
|
10
9
|
import "three/examples/jsm/loaders/RGBELoader.js";
|
|
11
|
-
import { RoomEnvironment as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
import { RoomEnvironment as Is } from "three/examples/jsm/environments/RoomEnvironment.js";
|
|
11
|
+
import { OrbitControls as Ts } from "three/examples/jsm/controls/OrbitControls.js";
|
|
12
|
+
import { mergeVertices as Rt, mergeGeometries as Ds } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
13
|
+
import { RoundedBoxGeometry as Ms } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
|
|
14
|
+
import { GLTFLoader as Bs } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
15
|
+
import { DRACOLoader as As } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
16
|
+
const zs = "tool:switched", Ps = "pose:viewed", Ls = "skin:changed", St = new k.Vector3(), Vt = (e) => {
|
|
17
|
+
const t = new k.Box3().setFromObject(e);
|
|
18
18
|
console.log("box", t);
|
|
19
|
-
const s = t.getSize(new
|
|
19
|
+
const s = t.getSize(new k.Vector3()), o = new k.Vector3(
|
|
20
20
|
(t.min.x + t.max.x) / 2,
|
|
21
21
|
(t.min.y + t.max.y) / 2,
|
|
22
22
|
(t.min.z + t.max.z) / 2
|
|
23
23
|
);
|
|
24
|
-
console.log("center",
|
|
25
|
-
let
|
|
26
|
-
return console.log("bottom",
|
|
24
|
+
console.log("center", o);
|
|
25
|
+
let n = t.min.y;
|
|
26
|
+
return console.log("bottom", n), Math.abs(n) < -0.01 && (n = Rs(e)), console.log("bottom", n), {
|
|
27
27
|
box: t,
|
|
28
28
|
size: s,
|
|
29
|
-
center:
|
|
30
|
-
bottom:
|
|
29
|
+
center: o,
|
|
30
|
+
bottom: n,
|
|
31
31
|
top: t.max.y
|
|
32
32
|
};
|
|
33
|
-
},
|
|
33
|
+
}, Rs = (e) => {
|
|
34
34
|
let t = 1 / 0;
|
|
35
35
|
return e.updateMatrixWorld(!0), e.traverse((s) => {
|
|
36
|
-
var
|
|
36
|
+
var n, i;
|
|
37
37
|
if (!s.isMesh) return;
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
for (let
|
|
41
|
-
|
|
38
|
+
const o = (i = (n = s.geometry) == null ? void 0 : n.attributes) == null ? void 0 : i.position;
|
|
39
|
+
if (o)
|
|
40
|
+
for (let r = 0; r < o.count; r++)
|
|
41
|
+
St.fromBufferAttribute(o, r), St.applyMatrix4(s.matrixWorld), t = Math.min(t, St.y);
|
|
42
42
|
}), t;
|
|
43
|
-
},
|
|
43
|
+
}, Kt = (e) => ({
|
|
44
44
|
box: {
|
|
45
45
|
min: {
|
|
46
46
|
x: e.box.min.x,
|
|
@@ -65,7 +65,7 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
|
|
|
65
65
|
},
|
|
66
66
|
bottom: e.bottom,
|
|
67
67
|
top: e.top
|
|
68
|
-
}),
|
|
68
|
+
}), Wt = "smooth", Vs = (e) => ({
|
|
69
69
|
id: e.id,
|
|
70
70
|
uuid: e.uuid ?? null,
|
|
71
71
|
basePoseId: e.basePoseId ?? null,
|
|
@@ -77,21 +77,21 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
|
|
|
77
77
|
poseId: e.poseId ?? null,
|
|
78
78
|
url: e.glbPathWebp || e.glbPath || null,
|
|
79
79
|
bounds: e.bounds ?? null
|
|
80
|
-
}),
|
|
80
|
+
}), ae = Ye("3d-glbs", {
|
|
81
81
|
state: () => ({
|
|
82
82
|
models: {}
|
|
83
83
|
}),
|
|
84
84
|
getters: {
|
|
85
85
|
selectedId() {
|
|
86
|
-
return
|
|
86
|
+
return T().selected;
|
|
87
87
|
},
|
|
88
88
|
poseId(e) {
|
|
89
|
-
var s,
|
|
90
|
-
const t =
|
|
91
|
-
return (
|
|
89
|
+
var s, o;
|
|
90
|
+
const t = T().selected;
|
|
91
|
+
return (o = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : o.poseId;
|
|
92
92
|
},
|
|
93
93
|
model(e) {
|
|
94
|
-
const t =
|
|
94
|
+
const t = T().selected;
|
|
95
95
|
return t && e.models[t] ? e.models[t] : null;
|
|
96
96
|
},
|
|
97
97
|
url() {
|
|
@@ -105,145 +105,175 @@ const Ms = "tool:switched", Ds = "pose:viewed", Ts = "skin:changed", gt = new I.
|
|
|
105
105
|
},
|
|
106
106
|
actions: {
|
|
107
107
|
setBounds(e) {
|
|
108
|
-
const t =
|
|
109
|
-
this.models[t] && (this.models[t].bounds =
|
|
108
|
+
const t = T().selected;
|
|
109
|
+
this.models[t] && (this.models[t].bounds = Kt(e));
|
|
110
110
|
},
|
|
111
111
|
setSubjectsFromResponse(e) {
|
|
112
|
-
var
|
|
113
|
-
const t = ((
|
|
114
|
-
return Object.keys(t).forEach((
|
|
115
|
-
s[
|
|
112
|
+
var o;
|
|
113
|
+
const t = ((o = e == null ? void 0 : e.entities) == null ? void 0 : o.glb) || {}, s = {};
|
|
114
|
+
return Object.keys(t).forEach((n) => {
|
|
115
|
+
s[n] = Vs(t[n]);
|
|
116
116
|
}), this.models = { ...this.models, ...s }, this.selectDefaultGlbId(e);
|
|
117
117
|
},
|
|
118
118
|
// Picks the GLB id whose skin slug matches DEFAULT_SKIN_SLUG, falls
|
|
119
119
|
// back to result.glb[0], or null when no GLBs are available.
|
|
120
120
|
selectDefaultGlbId(e) {
|
|
121
|
-
var
|
|
122
|
-
const t = Array.isArray((
|
|
121
|
+
var r, c, a;
|
|
122
|
+
const t = Array.isArray((r = e == null ? void 0 : e.result) == null ? void 0 : r.glb) ? e.result.glb : [];
|
|
123
123
|
if (t.length === 0) return null;
|
|
124
|
-
const s = ((
|
|
125
|
-
var
|
|
126
|
-
const p = (
|
|
127
|
-
return p != null && ((w = s[p]) == null ? void 0 : w.slug) ===
|
|
124
|
+
const s = ((c = e == null ? void 0 : e.entities) == null ? void 0 : c.skins) || {}, o = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.glb) || {}, i = t.find((u) => {
|
|
125
|
+
var P, w;
|
|
126
|
+
const p = (P = o[u]) == null ? void 0 : P.skinId;
|
|
127
|
+
return p != null && ((w = s[p]) == null ? void 0 : w.slug) === Wt;
|
|
128
128
|
}) ?? t[0];
|
|
129
|
-
return typeof
|
|
129
|
+
return typeof i == "string" ? parseInt(i, 10) : i;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
function
|
|
133
|
+
function et(e) {
|
|
134
134
|
const t = e.startsWith("#") ? e.slice(1) : e;
|
|
135
135
|
return parseInt(t, 16);
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function me(e) {
|
|
138
138
|
return `#${e.toString(16).padStart(6, "0")}`;
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const tt = ({
|
|
141
141
|
storeId: e,
|
|
142
142
|
defaultValues: t = {},
|
|
143
143
|
state: s = {},
|
|
144
|
-
getters:
|
|
145
|
-
actions:
|
|
146
|
-
keyBy:
|
|
147
|
-
}) =>
|
|
144
|
+
getters: o = {},
|
|
145
|
+
actions: n = {},
|
|
146
|
+
keyBy: i = "selected"
|
|
147
|
+
}) => Ye(e, {
|
|
148
148
|
state: () => ({
|
|
149
149
|
loading: !1,
|
|
150
150
|
models: {},
|
|
151
|
+
// Bumped by `restore()` so callers outside the lib (the
|
|
152
|
+
// consumer-app's `useViewerUrlSync` ?v= apply path) can trigger
|
|
153
|
+
// a re-apply into three.js. Stores whose state already flows
|
|
154
|
+
// through reactive watchers (grid/scene/ground) ignore this; the
|
|
155
|
+
// ones that don't (controls, lights orbit) use it as the only
|
|
156
|
+
// signal that the host did a `restore()` and the three.js camera
|
|
157
|
+
// needs to be re-driven from the store. See ThreeDimensionTool
|
|
158
|
+
// for the watcher and the rationale.
|
|
159
|
+
applyRevision: 0,
|
|
151
160
|
...s
|
|
152
161
|
}),
|
|
153
162
|
getters: {
|
|
154
163
|
keyId() {
|
|
155
|
-
return
|
|
164
|
+
return T()[i];
|
|
156
165
|
},
|
|
157
|
-
model(
|
|
158
|
-
return
|
|
166
|
+
model(r) {
|
|
167
|
+
return r.models[T()[i]];
|
|
159
168
|
},
|
|
160
|
-
exists(
|
|
161
|
-
return typeof
|
|
169
|
+
exists(r) {
|
|
170
|
+
return typeof r.models[T()[i]] < "u";
|
|
162
171
|
},
|
|
163
|
-
selectedModel(
|
|
164
|
-
return
|
|
172
|
+
selectedModel(r) {
|
|
173
|
+
return r.models[T()[i]] ?? null;
|
|
165
174
|
},
|
|
166
175
|
mergedModel() {
|
|
167
176
|
return { ...t, ...this.selectedModel ?? {} };
|
|
168
177
|
},
|
|
169
|
-
propertyById(
|
|
170
|
-
return (
|
|
178
|
+
propertyById(r) {
|
|
179
|
+
return (c, a, u = null) => r.models[c] && a in r.models[c] ? r.models[c][a] : u;
|
|
171
180
|
},
|
|
172
181
|
propertyChangedById() {
|
|
173
|
-
return (
|
|
182
|
+
return (r, c) => this.propertyById(r, c) !== t[c];
|
|
174
183
|
},
|
|
175
|
-
propertyChanged(
|
|
176
|
-
const
|
|
177
|
-
return (a) =>
|
|
184
|
+
propertyChanged(r) {
|
|
185
|
+
const c = T()[i];
|
|
186
|
+
return (a) => r.models[c] ? this.propertyById(c, a) !== t[a] : !1;
|
|
178
187
|
},
|
|
179
188
|
property() {
|
|
180
|
-
const
|
|
181
|
-
return (
|
|
189
|
+
const r = T()[i];
|
|
190
|
+
return (c, a = t[c]) => this.propertyById(r, c, a);
|
|
182
191
|
},
|
|
183
|
-
...
|
|
192
|
+
...o
|
|
184
193
|
},
|
|
185
194
|
actions: {
|
|
186
|
-
initModel(
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
initModel(r) {
|
|
196
|
+
r != null && (typeof this.models[r] < "u" || this.$patch((c) => {
|
|
197
|
+
c.models[r] = { ...t };
|
|
189
198
|
}));
|
|
190
199
|
},
|
|
191
200
|
ensureSelectedModel() {
|
|
192
|
-
const
|
|
193
|
-
return
|
|
201
|
+
const r = T()[i];
|
|
202
|
+
return r == null ? null : (this.models[r] || (this.models[r] = { ...t }), this.models[r]);
|
|
194
203
|
},
|
|
195
|
-
setPropertyById(
|
|
196
|
-
|
|
204
|
+
setPropertyById(r, c, a) {
|
|
205
|
+
r != null && (this.models[r] || this.initModel(r), this.$patch({
|
|
197
206
|
models: {
|
|
198
|
-
[
|
|
207
|
+
[r]: { ...this.models[r], [c]: a }
|
|
199
208
|
}
|
|
200
209
|
}));
|
|
201
210
|
},
|
|
202
|
-
setProperty(
|
|
203
|
-
const a =
|
|
211
|
+
setProperty(r, c) {
|
|
212
|
+
const a = T()[i];
|
|
204
213
|
a != null && (this.models[a] || this.initModel(a), this.$patch({
|
|
205
214
|
models: {
|
|
206
|
-
[a]: { ...this.models[a], [
|
|
215
|
+
[a]: { ...this.models[a], [r]: c }
|
|
207
216
|
}
|
|
208
217
|
}));
|
|
209
218
|
},
|
|
210
|
-
patchSelected(
|
|
211
|
-
const
|
|
212
|
-
|
|
219
|
+
patchSelected(r) {
|
|
220
|
+
const c = this.ensureSelectedModel();
|
|
221
|
+
c && Object.assign(c, r);
|
|
213
222
|
},
|
|
214
223
|
reset() {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
const r = T()[i];
|
|
225
|
+
r != null && this.$patch((c) => {
|
|
226
|
+
c.models[r] = { ...t };
|
|
218
227
|
});
|
|
219
228
|
},
|
|
220
|
-
resetProperty(
|
|
221
|
-
const
|
|
222
|
-
|
|
229
|
+
resetProperty(r) {
|
|
230
|
+
const c = T()[i];
|
|
231
|
+
c != null && this.models[c] && this.$patch({
|
|
223
232
|
models: {
|
|
224
|
-
[
|
|
225
|
-
...this.models[
|
|
226
|
-
[
|
|
233
|
+
[c]: {
|
|
234
|
+
...this.models[c],
|
|
235
|
+
[r]: t[r]
|
|
227
236
|
}
|
|
228
237
|
}
|
|
229
238
|
});
|
|
230
239
|
},
|
|
231
|
-
|
|
240
|
+
// Capture the active model's tunable state as a plain object. Used
|
|
241
|
+
// by the save+freeze flow (consumer-app `composeViewState`) and the
|
|
242
|
+
// URL `?v=` writer in `useViewerUrlSync` to encode the current view.
|
|
243
|
+
// Returns null when there's no active bucket so the caller can omit
|
|
244
|
+
// the slot from the payload rather than encode a stale snapshot.
|
|
245
|
+
snapshot() {
|
|
246
|
+
const r = T()[i];
|
|
247
|
+
return r == null || !this.models[r] ? null : JSON.parse(JSON.stringify(this.models[r]));
|
|
248
|
+
},
|
|
249
|
+
// Apply a snapshot from the save+freeze payload back onto the
|
|
250
|
+
// active bucket. Missing keys fall through to defaultValues; the
|
|
251
|
+
// caller passes the same shape `snapshot()` produced.
|
|
252
|
+
restore(r) {
|
|
253
|
+
if (r == null || typeof r != "object") return;
|
|
254
|
+
const c = T()[i];
|
|
255
|
+
if (c == null) return;
|
|
256
|
+
const a = JSON.parse(JSON.stringify(r));
|
|
257
|
+
this.$patch((u) => {
|
|
258
|
+
u.models[c] = { ...t, ...a }, u.framed && (u.framed[c] = !0), u.applyRevision = (u.applyRevision || 0) + 1;
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
...n
|
|
232
262
|
}
|
|
233
|
-
}),
|
|
263
|
+
}), Xt = {
|
|
234
264
|
visible: !0,
|
|
235
265
|
opacity: 1,
|
|
236
266
|
color: 16711422,
|
|
237
267
|
texture: "none"
|
|
238
|
-
},
|
|
268
|
+
}, Fs = {
|
|
239
269
|
changed() {
|
|
240
|
-
return this.exists ? !
|
|
270
|
+
return this.exists ? !Qe(this.mergedModel, Xt) : !1;
|
|
241
271
|
},
|
|
242
272
|
color() {
|
|
243
273
|
return this.property("color");
|
|
244
274
|
},
|
|
245
275
|
colorHex() {
|
|
246
|
-
return
|
|
276
|
+
return me(this.property("color"));
|
|
247
277
|
},
|
|
248
278
|
opacity() {
|
|
249
279
|
return this.property("opacity");
|
|
@@ -254,7 +284,7 @@ const Qe = ({
|
|
|
254
284
|
visible() {
|
|
255
285
|
return this.property("visible");
|
|
256
286
|
}
|
|
257
|
-
},
|
|
287
|
+
}, _s = {
|
|
258
288
|
init() {
|
|
259
289
|
this.initModel(this.keyId);
|
|
260
290
|
},
|
|
@@ -262,7 +292,7 @@ const Qe = ({
|
|
|
262
292
|
this.setProperty("color", e);
|
|
263
293
|
},
|
|
264
294
|
setColorHex(e) {
|
|
265
|
-
this.setProperty("color",
|
|
295
|
+
this.setProperty("color", et(e));
|
|
266
296
|
},
|
|
267
297
|
setTexture(e) {
|
|
268
298
|
this.setProperty("texture", e);
|
|
@@ -270,33 +300,33 @@ const Qe = ({
|
|
|
270
300
|
setVisible(e) {
|
|
271
301
|
this.setProperty("visible", e);
|
|
272
302
|
}
|
|
273
|
-
},
|
|
303
|
+
}, Fe = tt({
|
|
274
304
|
storeId: "3d-ground",
|
|
275
|
-
defaultValues:
|
|
305
|
+
defaultValues: Xt,
|
|
276
306
|
state: { offset: -0.75 },
|
|
277
|
-
getters:
|
|
278
|
-
actions:
|
|
307
|
+
getters: Fs,
|
|
308
|
+
actions: _s,
|
|
279
309
|
keyBy: "basePoseId"
|
|
280
|
-
}),
|
|
310
|
+
}), js = {
|
|
281
311
|
color: 16777215,
|
|
282
312
|
visible: !0,
|
|
283
313
|
debug: !1,
|
|
284
314
|
shadow: !0,
|
|
285
315
|
visualization: !0
|
|
286
|
-
},
|
|
316
|
+
}, Pe = 0, oe = 1, Et = 1.25, kt = 3, ot = (e, t, s) => Math.max(t, Math.min(s, e)), Gs = 1.25, Le = (e = {}) => ({ ...js, ...e }), ze = {
|
|
287
317
|
advanced: !1,
|
|
288
318
|
move: !1,
|
|
289
319
|
position: { x: 0, y: 0, z: 1.5 },
|
|
290
320
|
quaternion: { x: 0, y: 0, z: 0, w: 1 },
|
|
291
321
|
target: { x: 0, y: 0, z: 0 }
|
|
292
|
-
},
|
|
293
|
-
ambientScale:
|
|
294
|
-
userScale:
|
|
295
|
-
},
|
|
296
|
-
key:
|
|
297
|
-
fill:
|
|
298
|
-
back:
|
|
299
|
-
}),
|
|
322
|
+
}, Ft = ["advanced", "move"], nt = (e = {}) => ({ ...ze, ...e }), Os = {
|
|
323
|
+
ambientScale: oe,
|
|
324
|
+
userScale: oe
|
|
325
|
+
}, rt = (e = {}) => ({ ...Os, ...e }), xt = () => ({
|
|
326
|
+
key: Le(),
|
|
327
|
+
fill: Le({ shadow: !0 }),
|
|
328
|
+
back: Le({ shadow: !0 })
|
|
329
|
+
}), ge = Ye("3d-lights", {
|
|
300
330
|
state: () => ({
|
|
301
331
|
lights: {},
|
|
302
332
|
options: {},
|
|
@@ -308,14 +338,23 @@ const Qe = ({
|
|
|
308
338
|
// doesn't depend on whether option fields happen to look default.
|
|
309
339
|
framed: {},
|
|
310
340
|
collection: ["key", "fill", "back"],
|
|
311
|
-
debug: !1
|
|
341
|
+
debug: !1,
|
|
342
|
+
// Bumped by `restore()` so ThreeDimensionTool can detect that the
|
|
343
|
+
// host (consumer-app's tier-3 ?v= save-load) pushed new state in,
|
|
344
|
+
// and re-activate lights/camera modes to drive the OrbitControls
|
|
345
|
+
// rig from the just-restored options/lights/scales slots. The
|
|
346
|
+
// intensity sliders and per-spot color watchers fire on slot
|
|
347
|
+
// mutations directly, but the rig position (in options.position/
|
|
348
|
+
// quaternion/target/radius) only flows through `applyFromStore`
|
|
349
|
+
// and needs the explicit re-activation signal.
|
|
350
|
+
applyRevision: 0
|
|
312
351
|
}),
|
|
313
352
|
getters: {
|
|
314
353
|
bpId() {
|
|
315
|
-
return
|
|
354
|
+
return T().basePoseId;
|
|
316
355
|
},
|
|
317
356
|
skinId() {
|
|
318
|
-
return
|
|
357
|
+
return T().selected;
|
|
319
358
|
},
|
|
320
359
|
// The reset button reflects "user has tweaked something on the
|
|
321
360
|
// active skin." Toggles + rig are per-basePose; sliders are
|
|
@@ -325,10 +364,10 @@ const Qe = ({
|
|
|
325
364
|
// toggles + the active skin's slider values count.
|
|
326
365
|
changed(e) {
|
|
327
366
|
const t = e.options[this.bpId];
|
|
328
|
-
if (t &&
|
|
367
|
+
if (t && Ft.some((o) => !Qe(t[o], ze[o])))
|
|
329
368
|
return !0;
|
|
330
369
|
const s = e.scales[this.skinId];
|
|
331
|
-
return !!(s && (s.ambientScale !==
|
|
370
|
+
return !!(s && (s.ambientScale !== oe || s.userScale !== oe));
|
|
332
371
|
},
|
|
333
372
|
// Has frameToBounds + syncToStore landed on this basePose's
|
|
334
373
|
// lights rig? Set by markFramed() from the bounds watcher in
|
|
@@ -351,40 +390,40 @@ const Qe = ({
|
|
|
351
390
|
// above the new AMBIENT_SCALE_MAX / USER_SCALE_MAX.
|
|
352
391
|
ambientScale(e) {
|
|
353
392
|
var s;
|
|
354
|
-
const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ??
|
|
355
|
-
return
|
|
393
|
+
const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ?? oe;
|
|
394
|
+
return ot(t, Pe, Et);
|
|
356
395
|
},
|
|
357
396
|
userScale(e) {
|
|
358
397
|
var s;
|
|
359
|
-
const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ??
|
|
360
|
-
return
|
|
398
|
+
const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ?? oe;
|
|
399
|
+
return ot(t, Pe, kt);
|
|
361
400
|
},
|
|
362
401
|
position(e) {
|
|
363
402
|
var t;
|
|
364
|
-
return ((t = e.options[this.bpId]) == null ? void 0 : t.position) ||
|
|
403
|
+
return ((t = e.options[this.bpId]) == null ? void 0 : t.position) || ze.position;
|
|
365
404
|
},
|
|
366
405
|
quaternion(e) {
|
|
367
406
|
var t;
|
|
368
|
-
return ((t = e.options[this.bpId]) == null ? void 0 : t.quaternion) ||
|
|
407
|
+
return ((t = e.options[this.bpId]) == null ? void 0 : t.quaternion) || ze.quaternion;
|
|
369
408
|
},
|
|
370
409
|
target(e) {
|
|
371
410
|
var t;
|
|
372
|
-
return ((t = e.options[this.bpId]) == null ? void 0 : t.target) ||
|
|
411
|
+
return ((t = e.options[this.bpId]) == null ? void 0 : t.target) || ze.target;
|
|
373
412
|
},
|
|
374
413
|
radius(e) {
|
|
375
414
|
var t;
|
|
376
415
|
return (t = e.options[this.bpId]) == null ? void 0 : t.radius;
|
|
377
416
|
},
|
|
378
417
|
property(e) {
|
|
379
|
-
return (t, s = null,
|
|
380
|
-
const
|
|
381
|
-
return !
|
|
418
|
+
return (t, s = null, o = null) => {
|
|
419
|
+
const n = e.lights[this.bpId];
|
|
420
|
+
return !n || !n[t] || !(s in n[t]) ? o : n[t][s];
|
|
382
421
|
};
|
|
383
422
|
},
|
|
384
423
|
colorHex(e) {
|
|
385
424
|
return (t) => {
|
|
386
425
|
const s = e.lights[this.bpId];
|
|
387
|
-
return !s || !s[t] ? "#ffffff" :
|
|
426
|
+
return !s || !s[t] ? "#ffffff" : me(s[t].color);
|
|
388
427
|
};
|
|
389
428
|
},
|
|
390
429
|
lightKeys(e) {
|
|
@@ -398,13 +437,13 @@ const Qe = ({
|
|
|
398
437
|
reset() {
|
|
399
438
|
const e = this.bpId, t = this.skinId;
|
|
400
439
|
if (e == null) return;
|
|
401
|
-
this.options[e] || (this.options[e] =
|
|
440
|
+
this.options[e] || (this.options[e] = nt()), Ft.forEach((o) => this.options[e][o] = ze[o]), t != null && (this.scales[t] || (this.scales[t] = rt()), this.scales[t].ambientScale = oe, this.scales[t].userScale = oe);
|
|
402
441
|
const s = this.seeds[t];
|
|
403
442
|
s ? this.lights[e] = {
|
|
404
443
|
key: { ...s.key },
|
|
405
444
|
fill: { ...s.fill },
|
|
406
445
|
back: { ...s.back }
|
|
407
|
-
} : this.lights[e] =
|
|
446
|
+
} : this.lights[e] = xt();
|
|
408
447
|
},
|
|
409
448
|
// Seed per-skin lights from the recipe and warm the per-basePose
|
|
410
449
|
// user-state buckets if absent. The recipe is always rewritten
|
|
@@ -414,24 +453,24 @@ const Qe = ({
|
|
|
414
453
|
// survives subsequent skin swaps within the same basePose.
|
|
415
454
|
// scales[skinId] is per-skin and warmed once per skin.
|
|
416
455
|
seedFromRecipe(e, t) {
|
|
417
|
-
const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) *
|
|
456
|
+
const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) * Gs, o = (t == null ? void 0 : t.ambientIntensity) ?? 0, n = (t == null ? void 0 : t.envIntensity) ?? 1;
|
|
418
457
|
this.seeds[e] = {
|
|
419
|
-
key:
|
|
420
|
-
fill:
|
|
421
|
-
back:
|
|
422
|
-
ambient: { intensity:
|
|
423
|
-
env: { intensity:
|
|
424
|
-
}, e != null && !this.scales[e] && (this.scales[e] =
|
|
425
|
-
const
|
|
426
|
-
|
|
458
|
+
key: Le({ intensity: s }),
|
|
459
|
+
fill: Le({ intensity: s, shadow: !0 }),
|
|
460
|
+
back: Le({ intensity: s, shadow: !0 }),
|
|
461
|
+
ambient: { intensity: o },
|
|
462
|
+
env: { intensity: n }
|
|
463
|
+
}, e != null && !this.scales[e] && (this.scales[e] = rt());
|
|
464
|
+
const i = this.bpId;
|
|
465
|
+
i != null && (this.lights[i] || (this.lights[i] = xt()), this.options[i] || (this.options[i] = nt()));
|
|
427
466
|
},
|
|
428
467
|
ensureSelectedOptions() {
|
|
429
468
|
const e = this.bpId;
|
|
430
|
-
return e == null ? null : (this.options[e] || (this.options[e] =
|
|
469
|
+
return e == null ? null : (this.options[e] || (this.options[e] = nt()), this.options[e]);
|
|
431
470
|
},
|
|
432
471
|
ensureSelectedScales() {
|
|
433
472
|
const e = this.skinId;
|
|
434
|
-
return e == null ? null : (this.scales[e] || (this.scales[e] =
|
|
473
|
+
return e == null ? null : (this.scales[e] || (this.scales[e] = rt()), this.scales[e]);
|
|
435
474
|
},
|
|
436
475
|
setControlProperty(e, t) {
|
|
437
476
|
const s = this.ensureSelectedOptions();
|
|
@@ -464,63 +503,85 @@ const Qe = ({
|
|
|
464
503
|
return;
|
|
465
504
|
}
|
|
466
505
|
s.advanced = !1;
|
|
467
|
-
const
|
|
468
|
-
if (!
|
|
469
|
-
const
|
|
470
|
-
this.collection.forEach((
|
|
471
|
-
|
|
506
|
+
const o = this.lights[t];
|
|
507
|
+
if (!o) return;
|
|
508
|
+
const n = o.key;
|
|
509
|
+
this.collection.forEach((i) => {
|
|
510
|
+
i !== "key" && (o[i].color = n.color);
|
|
472
511
|
});
|
|
473
512
|
},
|
|
474
513
|
setColorHex(e, t) {
|
|
475
|
-
var
|
|
514
|
+
var i;
|
|
476
515
|
this.initLights();
|
|
477
516
|
const s = this.bpId;
|
|
478
517
|
if (s == null) return;
|
|
479
|
-
const
|
|
480
|
-
if (!
|
|
481
|
-
const
|
|
482
|
-
if (((
|
|
483
|
-
|
|
518
|
+
const o = this.lights[s];
|
|
519
|
+
if (!o) return;
|
|
520
|
+
const n = et(t);
|
|
521
|
+
if (((i = this.options[s]) == null ? void 0 : i.advanced) === !0) {
|
|
522
|
+
o[e].color = n;
|
|
484
523
|
return;
|
|
485
524
|
}
|
|
486
|
-
this.collection.forEach((
|
|
487
|
-
|
|
525
|
+
this.collection.forEach((r) => {
|
|
526
|
+
o[r].color = n;
|
|
488
527
|
});
|
|
489
528
|
},
|
|
490
529
|
setProperty(e, t, s) {
|
|
491
530
|
this.initLights();
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
|
|
531
|
+
const o = this.bpId;
|
|
532
|
+
if (o == null) return;
|
|
533
|
+
const n = this.lights[o];
|
|
534
|
+
n && (n[e][t] = s);
|
|
496
535
|
},
|
|
497
536
|
setAmbientScale(e) {
|
|
498
537
|
this.initLights();
|
|
499
538
|
const t = this.ensureSelectedScales();
|
|
500
|
-
t && (t.ambientScale =
|
|
539
|
+
t && (t.ambientScale = ot(e, Pe, Et));
|
|
501
540
|
},
|
|
502
541
|
setUserScale(e) {
|
|
503
542
|
this.initLights();
|
|
504
543
|
const t = this.ensureSelectedScales();
|
|
505
|
-
t && (t.userScale =
|
|
544
|
+
t && (t.userScale = ot(e, Pe, kt));
|
|
506
545
|
},
|
|
507
546
|
initLights() {
|
|
508
547
|
const e = this.bpId, t = this.skinId;
|
|
509
|
-
t != null && !this.scales[t] && (this.scales[t] =
|
|
548
|
+
t != null && !this.scales[t] && (this.scales[t] = rt()), e != null && (this.lights[e] || (this.lights[e] = xt()), this.options[e] || (this.options[e] = nt()));
|
|
510
549
|
},
|
|
511
550
|
markFramed() {
|
|
512
551
|
const e = this.bpId;
|
|
513
552
|
e != null && (this.framed[e] = !0);
|
|
553
|
+
},
|
|
554
|
+
// Capture the active basePose + skin's tunable lighting state for
|
|
555
|
+
// the save+freeze flow. Skips `seeds` (per-skin recipe baselines —
|
|
556
|
+
// rewritten on every GLB load, not user state) and `framed` (a
|
|
557
|
+
// session flag, not view-state). The three returned slots match
|
|
558
|
+
// exactly what `restore()` writes back.
|
|
559
|
+
//
|
|
560
|
+
// lights — per-spot color/visible/shadow for the active basePose
|
|
561
|
+
// options — rig position/quaternion/target/radius + toggles
|
|
562
|
+
// scales — ambient/user intensity sliders for the active skin
|
|
563
|
+
// only (per "skip per-skin transfer" rule — saves don't
|
|
564
|
+
// carry maps across skins).
|
|
565
|
+
snapshot() {
|
|
566
|
+
const e = this.bpId, t = this.skinId;
|
|
567
|
+
if (e == null) return null;
|
|
568
|
+
const s = this.lights[e] ? JSON.parse(JSON.stringify(this.lights[e])) : null, o = this.options[e] ? JSON.parse(JSON.stringify(this.options[e])) : null, n = t != null && this.scales[t] ? JSON.parse(JSON.stringify(this.scales[t])) : null;
|
|
569
|
+
return !s && !o && !n ? null : { lights: s, options: o, scales: n };
|
|
570
|
+
},
|
|
571
|
+
restore(e) {
|
|
572
|
+
if (e == null || typeof e != "object") return;
|
|
573
|
+
const t = this.bpId, s = this.skinId;
|
|
574
|
+
t != null && (e.lights && (this.lights = { ...this.lights, [t]: JSON.parse(JSON.stringify(e.lights)) }), e.options && (this.options = { ...this.options, [t]: JSON.parse(JSON.stringify(e.options)) }), e.scales && s != null && (this.scales = { ...this.scales, [s]: JSON.parse(JSON.stringify(e.scales)) }), this.framed[t] = !0, this.applyRevision = (this.applyRevision || 0) + 1);
|
|
514
575
|
}
|
|
515
576
|
}
|
|
516
|
-
}),
|
|
577
|
+
}), Zt = {
|
|
517
578
|
position: { x: 0, y: 0.39999999999999986, z: 1.5 },
|
|
518
579
|
quaternion: { x: -0.12993279108591813, y: 0, z: 0, w: 0.9915228034698058 },
|
|
519
580
|
target: { x: 0, y: 0, z: 0 },
|
|
520
581
|
radius: 1.5
|
|
521
|
-
},
|
|
582
|
+
}, Ns = {
|
|
522
583
|
changed() {
|
|
523
|
-
return this.exists ? !
|
|
584
|
+
return this.exists ? !Qe(this.mergedModel, Zt) : !1;
|
|
524
585
|
},
|
|
525
586
|
// Has frameToBounds + syncToStore landed on this basePose's
|
|
526
587
|
// bucket? An explicit per-basePose flag, set by markFramed() from
|
|
@@ -546,7 +607,7 @@ const Qe = ({
|
|
|
546
607
|
radius() {
|
|
547
608
|
return this.mergedModel.radius;
|
|
548
609
|
}
|
|
549
|
-
},
|
|
610
|
+
}, Us = {
|
|
550
611
|
initControls() {
|
|
551
612
|
this.initModel(this.keyId);
|
|
552
613
|
},
|
|
@@ -566,36 +627,36 @@ const Qe = ({
|
|
|
566
627
|
setRadius(e) {
|
|
567
628
|
this.setProperty("radius", e);
|
|
568
629
|
}
|
|
569
|
-
},
|
|
630
|
+
}, pt = tt({
|
|
570
631
|
storeId: "3d-controls",
|
|
571
|
-
defaultValues:
|
|
632
|
+
defaultValues: Zt,
|
|
572
633
|
state: { framed: {} },
|
|
573
|
-
getters:
|
|
574
|
-
actions:
|
|
634
|
+
getters: Ns,
|
|
635
|
+
actions: Us,
|
|
575
636
|
keyBy: "basePoseId"
|
|
576
|
-
}),
|
|
637
|
+
}), $s = {
|
|
577
638
|
color: 16711422
|
|
578
|
-
},
|
|
639
|
+
}, qs = {
|
|
579
640
|
changed() {
|
|
580
641
|
return this.propertyChanged("color");
|
|
581
642
|
},
|
|
582
643
|
colorHex() {
|
|
583
|
-
return
|
|
644
|
+
return me(this.property("color"));
|
|
584
645
|
}
|
|
585
|
-
},
|
|
646
|
+
}, Hs = {
|
|
586
647
|
init() {
|
|
587
648
|
this.initModel(this.keyId);
|
|
588
649
|
},
|
|
589
650
|
setColorHex(e) {
|
|
590
|
-
this.setProperty("color",
|
|
651
|
+
this.setProperty("color", et(e));
|
|
591
652
|
}
|
|
592
|
-
},
|
|
653
|
+
}, mt = tt({
|
|
593
654
|
storeId: "3d-scene",
|
|
594
|
-
defaultValues:
|
|
595
|
-
getters:
|
|
596
|
-
actions:
|
|
655
|
+
defaultValues: $s,
|
|
656
|
+
getters: qs,
|
|
657
|
+
actions: Hs,
|
|
597
658
|
keyBy: "basePoseId"
|
|
598
|
-
}),
|
|
659
|
+
}), Yt = {
|
|
599
660
|
show: !1,
|
|
600
661
|
front: !1,
|
|
601
662
|
back: !1,
|
|
@@ -606,9 +667,9 @@ const Qe = ({
|
|
|
606
667
|
divisions: 6,
|
|
607
668
|
opacity: 0.5,
|
|
608
669
|
size: 2
|
|
609
|
-
},
|
|
670
|
+
}, Js = {
|
|
610
671
|
changed() {
|
|
611
|
-
return !
|
|
672
|
+
return !Qe(this.mergedModel, Yt);
|
|
612
673
|
},
|
|
613
674
|
show() {
|
|
614
675
|
return this.property("show");
|
|
@@ -622,17 +683,17 @@ const Qe = ({
|
|
|
622
683
|
divisions() {
|
|
623
684
|
return this.property("divisions");
|
|
624
685
|
}
|
|
625
|
-
},
|
|
686
|
+
}, Ks = {
|
|
626
687
|
init() {
|
|
627
688
|
this.initModel(this.keyId);
|
|
628
689
|
}
|
|
629
|
-
},
|
|
690
|
+
}, ve = tt({
|
|
630
691
|
storeId: "3d-grid",
|
|
631
|
-
defaultValues:
|
|
632
|
-
getters:
|
|
633
|
-
actions:
|
|
692
|
+
defaultValues: Yt,
|
|
693
|
+
getters: Js,
|
|
694
|
+
actions: Ks,
|
|
634
695
|
keyBy: "basePoseId"
|
|
635
|
-
}),
|
|
696
|
+
}), Ws = [
|
|
636
697
|
"#141111",
|
|
637
698
|
"#3E251E",
|
|
638
699
|
"#633C30",
|
|
@@ -673,47 +734,154 @@ const Qe = ({
|
|
|
673
734
|
"#BDACA8",
|
|
674
735
|
"#DACDC9",
|
|
675
736
|
"#E5E4E3"
|
|
676
|
-
],
|
|
677
|
-
[
|
|
678
|
-
[
|
|
679
|
-
[
|
|
680
|
-
},
|
|
737
|
+
], It = "background", Tt = "subject", Dt = "ground", Qt = {
|
|
738
|
+
[Tt]: 16711422,
|
|
739
|
+
[It]: 16777215,
|
|
740
|
+
[Dt]: 12961221
|
|
741
|
+
}, Xs = {
|
|
681
742
|
changed() {
|
|
682
|
-
return this.exists ? !
|
|
743
|
+
return this.exists ? !Qe(this.mergedModel, Qt) : !1;
|
|
683
744
|
},
|
|
684
745
|
subjectHex() {
|
|
685
|
-
return
|
|
746
|
+
return me(this.property(Tt));
|
|
686
747
|
},
|
|
687
748
|
groundHex() {
|
|
688
|
-
return
|
|
749
|
+
return me(this.property(Dt));
|
|
689
750
|
},
|
|
690
751
|
backgroundHex() {
|
|
691
|
-
return
|
|
752
|
+
return me(this.property(It));
|
|
692
753
|
},
|
|
693
754
|
getHexColor() {
|
|
694
|
-
return (e) =>
|
|
755
|
+
return (e) => me(this.property(e, "#F0F0F0"));
|
|
695
756
|
}
|
|
696
|
-
},
|
|
757
|
+
}, Zs = {
|
|
697
758
|
setHexColor(e, t) {
|
|
698
|
-
this.setProperty(e,
|
|
759
|
+
this.setProperty(e, et(t));
|
|
699
760
|
},
|
|
700
761
|
setSubjectHex(e) {
|
|
701
|
-
this.setHexColor(
|
|
762
|
+
this.setHexColor(Tt, e);
|
|
702
763
|
},
|
|
703
764
|
setGroundHex(e) {
|
|
704
|
-
this.setHexColor(
|
|
765
|
+
this.setHexColor(Dt, e);
|
|
705
766
|
},
|
|
706
767
|
setBackgroundHex(e) {
|
|
707
|
-
this.setHexColor(
|
|
768
|
+
this.setHexColor(It, e);
|
|
708
769
|
}
|
|
709
|
-
},
|
|
770
|
+
}, Mt = tt({
|
|
710
771
|
storeId: "3d-colors",
|
|
711
|
-
defaultValues:
|
|
712
|
-
state: { palette:
|
|
713
|
-
getters:
|
|
714
|
-
actions:
|
|
772
|
+
defaultValues: Qt,
|
|
773
|
+
state: { palette: Ws },
|
|
774
|
+
getters: Xs,
|
|
775
|
+
actions: Zs,
|
|
715
776
|
keyBy: "basePoseId"
|
|
716
|
-
})
|
|
777
|
+
});
|
|
778
|
+
let te = null, je = null;
|
|
779
|
+
const Re = () => {
|
|
780
|
+
const e = T(), { aspect: t, width: s, height: o } = O(e), n = (c = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), te ? (console.debug("view camera already inited"), te) : (te = new k.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, te)), i = () => {
|
|
781
|
+
if (te)
|
|
782
|
+
return te;
|
|
783
|
+
};
|
|
784
|
+
return je = G(
|
|
785
|
+
() => t.value,
|
|
786
|
+
(c) => {
|
|
787
|
+
if (!te) {
|
|
788
|
+
n();
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
te.aspect = c, te.updateProjectionMatrix();
|
|
792
|
+
}
|
|
793
|
+
), {
|
|
794
|
+
init: n,
|
|
795
|
+
getCamera: i,
|
|
796
|
+
dispose: () => {
|
|
797
|
+
je == null || je(), je = null, te = null;
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
let W = null, Se = null, xe = null, Ge = null;
|
|
802
|
+
const Ie = () => {
|
|
803
|
+
const e = mt(), t = T(), { colorHex: s } = O(e), o = () => (console.debug("useScene init"), W ? (console.debug("scene already inited"), W) : (W = new k.Scene(), i(s.value), t.loaded.scene = !0, W)), n = () => {
|
|
804
|
+
if (W)
|
|
805
|
+
return W;
|
|
806
|
+
}, i = (a) => {
|
|
807
|
+
if (!W) throw new Error("Scene has not been initialized");
|
|
808
|
+
W.background = new k.Color(a);
|
|
809
|
+
}, r = (a) => {
|
|
810
|
+
if (!W) throw new Error("Scene has not been initialized");
|
|
811
|
+
if (!a) throw new Error("Renderer required to build environment");
|
|
812
|
+
Se || (xe = new k.PMREMGenerator(a), xe.compileEquirectangularShader(), Se = xe.fromScene(new Is(), 0.04).texture, W.environment = Se);
|
|
813
|
+
};
|
|
814
|
+
return Ge = G(
|
|
815
|
+
() => s.value,
|
|
816
|
+
(a) => i(a)
|
|
817
|
+
), {
|
|
818
|
+
init: o,
|
|
819
|
+
get: n,
|
|
820
|
+
dispose: () => {
|
|
821
|
+
t.loaded.scene = !1, Ge == null || Ge(), Ge = null, W && (W.traverse((a) => {
|
|
822
|
+
var u, p;
|
|
823
|
+
a.isMesh && ((u = a.geometry) == null || u.dispose(), Array.isArray(a.material) ? a.material.forEach((P) => P == null ? void 0 : P.dispose()) : (p = a.material) == null || p.dispose());
|
|
824
|
+
}), W.clear(), W = null, Se == null || Se.dispose(), xe == null || xe.dispose(), Se = null, xe = null);
|
|
825
|
+
},
|
|
826
|
+
setBackgroundColor: i,
|
|
827
|
+
setEnvironment: r
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
let R = null, Oe = null, Ne = null;
|
|
831
|
+
const Xe = () => {
|
|
832
|
+
const e = T(), { get: t } = Ie(), { getCamera: s } = Re(), { width: o, height: n, subjectLoaded: i } = O(e);
|
|
833
|
+
function r(w) {
|
|
834
|
+
return console.debug("useRenderer init"), R ? (console.debug("renderer already inited"), R) : (R = new k.WebGLRenderer({ antialias: !0, alpha: !0, preserveDrawingBuffer: !0 }), R.setSize(o.value, n.value), R.toneMapping = k.ACESFilmicToneMapping, R.toneMappingExposure = 0.8, R.shadowMap.enabled = !0, R.shadowMap.type = k.PCFSoftShadowMap, R.outputColorSpace = k.SRGBColorSpace, w && w.appendChild(R.domElement), e.loaded.renderer = !0, R);
|
|
835
|
+
}
|
|
836
|
+
const c = () => {
|
|
837
|
+
if (!R) throw new Error("Renderer has not been initialized");
|
|
838
|
+
return R;
|
|
839
|
+
}, a = (w) => {
|
|
840
|
+
R && (R.toneMappingExposure = w);
|
|
841
|
+
}, u = () => {
|
|
842
|
+
const w = t(), m = s();
|
|
843
|
+
!w || !m || R.render(w, m);
|
|
844
|
+
};
|
|
845
|
+
async function p({ size: w = 1024, format: m = "jpeg", quality: g = 0.85 } = {}) {
|
|
846
|
+
if (!R) throw new Error("Renderer has not been initialized");
|
|
847
|
+
const y = t(), x = s();
|
|
848
|
+
if (!y || !x) throw new Error("Scene or camera not ready");
|
|
849
|
+
const b = R.getSize(new k.Vector2()), D = R.getPixelRatio(), L = x.aspect;
|
|
850
|
+
try {
|
|
851
|
+
R.setPixelRatio(1), R.setSize(w, w, !1), x.aspect = 1, x.updateProjectionMatrix(), R.render(y, x);
|
|
852
|
+
const F = m === "png" ? "image/png" : "image/jpeg";
|
|
853
|
+
return await new Promise((N, K) => {
|
|
854
|
+
R.domElement.toBlob(
|
|
855
|
+
(v) => v ? N(v) : K(new Error("toBlob returned null")),
|
|
856
|
+
F,
|
|
857
|
+
m === "jpeg" ? g : void 0
|
|
858
|
+
);
|
|
859
|
+
});
|
|
860
|
+
} finally {
|
|
861
|
+
R.setPixelRatio(D), R.setSize(b.x, b.y, !1), x.aspect = L, x.updateProjectionMatrix(), R.render(y, x);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
Oe = G(
|
|
865
|
+
() => [o.value, n.value],
|
|
866
|
+
([w, m]) => {
|
|
867
|
+
!w || !m || !R || R.setSize(w, m);
|
|
868
|
+
}
|
|
869
|
+
), Ne = G(
|
|
870
|
+
() => i.value,
|
|
871
|
+
() => u()
|
|
872
|
+
);
|
|
873
|
+
function P() {
|
|
874
|
+
console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), Ne == null || Ne(), Oe = null, Ne = null, R && (R.domElement.parentElement && R.domElement.parentElement.removeChild(R.domElement), R.dispose(), R = null);
|
|
875
|
+
}
|
|
876
|
+
return {
|
|
877
|
+
init: r,
|
|
878
|
+
get: c,
|
|
879
|
+
dispose: P,
|
|
880
|
+
render: u,
|
|
881
|
+
setExposure: a,
|
|
882
|
+
captureSnapshot: p
|
|
883
|
+
};
|
|
884
|
+
}, T = Ye("3d", {
|
|
717
885
|
state: () => ({
|
|
718
886
|
// models: {},
|
|
719
887
|
selected: null,
|
|
@@ -745,11 +913,16 @@ const Qe = ({
|
|
|
745
913
|
}),
|
|
746
914
|
getters: {
|
|
747
915
|
active(e) {
|
|
748
|
-
var
|
|
749
|
-
|
|
916
|
+
var s, o;
|
|
917
|
+
const t = Ct.is.mobile ? lt : ee;
|
|
918
|
+
return ((o = (s = this.models) == null ? void 0 : s[e.selected]) == null ? void 0 : o.active) || t;
|
|
750
919
|
},
|
|
751
920
|
aspect(e) {
|
|
752
921
|
return e.height > 0 ? e.width / e.height : 0;
|
|
922
|
+
},
|
|
923
|
+
isFrozen(e) {
|
|
924
|
+
var t;
|
|
925
|
+
return ((t = this.appFreezeStore) == null ? void 0 : t.isFrozen(e.basePoseId)) || !1;
|
|
753
926
|
}
|
|
754
927
|
},
|
|
755
928
|
actions: {
|
|
@@ -761,6 +934,13 @@ const Qe = ({
|
|
|
761
934
|
var t;
|
|
762
935
|
return ((t = this.appPaywallStore) == null ? void 0 : t.block(e)) || !0;
|
|
763
936
|
},
|
|
937
|
+
pokeFreeze() {
|
|
938
|
+
var e;
|
|
939
|
+
(e = this.appFreezeStore) == null || e.poke(this.basePoseId);
|
|
940
|
+
},
|
|
941
|
+
captureSnapshot(e) {
|
|
942
|
+
return Xe().captureSnapshot(e);
|
|
943
|
+
},
|
|
764
944
|
isExpanded(e = []) {
|
|
765
945
|
return e = Array.isArray(e) ? e : [e], e.includes(this.active);
|
|
766
946
|
},
|
|
@@ -774,116 +954,93 @@ const Qe = ({
|
|
|
774
954
|
});
|
|
775
955
|
},
|
|
776
956
|
setFromResponse(e) {
|
|
777
|
-
var u, p,
|
|
778
|
-
const t =
|
|
957
|
+
var u, p, P;
|
|
958
|
+
const t = Mt(), s = pt(), o = ve(), n = Fe(), i = ge(), r = mt(), a = ae().setSubjectsFromResponse(e);
|
|
779
959
|
if (this.setUuid = ((u = e == null ? void 0 : e.result) == null ? void 0 : u.setUuid) ?? null, this.basePoseId = ((p = e == null ? void 0 : e.result) == null ? void 0 : p.basePoseId) ?? null, a == null) {
|
|
780
960
|
this.selected = null;
|
|
781
961
|
return;
|
|
782
962
|
}
|
|
783
|
-
this.selected = a, t.initModel(this.basePoseId),
|
|
963
|
+
this.selected = a, t.initModel(this.basePoseId), i.initLights(), n.init(), s.initControls(), o.init(), r.init(), this.models[a] || (this.models[a] = {}), (P = this.models[a]) != null && P.active || (this.models[a].active = Ct.is.mobile ? lt : ee);
|
|
784
964
|
}
|
|
785
965
|
}
|
|
786
966
|
});
|
|
787
|
-
let J = null, Ge = null;
|
|
788
|
-
const Le = () => {
|
|
789
|
-
const e = A(), { aspect: t, width: s, height: i } = $(e), r = (l = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), J ? (console.debug("view camera already inited"), J) : (J = new I.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, J)), n = () => {
|
|
790
|
-
if (J)
|
|
791
|
-
return J;
|
|
792
|
-
};
|
|
793
|
-
return Ge = O(
|
|
794
|
-
() => t.value,
|
|
795
|
-
(l) => {
|
|
796
|
-
if (!J) {
|
|
797
|
-
r();
|
|
798
|
-
return;
|
|
799
|
-
}
|
|
800
|
-
J.aspect = l, J.updateProjectionMatrix();
|
|
801
|
-
}
|
|
802
|
-
), {
|
|
803
|
-
init: r,
|
|
804
|
-
getCamera: n,
|
|
805
|
-
dispose: () => {
|
|
806
|
-
Ge == null || Ge(), Ge = null, J = null;
|
|
807
|
-
}
|
|
808
|
-
};
|
|
809
|
-
};
|
|
810
967
|
let Q = null;
|
|
811
|
-
const
|
|
812
|
-
const e =
|
|
968
|
+
const ct = () => {
|
|
969
|
+
const e = he(!1), t = he({
|
|
813
970
|
mode: null,
|
|
814
971
|
camera: null,
|
|
815
972
|
// camera (or your lights-camera)
|
|
816
973
|
store: null
|
|
817
974
|
// pinia store with position/quaternion/target
|
|
818
|
-
}), s = (
|
|
975
|
+
}), s = (m, g = {}) => {
|
|
819
976
|
if (console.debug("useOrbitControlsBase init"), Q)
|
|
820
977
|
return console.debug("controls already inited"), Q;
|
|
821
|
-
const
|
|
822
|
-
return Q = new
|
|
823
|
-
},
|
|
978
|
+
const y = new k.Object3D();
|
|
979
|
+
return Q = new Ts(y, m.domElement), n(g), Q;
|
|
980
|
+
}, o = () => {
|
|
824
981
|
if (!Q) throw new Error("OrbitControls not initialized");
|
|
825
982
|
return Q;
|
|
826
|
-
},
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
},
|
|
830
|
-
const
|
|
831
|
-
if (!
|
|
832
|
-
if (!
|
|
833
|
-
|
|
834
|
-
},
|
|
983
|
+
}, n = (m = {}) => {
|
|
984
|
+
const g = o();
|
|
985
|
+
g.enableDamping = m.enableDamping ?? !0, g.dampingFactor = m.dampingFactor ?? 0.5, g.rotateSpeed = m.rotateSpeed ?? 0.2, g.enableZoom = m.enableZoom ?? !0, g.minDistance = m.minDistance ?? 0.5, g.maxDistance = m.maxDistance ?? 6, g.panSpeed = m.panSpeed ?? 1;
|
|
986
|
+
}, i = ({ mode: m, camera: g, store: y, options: x }) => {
|
|
987
|
+
const b = o();
|
|
988
|
+
if (!g) throw new Error(`setMode(${m}): camera is required`);
|
|
989
|
+
if (!y) throw new Error(`setMode(${m}): store is required`);
|
|
990
|
+
b.object = g, n(x), t.value = { mode: m, camera: g, store: y }, a(), b.update();
|
|
991
|
+
}, r = () => {
|
|
835
992
|
Q && Q.update();
|
|
836
|
-
},
|
|
837
|
-
const
|
|
838
|
-
!
|
|
993
|
+
}, c = () => {
|
|
994
|
+
const m = o(), { camera: g, store: y } = t.value;
|
|
995
|
+
!g || !y || e.value || (y.setPosition({ ...g.position }), y.setQuaternion({ ...g.quaternion }), y.setTarget({ ...m.target }), y.setRadius(g.position.distanceTo(m.target)));
|
|
839
996
|
}, a = () => {
|
|
840
|
-
const
|
|
841
|
-
if (!
|
|
997
|
+
const m = o(), { camera: g, store: y } = t.value;
|
|
998
|
+
if (!g || !y) return;
|
|
842
999
|
e.value = !0;
|
|
843
|
-
const { position:
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
1000
|
+
const { position: x, quaternion: b, target: D, radius: L } = y;
|
|
1001
|
+
m.target.set(D.x, D.y, D.z);
|
|
1002
|
+
const F = new k.Vector3(
|
|
1003
|
+
x.x - D.x,
|
|
1004
|
+
x.y - D.y,
|
|
1005
|
+
x.z - D.z
|
|
849
1006
|
).normalize();
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
),
|
|
1007
|
+
g.position.copy(m.target).add(F.multiplyScalar(L)), g.quaternion.set(
|
|
1008
|
+
b.x,
|
|
1009
|
+
b.y,
|
|
1010
|
+
b.z,
|
|
1011
|
+
b.w
|
|
1012
|
+
), m.update(), e.value = !1;
|
|
856
1013
|
}, u = 0, p = 0.1;
|
|
857
1014
|
return {
|
|
858
1015
|
init: s,
|
|
859
|
-
get:
|
|
860
|
-
setMode:
|
|
861
|
-
update:
|
|
862
|
-
syncToStore:
|
|
1016
|
+
get: o,
|
|
1017
|
+
setMode: i,
|
|
1018
|
+
update: r,
|
|
1019
|
+
syncToStore: c,
|
|
863
1020
|
applyFromStore: a,
|
|
864
|
-
frameToBounds: (
|
|
865
|
-
const
|
|
866
|
-
if (!
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
1021
|
+
frameToBounds: (m, g = 1.75) => {
|
|
1022
|
+
const y = o(), { camera: x } = t.value;
|
|
1023
|
+
if (!x || !m) return;
|
|
1024
|
+
const b = new k.Vector3(
|
|
1025
|
+
m.center.x,
|
|
1026
|
+
m.center.y + m.size.y * u,
|
|
1027
|
+
m.center.z
|
|
871
1028
|
);
|
|
872
|
-
console.log("bounds",
|
|
873
|
-
const
|
|
874
|
-
let
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
),
|
|
1029
|
+
console.log("bounds", m);
|
|
1030
|
+
const D = Math.max(m.size.x, m.size.y, m.size.z), L = k.MathUtils.degToRad(x.fov);
|
|
1031
|
+
let F = D / 2 / Math.tan(L / 2) * g;
|
|
1032
|
+
y.target.copy(b), x.position.set(
|
|
1033
|
+
b.x,
|
|
1034
|
+
b.y + m.size.y * p,
|
|
1035
|
+
b.z + F
|
|
1036
|
+
), x.near = F / 100, x.far = F * 100, x.updateProjectionMatrix(), y.update();
|
|
880
1037
|
},
|
|
881
1038
|
dispose: () => {
|
|
882
1039
|
console.debug("controls disposed"), Q && (Q.dispose(), Q = null, t.value = { mode: null, camera: null, store: null });
|
|
883
1040
|
}
|
|
884
1041
|
};
|
|
885
|
-
},
|
|
886
|
-
const { getCamera: e } =
|
|
1042
|
+
}, Bt = () => {
|
|
1043
|
+
const { getCamera: e } = Re(), t = pt(), s = ct();
|
|
887
1044
|
return {
|
|
888
1045
|
activate: () => {
|
|
889
1046
|
s.setMode({
|
|
@@ -901,36 +1058,7 @@ const rt = () => {
|
|
|
901
1058
|
syncToStore: s.syncToStore,
|
|
902
1059
|
applyFromStore: s.applyFromStore
|
|
903
1060
|
};
|
|
904
|
-
}
|
|
905
|
-
let X = null, ge = null, be = null, Fe = null;
|
|
906
|
-
const we = () => {
|
|
907
|
-
const e = ut(), t = A(), { colorHex: s } = $(e), i = () => (console.debug("useScene init"), X ? (console.debug("scene already inited"), X) : (X = new I.Scene(), n(s.value), t.loaded.scene = !0, X)), r = () => {
|
|
908
|
-
if (X)
|
|
909
|
-
return X;
|
|
910
|
-
}, n = (a) => {
|
|
911
|
-
if (!X) throw new Error("Scene has not been initialized");
|
|
912
|
-
X.background = new I.Color(a);
|
|
913
|
-
}, o = (a) => {
|
|
914
|
-
if (!X) throw new Error("Scene has not been initialized");
|
|
915
|
-
if (!a) throw new Error("Renderer required to build environment");
|
|
916
|
-
ge || (be = new I.PMREMGenerator(a), be.compileEquirectangularShader(), ge = be.fromScene(new xs(), 0.04).texture, X.environment = ge);
|
|
917
|
-
};
|
|
918
|
-
return Fe = O(
|
|
919
|
-
() => s.value,
|
|
920
|
-
(a) => n(a)
|
|
921
|
-
), {
|
|
922
|
-
init: i,
|
|
923
|
-
get: r,
|
|
924
|
-
dispose: () => {
|
|
925
|
-
t.loaded.scene = !1, Fe == null || Fe(), Fe = null, X && (X.traverse((a) => {
|
|
926
|
-
var u, p;
|
|
927
|
-
a.isMesh && ((u = a.geometry) == null || u.dispose(), Array.isArray(a.material) ? a.material.forEach((D) => D == null ? void 0 : D.dispose()) : (p = a.material) == null || p.dispose());
|
|
928
|
-
}), X.clear(), X = null, ge == null || ge.dispose(), be == null || be.dispose(), ge = null, be = null);
|
|
929
|
-
},
|
|
930
|
-
setBackgroundColor: n,
|
|
931
|
-
setEnvironment: o
|
|
932
|
-
};
|
|
933
|
-
}, qs = {
|
|
1061
|
+
}, Ys = {
|
|
934
1062
|
asphalt: {
|
|
935
1063
|
ao: "ao.jpg",
|
|
936
1064
|
color: "color.jpg",
|
|
@@ -966,280 +1094,280 @@ const we = () => {
|
|
|
966
1094
|
repeat: 100
|
|
967
1095
|
}
|
|
968
1096
|
};
|
|
969
|
-
let
|
|
970
|
-
const
|
|
971
|
-
const e =
|
|
972
|
-
visible:
|
|
973
|
-
color:
|
|
974
|
-
texture:
|
|
975
|
-
offset:
|
|
976
|
-
} =
|
|
977
|
-
if (console.debug("useGround init"),
|
|
978
|
-
return console.debug("ground already inited"),
|
|
979
|
-
const
|
|
980
|
-
color:
|
|
1097
|
+
let B = null, Ue = null, $e = null, qe = null;
|
|
1098
|
+
const _t = () => {
|
|
1099
|
+
const e = Fe(), { get: t } = Ie(), { getCamera: s } = Re(), {
|
|
1100
|
+
visible: o,
|
|
1101
|
+
color: n,
|
|
1102
|
+
texture: i,
|
|
1103
|
+
offset: r
|
|
1104
|
+
} = O(e), c = () => {
|
|
1105
|
+
if (console.debug("useGround init"), B)
|
|
1106
|
+
return console.debug("ground already inited"), B;
|
|
1107
|
+
const g = t(), y = new k.PlaneGeometry(100, 100), x = new k.Color(n.value || 16777215), b = new k.MeshStandardMaterial({
|
|
1108
|
+
color: x,
|
|
981
1109
|
// Default to white
|
|
982
|
-
side:
|
|
1110
|
+
side: k.DoubleSide,
|
|
983
1111
|
roughness: 0.4,
|
|
984
1112
|
metalness: 0.3,
|
|
985
|
-
emissive:
|
|
1113
|
+
emissive: x,
|
|
986
1114
|
emissiveIntensity: 0.05
|
|
987
1115
|
// tweak 0.1–0.6
|
|
988
1116
|
});
|
|
989
|
-
return
|
|
990
|
-
() =>
|
|
1117
|
+
return B = new k.Mesh(y, b), B.rotation.x = -Math.PI / 2, B.receiveShadow = !0, B.visible = o.value, g.add(B), Ue = G(
|
|
1118
|
+
() => o.value,
|
|
991
1119
|
() => a()
|
|
992
|
-
),
|
|
993
|
-
() => r.value,
|
|
994
|
-
(T) => w(T)
|
|
995
|
-
), Ue = O(
|
|
1120
|
+
), $e = G(
|
|
996
1121
|
() => n.value,
|
|
997
|
-
(
|
|
998
|
-
),
|
|
1122
|
+
(D) => w(D)
|
|
1123
|
+
), qe = G(
|
|
1124
|
+
() => i.value,
|
|
1125
|
+
(D) => p(D)
|
|
1126
|
+
), B;
|
|
999
1127
|
};
|
|
1000
1128
|
function a() {
|
|
1001
|
-
if (s().position.y <
|
|
1002
|
-
|
|
1129
|
+
if (s().position.y < B.position.y) {
|
|
1130
|
+
B.visible = !1;
|
|
1003
1131
|
return;
|
|
1004
1132
|
}
|
|
1005
|
-
|
|
1133
|
+
B.visible = o.value;
|
|
1006
1134
|
}
|
|
1007
|
-
function u(
|
|
1008
|
-
return new
|
|
1009
|
-
|
|
1135
|
+
function u(g, y = 1, x = 1) {
|
|
1136
|
+
return new k.TextureLoader().load(g, (L) => {
|
|
1137
|
+
L.wrapS = k.RepeatWrapping, L.wrapT = k.RepeatWrapping, L.repeat.set(y, x), L.needsUpdate = !0;
|
|
1010
1138
|
});
|
|
1011
1139
|
}
|
|
1012
|
-
const p = (
|
|
1013
|
-
if (!
|
|
1014
|
-
const
|
|
1015
|
-
if (!
|
|
1016
|
-
|
|
1140
|
+
const p = (g) => {
|
|
1141
|
+
if (!B) throw new Error("Ground has not been initialized");
|
|
1142
|
+
const y = Ys[g];
|
|
1143
|
+
if (!y)
|
|
1144
|
+
B.material.map = null, B.material.normalMap = null, B.material.displacementMap = null, B.material.roughnessMap = null, B.material.aoMap = null, B.material.metalnessMap = null, B.material.needsUpdate = !0;
|
|
1017
1145
|
else {
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
`${
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
),
|
|
1024
|
-
`${
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
),
|
|
1028
|
-
`${
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
),
|
|
1032
|
-
`${
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
),
|
|
1036
|
-
`${
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
),
|
|
1040
|
-
`${
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
)),
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
},
|
|
1047
|
-
if (!
|
|
1048
|
-
return
|
|
1049
|
-
}, w = (
|
|
1050
|
-
if (!
|
|
1051
|
-
|
|
1146
|
+
const x = `https://static.figurosity.com/3d/textures/${g}/`, b = y.repeat;
|
|
1147
|
+
B.material.map = u(
|
|
1148
|
+
`${x}${y.color}`,
|
|
1149
|
+
b,
|
|
1150
|
+
b
|
|
1151
|
+
), B.material.normalMap = u(
|
|
1152
|
+
`${x}${y.normal}`,
|
|
1153
|
+
b,
|
|
1154
|
+
b
|
|
1155
|
+
), B.material.displacementMap = u(
|
|
1156
|
+
`${x}${y.displacement}`,
|
|
1157
|
+
b,
|
|
1158
|
+
b
|
|
1159
|
+
), B.material.roughnessMap = u(
|
|
1160
|
+
`${x}${y.roughness}`,
|
|
1161
|
+
b,
|
|
1162
|
+
b
|
|
1163
|
+
), B.material.aoMap = u(
|
|
1164
|
+
`${x}${y.ao}`,
|
|
1165
|
+
b,
|
|
1166
|
+
b
|
|
1167
|
+
), y.metalness && (B.material.metalnessMap = u(
|
|
1168
|
+
`${x}${y.metalness}`,
|
|
1169
|
+
b,
|
|
1170
|
+
b
|
|
1171
|
+
)), B.material.displacementScale = 0.1, B.material.displacementBias = -0.05, B.material.needsUpdate = !0;
|
|
1172
|
+
}
|
|
1173
|
+
B.position.y = r.value, B.geometry.computeBoundingBox(), B.geometry.computeVertexNormals();
|
|
1174
|
+
}, P = () => {
|
|
1175
|
+
if (!B) throw new Error("Ground has not been initialized");
|
|
1176
|
+
return B;
|
|
1177
|
+
}, w = (g) => {
|
|
1178
|
+
if (!B) throw new Error("Ground has not been initialized");
|
|
1179
|
+
B.material.color.set(g);
|
|
1052
1180
|
};
|
|
1053
|
-
return { init:
|
|
1054
|
-
var
|
|
1055
|
-
if (
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1181
|
+
return { init: c, get: P, setColor: w, updateVisibility: a, dispose: () => {
|
|
1182
|
+
var y, x;
|
|
1183
|
+
if (Ue == null || Ue(), $e == null || $e(), qe == null || qe(), Ue = null, $e = null, qe = null, !B) return;
|
|
1184
|
+
const g = t();
|
|
1185
|
+
g == null || g.remove(B), (y = B.geometry) == null || y.dispose(), Array.isArray(B.material) ? B.material.forEach((b) => b == null ? void 0 : b.dispose()) : (x = B.material) == null || x.dispose(), B = null;
|
|
1058
1186
|
} };
|
|
1059
|
-
},
|
|
1060
|
-
const s = new
|
|
1187
|
+
}, Qs = (e, t = 16711422) => {
|
|
1188
|
+
const s = new Ms(0.1, 0.1, 0.1, 6, 0.01), o = 0.1, n = 0.05, i = new k.ConeGeometry(n, o, 32);
|
|
1061
1189
|
s.index || s.setIndex(
|
|
1062
1190
|
Array.from(
|
|
1063
1191
|
{ length: s.attributes.position.count },
|
|
1064
1192
|
(u, p) => p
|
|
1065
1193
|
)
|
|
1066
|
-
),
|
|
1194
|
+
), i.index || i.setIndex(
|
|
1067
1195
|
Array.from(
|
|
1068
|
-
{ length:
|
|
1196
|
+
{ length: i.attributes.position.count },
|
|
1069
1197
|
(u, p) => p
|
|
1070
1198
|
)
|
|
1071
|
-
),
|
|
1072
|
-
const
|
|
1199
|
+
), i.rotateX(-Math.PI / 2), i.translate(0, 0, o / 2), Rt(s), Rt(i);
|
|
1200
|
+
const r = Ds([s, i]), c = new k.MeshBasicMaterial({
|
|
1073
1201
|
color: t,
|
|
1074
1202
|
transparent: !0,
|
|
1075
1203
|
opacity: 0.8
|
|
1076
|
-
}), a = new
|
|
1204
|
+
}), a = new k.Mesh(r, c);
|
|
1077
1205
|
if (a.position.set(0, 0, 0), a.rotateX(Math.PI), e && e.target) {
|
|
1078
|
-
const u = new
|
|
1206
|
+
const u = new k.Vector3();
|
|
1079
1207
|
e.target.getWorldPosition(u), a.lookAt(u);
|
|
1080
1208
|
}
|
|
1081
1209
|
return a.position.copy(e.position), a;
|
|
1082
1210
|
};
|
|
1083
|
-
let
|
|
1084
|
-
const
|
|
1085
|
-
const e =
|
|
1086
|
-
|
|
1087
|
-
const { subjectLoaded:
|
|
1088
|
-
if (
|
|
1089
|
-
return console.warn("lights camera already inited"),
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
}),
|
|
1095
|
-
},
|
|
1096
|
-
if (!
|
|
1211
|
+
let it = {}, re = {}, H = {}, ce = {}, De = null, ue = null, Me = [], Be = /* @__PURE__ */ new Map();
|
|
1212
|
+
const ut = () => {
|
|
1213
|
+
const e = T(), t = ge(), s = ae();
|
|
1214
|
+
he(!1);
|
|
1215
|
+
const { subjectLoaded: o, width: n, height: i, selected: r, basePoseId: c } = O(e), { debug: a, collection: u, advancedMode: p, move: P } = O(t), { get: w } = Ie(), m = t.property, g = () => {
|
|
1216
|
+
if (ue)
|
|
1217
|
+
return console.warn("lights camera already inited"), ue;
|
|
1218
|
+
const S = w();
|
|
1219
|
+
return De = b(), ue = D(), u.value.forEach((l) => {
|
|
1220
|
+
const f = l === "key" ? ue : S, { group: M, light: I, visualization: E } = L(l, f);
|
|
1221
|
+
H[l] = I, it[l] = M, ce[l] = E, H[l].castShadow = !0, H[l].angle = Math.PI / 4, H[l].penumbra = 0.5, H[l].shadow.camera.near = 0.5, H[l].shadow.camera.far = 12, H[l].shadow.focus = 0.9, H[l].shadow.mapSize.set(4096, 4096), H[l].shadow.bias = -2e-4, H[l].shadow.normalBias = 0.02, H[l].shadow.radius = 2, H[l].shadow.camera.updateProjectionMatrix();
|
|
1222
|
+
}), j(), Y(), ue;
|
|
1223
|
+
}, y = () => {
|
|
1224
|
+
if (!ue)
|
|
1097
1225
|
throw new Error("Light camera not initialized.");
|
|
1098
|
-
return
|
|
1099
|
-
},
|
|
1100
|
-
|
|
1101
|
-
var
|
|
1102
|
-
return (
|
|
1226
|
+
return ue;
|
|
1227
|
+
}, x = (S) => {
|
|
1228
|
+
S && (Object.values(H).forEach((l) => l == null ? void 0 : l.color.set(S)), Object.values(ce).forEach((l) => {
|
|
1229
|
+
var f;
|
|
1230
|
+
return (f = l == null ? void 0 : l.material) == null ? void 0 : f.color.set(S);
|
|
1103
1231
|
}));
|
|
1104
|
-
},
|
|
1105
|
-
const
|
|
1106
|
-
return
|
|
1107
|
-
},
|
|
1108
|
-
const
|
|
1232
|
+
}, b = () => {
|
|
1233
|
+
const S = w(), l = new k.AmbientLight(16777215, 0.2);
|
|
1234
|
+
return S.add(l), l;
|
|
1235
|
+
}, D = () => {
|
|
1236
|
+
const S = w(), l = new k.PerspectiveCamera(
|
|
1109
1237
|
75,
|
|
1110
|
-
|
|
1238
|
+
n.value / i.value,
|
|
1111
1239
|
0.1,
|
|
1112
1240
|
100
|
|
1113
1241
|
);
|
|
1114
|
-
return
|
|
1242
|
+
return l.position.set(0, 0, 1.5), S.add(l), l;
|
|
1115
1243
|
};
|
|
1116
|
-
function
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
|
|
1244
|
+
function L(S, l = null) {
|
|
1245
|
+
const f = w(), M = new k.Group(), I = new k.SpotLight(
|
|
1246
|
+
m(S, "color"),
|
|
1247
|
+
m(S, "intensity")
|
|
1120
1248
|
);
|
|
1121
|
-
|
|
1122
|
-
const
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
), U = t.isVisible(
|
|
1126
|
-
return
|
|
1249
|
+
I.position.set(0, 0, 0), N(), I.target.position.set(0, 1, 0), I.target.updateMatrixWorld(), f.add(I.target), M.add(I);
|
|
1250
|
+
const E = Qs(
|
|
1251
|
+
I,
|
|
1252
|
+
m(S, "visualizationColor")
|
|
1253
|
+
), U = t.isVisible(S);
|
|
1254
|
+
return E.visible = U, M.add(E), l.add(M), { group: M, light: I, visualization: E };
|
|
1127
1255
|
}
|
|
1128
|
-
const
|
|
1129
|
-
|
|
1130
|
-
},
|
|
1131
|
-
if (!t.lights[
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
}
|
|
1137
|
-
u.value.forEach((
|
|
1138
|
-
const
|
|
1139
|
-
if (!
|
|
1140
|
-
const U =
|
|
1141
|
-
if (U &&
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
),
|
|
1256
|
+
const F = () => {
|
|
1257
|
+
N(), K(), v();
|
|
1258
|
+
}, N = () => {
|
|
1259
|
+
if (!t.lights[c.value]) return;
|
|
1260
|
+
const l = t.seeds[r.value], f = t.ambientScale, M = t.userScale;
|
|
1261
|
+
if (De && (l != null && l.ambient) && (De.intensity = l.ambient.intensity * f), l != null && l.env) {
|
|
1262
|
+
const I = w();
|
|
1263
|
+
I && (I.environmentIntensity = l.env.intensity * f);
|
|
1264
|
+
}
|
|
1265
|
+
u.value.forEach((I) => {
|
|
1266
|
+
const E = H[I];
|
|
1267
|
+
if (!E) return;
|
|
1268
|
+
const U = m(I, "color"), be = m(I, "visible"), J = m(I, "shadow") || !1;
|
|
1269
|
+
if (U && E.color.set(U), E.visible = be, l != null && l[I] && (E.intensity = l[I].intensity * M), E.castShadow = J, J) {
|
|
1270
|
+
const le = m(I, "shadowSettings", {});
|
|
1271
|
+
E.shadow.mapSize.set(
|
|
1272
|
+
le.width || 1024,
|
|
1273
|
+
le.height || 1024
|
|
1274
|
+
), E.shadow.camera.near = le.near || 0.5, E.shadow.camera.far = le.far || 50, E.shadow.needsUpdate = !0;
|
|
1147
1275
|
}
|
|
1148
1276
|
});
|
|
1149
|
-
},
|
|
1150
|
-
t.lights[
|
|
1151
|
-
if (!
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1277
|
+
}, K = () => {
|
|
1278
|
+
t.lights[c.value] && u.value.forEach((l) => {
|
|
1279
|
+
if (!ce[l]) return console.warn(`${l} does not exist`);
|
|
1280
|
+
const f = t.isVisible(l);
|
|
1281
|
+
ce[l].visible = f, ce[l].material.color.set(m(l, "color"));
|
|
1154
1282
|
});
|
|
1155
|
-
},
|
|
1156
|
-
t.lights[
|
|
1157
|
-
const
|
|
1158
|
-
!
|
|
1283
|
+
}, v = () => {
|
|
1284
|
+
t.lights[c.value] && u.value.forEach((l) => {
|
|
1285
|
+
const f = m(l, "debug") || a.value;
|
|
1286
|
+
!re[l] && f && (re[l] = h(l, H[l]), H[l].add(re[l])), re[l] && !f && (re[l] = A(re[l]));
|
|
1159
1287
|
});
|
|
1160
|
-
},
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1288
|
+
}, h = (S, l) => {
|
|
1289
|
+
const f = w(), M = new k.SpotLightHelper(
|
|
1290
|
+
l,
|
|
1291
|
+
m(S, "visualizationColor")
|
|
1164
1292
|
);
|
|
1165
|
-
return
|
|
1166
|
-
},
|
|
1167
|
-
const
|
|
1168
|
-
if (!(!
|
|
1169
|
-
return
|
|
1170
|
-
},
|
|
1171
|
-
const
|
|
1293
|
+
return f.add(M), M;
|
|
1294
|
+
}, A = (S) => {
|
|
1295
|
+
const l = w();
|
|
1296
|
+
if (!(!l || !S))
|
|
1297
|
+
return l.remove(S), S.dispose(), S = null, S;
|
|
1298
|
+
}, j = () => {
|
|
1299
|
+
const S = y();
|
|
1172
1300
|
if (!s.bounds) return;
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1301
|
+
const f = t.target, M = new k.Vector3(f.x, f.y, f.z), I = new k.Vector3().subVectors(M, S.position).normalize(), E = new k.Vector3(
|
|
1302
|
+
I.x,
|
|
1175
1303
|
0,
|
|
1176
|
-
|
|
1177
|
-
).normalize(), U = new
|
|
1178
|
-
-
|
|
1304
|
+
I.z
|
|
1305
|
+
).normalize(), U = new k.Vector3(
|
|
1306
|
+
-E.z,
|
|
1179
1307
|
0,
|
|
1180
|
-
|
|
1181
|
-
),
|
|
1182
|
-
|
|
1183
|
-
var
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1308
|
+
E.x
|
|
1309
|
+
), J = 2 * S.position.distanceTo(M) / Math.sqrt(3), le = 1, _e = M.clone().add(U.clone().multiplyScalar(-J / le)).add(I.clone().multiplyScalar(Math.sqrt(3) * J / 2)), ls = M.clone().add(U.clone().multiplyScalar(J / le)).add(I.clone().multiplyScalar(Math.sqrt(3) * J / 2));
|
|
1310
|
+
it.fill.position.copy(_e), it.back.position.copy(ls), u.value.forEach((ht) => {
|
|
1311
|
+
var Pt, st, Lt;
|
|
1312
|
+
const gt = H[ht];
|
|
1313
|
+
gt.shadow.needsUpdate = !0, gt.target.position.copy(M), gt.target.updateMatrixWorld(), (Pt = ce[ht]) == null || Pt.lookAt(M), (Lt = (st = re[ht]) == null ? void 0 : st.update) == null || Lt.call(st);
|
|
1186
1314
|
});
|
|
1187
|
-
}, z = (
|
|
1188
|
-
const
|
|
1189
|
-
if (
|
|
1190
|
-
const
|
|
1191
|
-
() => [t.lights[
|
|
1192
|
-
|
|
1315
|
+
}, z = (S) => {
|
|
1316
|
+
const l = `watcher-${S}`;
|
|
1317
|
+
if (Be.has(l)) return;
|
|
1318
|
+
const f = G(
|
|
1319
|
+
() => [t.lights[S], t.options[S]],
|
|
1320
|
+
F,
|
|
1193
1321
|
{ deep: !0 }
|
|
1194
1322
|
);
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1323
|
+
Be.set(l, f);
|
|
1324
|
+
}, $ = (S) => {
|
|
1325
|
+
const l = `watcher-${S}`, f = Be.get(l);
|
|
1326
|
+
f && (f(), Be.delete(l));
|
|
1199
1327
|
}, Y = () => {
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
() => [p.value,
|
|
1203
|
-
() =>
|
|
1328
|
+
Me.push(
|
|
1329
|
+
G(
|
|
1330
|
+
() => [p.value, r.value, P.value],
|
|
1331
|
+
() => F()
|
|
1204
1332
|
)
|
|
1205
|
-
),
|
|
1206
|
-
|
|
1333
|
+
), Me.push(
|
|
1334
|
+
G(
|
|
1207
1335
|
() => [t.ambientScale, t.userScale],
|
|
1208
|
-
() =>
|
|
1336
|
+
() => F()
|
|
1209
1337
|
)
|
|
1210
|
-
),
|
|
1211
|
-
|
|
1212
|
-
() =>
|
|
1213
|
-
(
|
|
1214
|
-
|
|
1338
|
+
), Me.push(
|
|
1339
|
+
G(
|
|
1340
|
+
() => o.value,
|
|
1341
|
+
(S) => {
|
|
1342
|
+
S === !0 && j();
|
|
1215
1343
|
}
|
|
1216
1344
|
)
|
|
1217
|
-
),
|
|
1218
|
-
|
|
1219
|
-
() =>
|
|
1220
|
-
(
|
|
1221
|
-
|
|
1345
|
+
), Me.push(
|
|
1346
|
+
G(
|
|
1347
|
+
() => c.value,
|
|
1348
|
+
(S, l) => {
|
|
1349
|
+
l && $(l), S != null && (z(S), cs(F));
|
|
1222
1350
|
},
|
|
1223
1351
|
{ immediate: !0 }
|
|
1224
1352
|
)
|
|
1225
1353
|
);
|
|
1226
1354
|
};
|
|
1227
1355
|
return {
|
|
1228
|
-
init:
|
|
1229
|
-
updatePosition:
|
|
1230
|
-
getCamera:
|
|
1356
|
+
init: g,
|
|
1357
|
+
updatePosition: j,
|
|
1358
|
+
getCamera: y,
|
|
1231
1359
|
dispose: () => {
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
var
|
|
1235
|
-
|
|
1236
|
-
}),
|
|
1237
|
-
},
|
|
1238
|
-
applyColorPreview:
|
|
1239
|
-
applyFromStore:
|
|
1360
|
+
const S = w();
|
|
1361
|
+
S && (Me.forEach((l) => l()), Me = [], Be.forEach((l) => l()), Be.clear(), Object.values(H).forEach((l) => S.remove(l)), Object.values(re).forEach((l) => S.remove(l)), Object.values(ce).forEach((l) => {
|
|
1362
|
+
var f, M, I, E;
|
|
1363
|
+
S.remove(l), (M = (f = l.geometry) == null ? void 0 : f.dispose) == null || M.call(f), (E = (I = l.material) == null ? void 0 : I.dispose) == null || E.call(I);
|
|
1364
|
+
}), De && S.remove(De), it = {}, re = {}, H = {}, ce = {}, De = null, ue = null);
|
|
1365
|
+
},
|
|
1366
|
+
applyColorPreview: x,
|
|
1367
|
+
applyFromStore: F
|
|
1240
1368
|
};
|
|
1241
|
-
},
|
|
1242
|
-
const e =
|
|
1369
|
+
}, eo = 0.4, to = 0.25, At = () => {
|
|
1370
|
+
const e = ge(), t = ct(), { getCamera: s } = ut();
|
|
1243
1371
|
return {
|
|
1244
1372
|
activate: () => {
|
|
1245
1373
|
t.setMode({
|
|
@@ -1257,80 +1385,45 @@ const it = () => {
|
|
|
1257
1385
|
}
|
|
1258
1386
|
});
|
|
1259
1387
|
},
|
|
1260
|
-
frameToBounds: (
|
|
1261
|
-
if (!
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
), p = Math.max(
|
|
1267
|
-
|
|
1388
|
+
frameToBounds: (i, r = 1.75) => {
|
|
1389
|
+
if (!i) return;
|
|
1390
|
+
const c = t.get(), a = s(), u = new k.Vector3(
|
|
1391
|
+
i.center.x,
|
|
1392
|
+
i.center.y + i.size.y * eo,
|
|
1393
|
+
i.center.z
|
|
1394
|
+
), p = Math.max(i.size.x, i.size.y, i.size.z), P = k.MathUtils.degToRad(a.fov), w = p / 2 / Math.tan(P / 2) * r;
|
|
1395
|
+
c.target.copy(u), a.position.set(u.x, u.y + i.size.y * to, u.z + w), a.near = w / 100, a.far = w * 100, a.updateProjectionMatrix(), c.update();
|
|
1268
1396
|
},
|
|
1269
1397
|
syncToStore: t.syncToStore,
|
|
1270
1398
|
applyFromStore: t.applyFromStore
|
|
1271
1399
|
};
|
|
1272
1400
|
};
|
|
1273
|
-
let
|
|
1274
|
-
const
|
|
1401
|
+
let de = null;
|
|
1402
|
+
const so = () => {
|
|
1275
1403
|
const e = () => {
|
|
1276
|
-
const s =
|
|
1277
|
-
return
|
|
1278
|
-
s.loading.active = !0, s.loading.url =
|
|
1279
|
-
},
|
|
1404
|
+
const s = T();
|
|
1405
|
+
return de = new k.LoadingManager(), de.onStart = function(o) {
|
|
1406
|
+
s.loading.active = !0, s.loading.url = o, s.loading.percent = 0;
|
|
1407
|
+
}, de.onError = () => {
|
|
1280
1408
|
s.loading.active = !1, s.loading.url = null;
|
|
1281
|
-
},
|
|
1409
|
+
}, de.onLoad = function() {
|
|
1282
1410
|
s.loading.active = !1, s.loading.url = null, s.loading.percent = 100;
|
|
1283
|
-
},
|
|
1284
|
-
s.loading.percent = Math.round(
|
|
1285
|
-
},
|
|
1286
|
-
};
|
|
1287
|
-
return { get: () => (le || e(), le) };
|
|
1288
|
-
};
|
|
1289
|
-
let _ = null, Oe = null, $e = null;
|
|
1290
|
-
const at = () => {
|
|
1291
|
-
const e = A(), { get: t } = we(), { getCamera: s } = Le(), { width: i, height: r, subjectLoaded: n } = $(e);
|
|
1292
|
-
function o(D) {
|
|
1293
|
-
return console.debug("useRenderer init"), _ ? (console.debug("renderer already inited"), _) : (_ = new I.WebGLRenderer({ antialias: !0, alpha: !0 }), _.setSize(i.value, r.value), _.toneMapping = I.ACESFilmicToneMapping, _.toneMappingExposure = 0.8, _.shadowMap.enabled = !0, _.shadowMap.type = I.PCFSoftShadowMap, _.outputColorSpace = I.SRGBColorSpace, D && D.appendChild(_.domElement), e.loaded.renderer = !0, _);
|
|
1294
|
-
}
|
|
1295
|
-
const l = () => {
|
|
1296
|
-
if (!_) throw new Error("Renderer has not been initialized");
|
|
1297
|
-
return _;
|
|
1298
|
-
}, a = (D) => {
|
|
1299
|
-
_ && (_.toneMappingExposure = D);
|
|
1300
|
-
}, u = () => {
|
|
1301
|
-
const D = t(), w = s();
|
|
1302
|
-
!D || !w || _.render(D, w);
|
|
1303
|
-
};
|
|
1304
|
-
Oe = O(
|
|
1305
|
-
() => [i.value, r.value],
|
|
1306
|
-
([D, w]) => {
|
|
1307
|
-
!D || !w || !_ || _.setSize(D, w);
|
|
1308
|
-
}
|
|
1309
|
-
), $e = O(
|
|
1310
|
-
() => n.value,
|
|
1311
|
-
() => u()
|
|
1312
|
-
);
|
|
1313
|
-
function p() {
|
|
1314
|
-
console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), $e == null || $e(), Oe = null, $e = null, _ && (_.domElement.parentElement && _.domElement.parentElement.removeChild(_.domElement), _.dispose(), _ = null);
|
|
1315
|
-
}
|
|
1316
|
-
return {
|
|
1317
|
-
init: o,
|
|
1318
|
-
get: l,
|
|
1319
|
-
dispose: p,
|
|
1320
|
-
render: u,
|
|
1321
|
-
setExposure: a
|
|
1411
|
+
}, de.onProgress = function(o, n, i) {
|
|
1412
|
+
s.loading.percent = Math.round(n / i * 100);
|
|
1413
|
+
}, de;
|
|
1322
1414
|
};
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
(
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1415
|
+
return { get: () => (de || e(), de) };
|
|
1416
|
+
}, oo = /hair|lash|brow|eye|cornea|sclera|iris|pupil|tear|teeth|tongue|mouth|gum|lip|nail/i, no = (e, t, s = {}) => {
|
|
1417
|
+
const { removeSpecular: o = !1, removeShininess: n = !1 } = s;
|
|
1418
|
+
e && e.traverse((i) => {
|
|
1419
|
+
if (!i.isMesh) return;
|
|
1420
|
+
(Array.isArray(i.material) ? i.material : [i.material]).forEach((c) => {
|
|
1421
|
+
if (!c) return;
|
|
1422
|
+
const a = `${i.name} ${c.name || ""}`;
|
|
1423
|
+
oo.test(a) || (c.color && c.color.set(t), o && c.specular && c.specular.set(0), n && typeof c.shininess == "number" && (c.shininess = 0), c.needsUpdate = !0);
|
|
1331
1424
|
});
|
|
1332
1425
|
});
|
|
1333
|
-
},
|
|
1426
|
+
}, ro = 1, io = "https://www.gstatic.com/draco/v1/decoders/", dt = {
|
|
1334
1427
|
roughnessFloor: 0.85,
|
|
1335
1428
|
metalness: null,
|
|
1336
1429
|
envMapIntensity: null,
|
|
@@ -1339,8 +1432,8 @@ const at = () => {
|
|
|
1339
1432
|
ambientIntensity: 0.2,
|
|
1340
1433
|
spotIntensity: 1,
|
|
1341
1434
|
envIntensity: 1
|
|
1342
|
-
},
|
|
1343
|
-
nude: { ...
|
|
1435
|
+
}, ao = {
|
|
1436
|
+
nude: { ...dt },
|
|
1344
1437
|
// Smooth ships with no texture maps — pure-white sculpting reference.
|
|
1345
1438
|
// All "detail" has to come from form-revealing shading on the
|
|
1346
1439
|
// geometry, not from albedo. Same metalness=1 Diffeomorphic bug as
|
|
@@ -1349,7 +1442,7 @@ const at = () => {
|
|
|
1349
1442
|
// exposure so lit surfaces don't saturate to white. The contrast
|
|
1350
1443
|
// between lit and unlit faces is what makes form readable.
|
|
1351
1444
|
smooth: {
|
|
1352
|
-
...
|
|
1445
|
+
...dt,
|
|
1353
1446
|
roughnessFloor: 0.3,
|
|
1354
1447
|
metalness: 0,
|
|
1355
1448
|
envMapIntensity: 0.02,
|
|
@@ -1367,194 +1460,194 @@ const at = () => {
|
|
|
1367
1460
|
envIntensity: 1
|
|
1368
1461
|
}
|
|
1369
1462
|
};
|
|
1370
|
-
let
|
|
1371
|
-
const
|
|
1372
|
-
const { get: e } =
|
|
1373
|
-
const { setExposure:
|
|
1374
|
-
s.subjectLoaded = !1,
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
var
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1382
|
-
|
|
1383
|
-
var
|
|
1384
|
-
if (!
|
|
1385
|
-
(
|
|
1386
|
-
const
|
|
1387
|
-
Array.isArray(
|
|
1463
|
+
let we = null, pe = null, Ae, jt = 0, se = dt;
|
|
1464
|
+
const Gt = () => {
|
|
1465
|
+
const { get: e } = so(), t = ae(), s = T(), o = Fe(), n = Mt(), { selected: i } = O(s), { url: r } = O(t), { subjectHex: c } = O(n), { offset: a } = O(o), { getCamera: u } = Re(), { get: p } = Ie(), { render: P } = Xe(), w = (b) => {
|
|
1466
|
+
const { setExposure: D } = Xe(), L = ge(), F = ++jt;
|
|
1467
|
+
s.subjectLoaded = !1, m();
|
|
1468
|
+
const N = e();
|
|
1469
|
+
pe || (pe = new As(N), pe.setDecoderPath(io));
|
|
1470
|
+
const K = new Bs(N);
|
|
1471
|
+
K.setDRACOLoader(pe), K.setWithCredentials(!0), K.manager.setURLModifier((v) => v), K.load(b, (v) => {
|
|
1472
|
+
var S;
|
|
1473
|
+
const h = v == null ? void 0 : v.scene;
|
|
1474
|
+
if (F !== jt) {
|
|
1475
|
+
h == null || h.traverse((l) => {
|
|
1476
|
+
var M;
|
|
1477
|
+
if (!l.isMesh) return;
|
|
1478
|
+
(M = l.geometry) == null || M.dispose();
|
|
1479
|
+
const f = l.material;
|
|
1480
|
+
Array.isArray(f) ? f.forEach((I) => I == null ? void 0 : I.dispose()) : f == null || f.dispose();
|
|
1388
1481
|
});
|
|
1389
1482
|
return;
|
|
1390
1483
|
}
|
|
1391
|
-
if (!
|
|
1484
|
+
if (!h)
|
|
1392
1485
|
return;
|
|
1393
|
-
|
|
1394
|
-
const
|
|
1395
|
-
z.name = "GLBSubject", z.add(
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1398
|
-
if (!
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
)),
|
|
1486
|
+
we = h, se = ao[(S = t.model) == null ? void 0 : S.slug] || dt, D(se.exposure), L.seedFromRecipe(s.selected, se);
|
|
1487
|
+
const A = p(), j = u(), z = new k.Group();
|
|
1488
|
+
z.name = "GLBSubject", z.add(h);
|
|
1489
|
+
const $ = /brow|lash/i;
|
|
1490
|
+
h.traverse((l) => {
|
|
1491
|
+
if (!l.isMesh) return;
|
|
1492
|
+
l.castShadow = !0, l.receiveShadow = !0;
|
|
1493
|
+
const f = Array.isArray(l.material) ? l.material : [l.material], M = `${l.name} ${f.map((E) => E == null ? void 0 : E.name).join(" ")}`, I = $.test(M);
|
|
1494
|
+
f.forEach((E) => {
|
|
1495
|
+
E && (se.roughnessFloor !== null && typeof E.roughness == "number" && (E.roughness = Math.max(
|
|
1496
|
+
E.roughness,
|
|
1497
|
+
se.roughnessFloor
|
|
1498
|
+
)), se.metalness !== null && typeof E.metalness == "number" && (E.metalness = se.metalness), se.envMapIntensity !== null && typeof E.envMapIntensity == "number" && (E.envMapIntensity = se.envMapIntensity), E.transparent && I && (E.alphaTest = 0.2, E.depthWrite = !0), E.needsUpdate = !0);
|
|
1406
1499
|
});
|
|
1407
|
-
}),
|
|
1408
|
-
const Y =
|
|
1409
|
-
z.position.y -= Y.bottom, z.updateMatrixWorld(!0),
|
|
1410
|
-
const
|
|
1411
|
-
t.setBounds(
|
|
1500
|
+
}), se.applyTint && no(h, c.value), h.scale.setScalar(ro), h.updateMatrixWorld(!0);
|
|
1501
|
+
const Y = Vt(h);
|
|
1502
|
+
z.position.y -= Y.bottom, z.updateMatrixWorld(!0), A.add(z), we = z;
|
|
1503
|
+
const Z = Vt(z);
|
|
1504
|
+
t.setBounds(Z), P(A, j), s.subjectLoaded = !0;
|
|
1412
1505
|
});
|
|
1413
|
-
},
|
|
1414
|
-
if (!
|
|
1415
|
-
p().remove(
|
|
1416
|
-
var
|
|
1417
|
-
if (!
|
|
1418
|
-
(
|
|
1419
|
-
const
|
|
1420
|
-
Array.isArray(
|
|
1421
|
-
}),
|
|
1422
|
-
},
|
|
1423
|
-
if (
|
|
1506
|
+
}, m = () => {
|
|
1507
|
+
if (!we) return;
|
|
1508
|
+
p().remove(we), we.traverse((D) => {
|
|
1509
|
+
var F;
|
|
1510
|
+
if (!D.isMesh) return;
|
|
1511
|
+
(F = D.geometry) == null || F.dispose();
|
|
1512
|
+
const L = D.material;
|
|
1513
|
+
Array.isArray(L) ? L.forEach((N) => N == null ? void 0 : N.dispose()) : L == null || L.dispose();
|
|
1514
|
+
}), we = null, s.subjectLoaded = !1;
|
|
1515
|
+
}, g = () => we, y = () => {
|
|
1516
|
+
if (Ae) {
|
|
1424
1517
|
console.warn("useGLB.init() called more than once");
|
|
1425
1518
|
return;
|
|
1426
1519
|
}
|
|
1427
|
-
|
|
1428
|
-
() =>
|
|
1429
|
-
(
|
|
1430
|
-
!
|
|
1520
|
+
Ae = G(
|
|
1521
|
+
() => i.value,
|
|
1522
|
+
(b, D) => {
|
|
1523
|
+
!b || b === D || r.value && w(r.value);
|
|
1431
1524
|
},
|
|
1432
1525
|
{ immediate: !0 }
|
|
1433
1526
|
);
|
|
1434
|
-
},
|
|
1435
|
-
|
|
1527
|
+
}, x = () => {
|
|
1528
|
+
Ae == null || Ae(), Ae = null, m(), pe == null || pe.dispose(), pe = null;
|
|
1436
1529
|
};
|
|
1437
|
-
return
|
|
1438
|
-
|
|
1439
|
-
}), { init:
|
|
1440
|
-
},
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1443
|
-
const
|
|
1444
|
-
const a =
|
|
1445
|
-
|
|
1530
|
+
return Ut(() => {
|
|
1531
|
+
x();
|
|
1532
|
+
}), { init: y, get: g, dispose: x };
|
|
1533
|
+
}, lo = (e, t, s = 500) => {
|
|
1534
|
+
const o = e.material;
|
|
1535
|
+
o.transparent = !0;
|
|
1536
|
+
const n = o.opacity, i = performance.now(), r = (c) => {
|
|
1537
|
+
const a = c - i, u = Math.min(a / s, 1), p = n + (t - n) * u;
|
|
1538
|
+
o.opacity = p, u < 1 && requestAnimationFrame(r);
|
|
1446
1539
|
};
|
|
1447
|
-
requestAnimationFrame(
|
|
1448
|
-
},
|
|
1449
|
-
let
|
|
1450
|
-
const
|
|
1451
|
-
const e =
|
|
1452
|
-
const
|
|
1453
|
-
size:
|
|
1454
|
-
divisions:
|
|
1455
|
-
color:
|
|
1456
|
-
centerColor:
|
|
1457
|
-
}), z = w(
|
|
1458
|
-
return new
|
|
1459
|
-
},
|
|
1460
|
-
const z =
|
|
1461
|
-
Y.push(
|
|
1462
|
-
const U =
|
|
1463
|
-
|
|
1540
|
+
requestAnimationFrame(r);
|
|
1541
|
+
}, co = 34815;
|
|
1542
|
+
let _ = null, He = null, Je = null, Ke = null;
|
|
1543
|
+
const Ot = () => {
|
|
1544
|
+
const e = ve(), t = Fe(), s = ae(), { show: o, divisions: n, size: i, opacity: r } = O(e), { offset: c } = O(t), { bounds: a } = O(s), { get: u } = Ie(), p = () => {
|
|
1545
|
+
const v = D(co), h = v, { positions: A, colors: j } = P({
|
|
1546
|
+
size: i.value,
|
|
1547
|
+
divisions: n.value,
|
|
1548
|
+
color: v,
|
|
1549
|
+
centerColor: h
|
|
1550
|
+
}), z = w(A, j), $ = m(r.value);
|
|
1551
|
+
return new k.LineSegments(z, $);
|
|
1552
|
+
}, P = ({ size: v, divisions: h, color: A, centerColor: j }) => {
|
|
1553
|
+
const z = v / 2, $ = v / h, Y = [], Z = [], S = Math.floor(h / 2), l = (f, M, I, E) => {
|
|
1554
|
+
Y.push(f, M, I);
|
|
1555
|
+
const U = E ? j : A;
|
|
1556
|
+
Z.push(U.r, U.g, U.b);
|
|
1464
1557
|
};
|
|
1465
|
-
for (let
|
|
1466
|
-
const
|
|
1467
|
-
for (let
|
|
1468
|
-
const U = -z +
|
|
1469
|
-
|
|
1558
|
+
for (let f = 0; f <= h; f++) {
|
|
1559
|
+
const M = -z + f * $, I = f === S;
|
|
1560
|
+
for (let E = 0; E <= h; E++) {
|
|
1561
|
+
const U = -z + E * $, J = I || E === S;
|
|
1562
|
+
l(-z, M, U, J), l(+z, M, U, J);
|
|
1470
1563
|
}
|
|
1471
1564
|
}
|
|
1472
|
-
for (let
|
|
1473
|
-
const
|
|
1474
|
-
for (let
|
|
1475
|
-
const U = -z +
|
|
1476
|
-
|
|
1565
|
+
for (let f = 0; f <= h; f++) {
|
|
1566
|
+
const M = -z + f * $, I = f === S;
|
|
1567
|
+
for (let E = 0; E <= h; E++) {
|
|
1568
|
+
const U = -z + E * $, J = I || E === S;
|
|
1569
|
+
l(M, -z, U, J), l(M, +z, U, J);
|
|
1477
1570
|
}
|
|
1478
1571
|
}
|
|
1479
|
-
for (let
|
|
1480
|
-
const
|
|
1481
|
-
for (let
|
|
1482
|
-
const U = -z +
|
|
1483
|
-
|
|
1572
|
+
for (let f = 0; f <= h; f++) {
|
|
1573
|
+
const M = -z + f * $, I = f === S;
|
|
1574
|
+
for (let E = 0; E <= h; E++) {
|
|
1575
|
+
const U = -z + E * $, J = I || E === S;
|
|
1576
|
+
l(M, U, -z, J), l(M, U, +z, J);
|
|
1484
1577
|
}
|
|
1485
1578
|
}
|
|
1486
|
-
return { positions: Y, colors:
|
|
1487
|
-
}, w = (
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1579
|
+
return { positions: Y, colors: Z };
|
|
1580
|
+
}, w = (v, h) => {
|
|
1581
|
+
const A = new k.BufferGeometry();
|
|
1582
|
+
return A.setAttribute(
|
|
1490
1583
|
"position",
|
|
1491
|
-
new
|
|
1492
|
-
),
|
|
1493
|
-
},
|
|
1584
|
+
new k.Float32BufferAttribute(v, 3)
|
|
1585
|
+
), A.setAttribute("color", new k.Float32BufferAttribute(h, 3)), A;
|
|
1586
|
+
}, m = (v) => new k.LineBasicMaterial({
|
|
1494
1587
|
transparent: !0,
|
|
1495
|
-
opacity:
|
|
1588
|
+
opacity: v,
|
|
1496
1589
|
depthWrite: !1,
|
|
1497
|
-
blending:
|
|
1590
|
+
blending: k.NormalBlending,
|
|
1498
1591
|
vertexColors: !0
|
|
1499
|
-
}),
|
|
1500
|
-
|
|
1501
|
-
},
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1504
|
-
},
|
|
1505
|
-
|
|
1506
|
-
},
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1509
|
-
},
|
|
1510
|
-
r: (
|
|
1511
|
-
g: (
|
|
1512
|
-
b: (
|
|
1513
|
-
}),
|
|
1514
|
-
if (!
|
|
1515
|
-
const
|
|
1516
|
-
for (let
|
|
1517
|
-
const
|
|
1518
|
-
z.setXYZ(
|
|
1592
|
+
}), g = () => {
|
|
1593
|
+
_ && b(o.value);
|
|
1594
|
+
}, y = () => {
|
|
1595
|
+
const v = u();
|
|
1596
|
+
_ = p(), N(), v.add(_), x(0);
|
|
1597
|
+
}, x = (v) => {
|
|
1598
|
+
_ && (_.material.transparent = !0, v = o.value ? v : 0, _.material.opacity = v);
|
|
1599
|
+
}, b = (v) => {
|
|
1600
|
+
const h = v ? r.value : 0;
|
|
1601
|
+
lo(_, h, 500);
|
|
1602
|
+
}, D = (v) => ({
|
|
1603
|
+
r: (v >> 16 & 255) / 255,
|
|
1604
|
+
g: (v >> 8 & 255) / 255,
|
|
1605
|
+
b: (v & 255) / 255
|
|
1606
|
+
}), L = (v, h) => {
|
|
1607
|
+
if (!_) return;
|
|
1608
|
+
const A = D(v), j = D(h), z = _.geometry.attributes.color, $ = _.geometry.attributes.position, Y = $.count, Z = i.value / 2, S = i.value / n.value, l = Math.floor(n.value / 2);
|
|
1609
|
+
for (let f = 0; f < Y; f++) {
|
|
1610
|
+
const M = $.getX(f), I = $.getY(f), E = $.getZ(f), U = Math.round((M + Z) / S), be = Math.round((I + Z) / S), J = Math.round((E + Z) / S), _e = U === l || be === l || J === l ? A : j;
|
|
1611
|
+
z.setXYZ(f, _e.r, _e.g, _e.b);
|
|
1519
1612
|
}
|
|
1520
1613
|
z.needsUpdate = !0;
|
|
1521
|
-
},
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
},
|
|
1525
|
-
var
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1614
|
+
}, F = () => {
|
|
1615
|
+
const v = u();
|
|
1616
|
+
_ && (v.remove(_), _.geometry.dispose(), _.material.dispose(), _ = null), _ = p(), N(), v.add(_);
|
|
1617
|
+
}, N = () => {
|
|
1618
|
+
var h;
|
|
1619
|
+
const v = ((h = a.value) == null ? void 0 : h.bottom) || 0;
|
|
1620
|
+
_.position.set(0, v + i.value / 2 + 7e-3, 0);
|
|
1528
1621
|
};
|
|
1529
|
-
return
|
|
1530
|
-
() => [
|
|
1531
|
-
([
|
|
1532
|
-
|
|
1622
|
+
return He = G(
|
|
1623
|
+
() => [i.value, n.value],
|
|
1624
|
+
([v, h], [A, j]) => {
|
|
1625
|
+
v === A && h === j || (F(), g());
|
|
1533
1626
|
},
|
|
1534
1627
|
{ flush: "post" }
|
|
1535
|
-
),
|
|
1536
|
-
() =>
|
|
1628
|
+
), Je = G(
|
|
1629
|
+
() => o.value,
|
|
1537
1630
|
() => {
|
|
1538
|
-
|
|
1631
|
+
g();
|
|
1539
1632
|
},
|
|
1540
1633
|
{ flush: "post" }
|
|
1541
|
-
),
|
|
1542
|
-
() =>
|
|
1543
|
-
(
|
|
1544
|
-
|
|
1634
|
+
), Ke = G(
|
|
1635
|
+
() => r.value,
|
|
1636
|
+
(v) => {
|
|
1637
|
+
x(v);
|
|
1545
1638
|
},
|
|
1546
1639
|
{ flush: "post" }
|
|
1547
1640
|
), {
|
|
1548
|
-
init:
|
|
1549
|
-
showHideGrid:
|
|
1550
|
-
updateGridColors:
|
|
1641
|
+
init: y,
|
|
1642
|
+
showHideGrid: b,
|
|
1643
|
+
updateGridColors: L,
|
|
1551
1644
|
dispose: () => {
|
|
1552
|
-
var
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1645
|
+
var h, A;
|
|
1646
|
+
const v = u();
|
|
1647
|
+
He == null || He(), Je == null || Je(), Ke == null || Ke(), He = null, Je = null, Ke = null, _ && (v.remove(_), (h = _.geometry) == null || h.dispose(), Array.isArray(_.material) ? _.material.forEach((j) => j == null ? void 0 : j.dispose()) : (A = _.material) == null || A.dispose(), _ = null);
|
|
1555
1648
|
}
|
|
1556
1649
|
};
|
|
1557
|
-
},
|
|
1650
|
+
}, uo = { class: "three-dimension-tool" }, po = ["data-id"], mo = /* @__PURE__ */ Object.assign({
|
|
1558
1651
|
name: "ThreeDimensionTool",
|
|
1559
1652
|
slug: "three-dimension-tool",
|
|
1560
1653
|
inheritAttrs: !1
|
|
@@ -1566,82 +1659,95 @@ const Gt = () => {
|
|
|
1566
1659
|
setup(e) {
|
|
1567
1660
|
const t = e;
|
|
1568
1661
|
let s = null;
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
const
|
|
1572
|
-
if (!
|
|
1662
|
+
const o = C(() => Number(t.id)), n = T(), i = pt(), r = ge(), c = ae(), { move: a } = O(r), { isFrozen: u } = O(n), p = he(null), P = he(!1);
|
|
1663
|
+
let w, m, g;
|
|
1664
|
+
const y = ct(), x = Bt(), b = At(), { init: D, setEnvironment: L } = Ie(), { init: F } = Xe(), { init: N } = Re(), { init: K, updateVisibility: v } = _t(), { init: h, updatePosition: A } = ut(), { init: j } = Gt(), { init: z } = Ot(), $ = () => {
|
|
1665
|
+
if (!p.value || P.value) {
|
|
1573
1666
|
console.warn("Canvas element not found");
|
|
1574
1667
|
return;
|
|
1575
1668
|
}
|
|
1576
|
-
|
|
1577
|
-
}, j = () => {
|
|
1578
|
-
p.value && (a.value !== s && (s = a.value, a.value ? E.activate() : S.activate()), f.update(), a.value ? (m(), E.syncToStore()) : S.syncToStore(), Z(), w.render(h, D), requestAnimationFrame(j));
|
|
1669
|
+
P.value = !0, g = D(), m = F(p.value), L(m), j(), w = N(), h(), z(), K(), y.init(m), Y();
|
|
1579
1670
|
}, Y = () => {
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1671
|
+
P.value && (a.value !== s && (s = a.value, a.value ? b.activate() : x.activate()), y.update(), a.value ? (A(), b.syncToStore()) : x.syncToStore(), v(), m.render(g, w), requestAnimationFrame(Y));
|
|
1672
|
+
}, Z = () => {
|
|
1673
|
+
if (p.value) {
|
|
1674
|
+
const l = window.innerWidth, f = window.innerHeight;
|
|
1675
|
+
n.$patch({ width: l, height: f }), p.value.style.height = f + "px";
|
|
1583
1676
|
}
|
|
1677
|
+
}, S = () => {
|
|
1678
|
+
u.value && n.pokeFreeze();
|
|
1584
1679
|
};
|
|
1585
|
-
return
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
(
|
|
1589
|
-
|
|
1590
|
-
|
|
1680
|
+
return G(u, (l) => {
|
|
1681
|
+
var M;
|
|
1682
|
+
const f = (M = y.get) == null ? void 0 : M.call(y);
|
|
1683
|
+
f && (f.enabled = !l);
|
|
1684
|
+
}), G(
|
|
1685
|
+
() => [i.applyRevision, r.applyRevision],
|
|
1686
|
+
() => {
|
|
1687
|
+
P.value && (b.activate(), A(), x.activate());
|
|
1688
|
+
}
|
|
1689
|
+
), $t(() => {
|
|
1690
|
+
var l;
|
|
1691
|
+
console.log("onMounted", p.value), $(), window.addEventListener("resize", Z), Z(), (l = p.value) == null || l.addEventListener("pointerdown", S, !0);
|
|
1692
|
+
}), G(
|
|
1693
|
+
() => c.bounds,
|
|
1694
|
+
(l) => {
|
|
1695
|
+
l && (b.activate(), r.hasRig || (b.frameToBounds(l), b.syncToStore(), r.markFramed()), x.activate(), i.hasRig || (x.frameToBounds(l), x.syncToStore(), i.markFramed()));
|
|
1591
1696
|
}
|
|
1592
|
-
),
|
|
1593
|
-
() =>
|
|
1594
|
-
(
|
|
1595
|
-
if (!
|
|
1596
|
-
const
|
|
1597
|
-
if (!
|
|
1598
|
-
|
|
1599
|
-
const
|
|
1600
|
-
|
|
1697
|
+
), G(
|
|
1698
|
+
() => n.subjectLoaded,
|
|
1699
|
+
(l) => {
|
|
1700
|
+
if (!l) return;
|
|
1701
|
+
const f = c.bounds;
|
|
1702
|
+
if (!f) return;
|
|
1703
|
+
i.hasRig || (y.frameToBounds(f), i.markFramed());
|
|
1704
|
+
const M = y.get();
|
|
1705
|
+
M.update(), M.saveState();
|
|
1601
1706
|
}
|
|
1602
|
-
),
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1707
|
+
), Ut(() => {
|
|
1708
|
+
var l;
|
|
1709
|
+
console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), (l = p.value) == null || l.removeEventListener("pointerdown", S, !0), P.value = !1, Gt().dispose(), Ot().dispose(), _t().dispose(), ut().dispose(), ct().dispose(), Re().dispose(), Ie().dispose(), Xe().dispose();
|
|
1710
|
+
}), (l, f) => (at(), us("div", uo, [
|
|
1711
|
+
wt("", !0),
|
|
1712
|
+
ds("div", {
|
|
1607
1713
|
class: "tres",
|
|
1608
1714
|
ref_key: "tres",
|
|
1609
|
-
ref:
|
|
1610
|
-
"data-id":
|
|
1611
|
-
}, null, 8,
|
|
1715
|
+
ref: p,
|
|
1716
|
+
"data-id": o.value
|
|
1717
|
+
}, null, 8, po)
|
|
1612
1718
|
]));
|
|
1613
1719
|
}
|
|
1614
|
-
}),
|
|
1615
|
-
const t =
|
|
1616
|
-
const
|
|
1617
|
-
if (
|
|
1720
|
+
}), Nt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CwHAnjEe.js") }), q = (e = "../i18n") => {
|
|
1721
|
+
const t = ys(), s = he({}), o = C(() => t.lang.isoName || "en-US"), n = async () => {
|
|
1722
|
+
const i = `${e}/${o.value}/index.js`;
|
|
1723
|
+
if (Nt[i])
|
|
1618
1724
|
try {
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1621
|
-
} catch (
|
|
1622
|
-
console.error(`Error loading i18n for ${
|
|
1725
|
+
const r = await Nt[i]();
|
|
1726
|
+
r.default && Object.assign(s.value, r.default);
|
|
1727
|
+
} catch (r) {
|
|
1728
|
+
console.error(`Error loading i18n for ${o.value}`, r);
|
|
1623
1729
|
}
|
|
1624
1730
|
else
|
|
1625
|
-
console.error(`Module not found: ${
|
|
1731
|
+
console.error(`Module not found: ${i}`);
|
|
1626
1732
|
};
|
|
1627
|
-
return
|
|
1628
|
-
() =>
|
|
1733
|
+
return G(
|
|
1734
|
+
() => o.value,
|
|
1629
1735
|
() => {
|
|
1630
|
-
|
|
1736
|
+
n();
|
|
1631
1737
|
},
|
|
1632
1738
|
{ immediate: !0 }
|
|
1633
|
-
),
|
|
1634
|
-
|
|
1739
|
+
), ps(() => {
|
|
1740
|
+
n();
|
|
1635
1741
|
}), { lang: s };
|
|
1636
|
-
},
|
|
1637
|
-
const
|
|
1638
|
-
get: () =>
|
|
1742
|
+
}, ke = 26, X = ({ tab: e = ne, store: t, options: s = [] }) => {
|
|
1743
|
+
const o = Cs(), n = T(o), i = C({
|
|
1744
|
+
get: () => n.isExpanded(s),
|
|
1639
1745
|
set: (a) => {
|
|
1640
|
-
a &&
|
|
1746
|
+
a && n.setActive(e);
|
|
1641
1747
|
}
|
|
1642
|
-
}),
|
|
1643
|
-
return { click: () =>
|
|
1644
|
-
},
|
|
1748
|
+
}), r = C(() => t && t.changed);
|
|
1749
|
+
return { click: () => n.setActive(e), expanded: i, selected: r };
|
|
1750
|
+
}, zt = V({
|
|
1645
1751
|
name: "ToolResetButton",
|
|
1646
1752
|
props: {
|
|
1647
1753
|
label: { type: String, required: !1, default: "Reset" },
|
|
@@ -1649,33 +1755,45 @@ const Gt = () => {
|
|
|
1649
1755
|
},
|
|
1650
1756
|
emits: ["click"],
|
|
1651
1757
|
setup(e, { slots: t, emit: s }) {
|
|
1652
|
-
function
|
|
1758
|
+
function o() {
|
|
1653
1759
|
s("click");
|
|
1654
1760
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const
|
|
1761
|
+
function n() {
|
|
1762
|
+
const i = {
|
|
1657
1763
|
label: e.label,
|
|
1658
1764
|
class: "full-width",
|
|
1659
1765
|
flat: !0,
|
|
1660
|
-
onClick:
|
|
1766
|
+
onClick: o,
|
|
1661
1767
|
disable: e.disable
|
|
1662
1768
|
};
|
|
1663
|
-
return d("div", { class: "tool-reset-button q-pa-md" }, d(
|
|
1769
|
+
return d("div", { class: "tool-reset-button q-pa-md" }, d(qt, i));
|
|
1770
|
+
}
|
|
1771
|
+
return () => n();
|
|
1772
|
+
}
|
|
1773
|
+
}), ft = V({
|
|
1774
|
+
name: "FrozenOverlay",
|
|
1775
|
+
setup() {
|
|
1776
|
+
const e = T(), { isFrozen: t } = O(e);
|
|
1777
|
+
function s() {
|
|
1778
|
+
return ms(d("div", {
|
|
1779
|
+
class: "frozen-overlay",
|
|
1780
|
+
onClick: () => e.pokeFreeze()
|
|
1781
|
+
}, []), [[fs, t.value]]);
|
|
1664
1782
|
}
|
|
1665
|
-
return () =>
|
|
1783
|
+
return () => s();
|
|
1666
1784
|
}
|
|
1667
|
-
}),
|
|
1785
|
+
}), es = V({
|
|
1668
1786
|
name: "TdColorsSection",
|
|
1669
1787
|
setup(e, { slots: t, emit: s }) {
|
|
1670
|
-
const { lang:
|
|
1788
|
+
const { lang: o } = q(), n = T(), i = mt(), r = Fe(), { active: c } = O(n), a = he(!1), u = he(!1), p = C(
|
|
1671
1789
|
() => {
|
|
1672
|
-
var
|
|
1673
|
-
return (
|
|
1790
|
+
var v;
|
|
1791
|
+
return (v = o.value.td) == null ? void 0 : v.components.colors.items.background;
|
|
1674
1792
|
}
|
|
1675
|
-
),
|
|
1793
|
+
), P = C(
|
|
1676
1794
|
() => {
|
|
1677
|
-
var
|
|
1678
|
-
return (
|
|
1795
|
+
var v;
|
|
1796
|
+
return (v = o.value.td) == null ? void 0 : v.components.colors.items.ground;
|
|
1679
1797
|
}
|
|
1680
1798
|
), w = C(() => ({
|
|
1681
1799
|
key: p.value,
|
|
@@ -1683,63 +1801,64 @@ const Gt = () => {
|
|
|
1683
1801
|
type: "none",
|
|
1684
1802
|
icon: "f_scene",
|
|
1685
1803
|
size: "sm",
|
|
1686
|
-
color:
|
|
1804
|
+
color: i.colorHex,
|
|
1687
1805
|
onClick: () => a.value = !0
|
|
1688
|
-
})),
|
|
1689
|
-
key:
|
|
1690
|
-
label:
|
|
1806
|
+
})), m = C(() => ({
|
|
1807
|
+
key: P.value,
|
|
1808
|
+
label: P.value,
|
|
1691
1809
|
type: "none",
|
|
1692
1810
|
icon: "f_ground",
|
|
1693
1811
|
size: "sm",
|
|
1694
|
-
color:
|
|
1812
|
+
color: r.colorHex,
|
|
1695
1813
|
onClick: () => u.value = !0
|
|
1696
|
-
})),
|
|
1814
|
+
})), g = C({
|
|
1697
1815
|
get: () => u.value || a.value,
|
|
1698
|
-
set: (
|
|
1699
|
-
}),
|
|
1700
|
-
get: () => u.value ?
|
|
1701
|
-
set: (
|
|
1816
|
+
set: (v) => u.value = a.value = !1
|
|
1817
|
+
}), y = C({
|
|
1818
|
+
get: () => u.value ? r.colorHex : i.colorHex,
|
|
1819
|
+
set: (v) => {
|
|
1702
1820
|
if (u.value) {
|
|
1703
|
-
|
|
1821
|
+
r.setColorHex(v);
|
|
1704
1822
|
return;
|
|
1705
1823
|
}
|
|
1706
|
-
|
|
1824
|
+
i.setColorHex(v);
|
|
1707
1825
|
}
|
|
1708
|
-
}),
|
|
1826
|
+
}), x = C(() => ({
|
|
1709
1827
|
class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md",
|
|
1710
|
-
style:
|
|
1711
|
-
})),
|
|
1712
|
-
modelValue:
|
|
1713
|
-
"onUpdate:modelValue": (
|
|
1714
|
-
show:
|
|
1715
|
-
"onUpdate:show": (
|
|
1716
|
-
label:
|
|
1717
|
-
})),
|
|
1718
|
-
|
|
1719
|
-
},
|
|
1828
|
+
style: g.value ? "display: none" : ""
|
|
1829
|
+
})), b = C(() => ({
|
|
1830
|
+
modelValue: y.value,
|
|
1831
|
+
"onUpdate:modelValue": (v) => y.value = v,
|
|
1832
|
+
show: g.value,
|
|
1833
|
+
"onUpdate:show": (v) => g.value = v,
|
|
1834
|
+
label: D.value
|
|
1835
|
+
})), D = C(() => u.value ? P.value : p.value), L = () => {
|
|
1836
|
+
i.reset(), r.reset();
|
|
1837
|
+
}, F = C(() => r.changed || i.changed), N = C(() => ({
|
|
1720
1838
|
label: "Reset Colors",
|
|
1721
|
-
onClick:
|
|
1722
|
-
style:
|
|
1723
|
-
disable: !
|
|
1839
|
+
onClick: L,
|
|
1840
|
+
style: g.value ? "display: none" : "",
|
|
1841
|
+
disable: !F.value
|
|
1724
1842
|
}));
|
|
1725
|
-
|
|
1726
|
-
|
|
1843
|
+
G(c, (v) => {
|
|
1844
|
+
v !== ne && (g.value = !1);
|
|
1727
1845
|
});
|
|
1728
|
-
function
|
|
1846
|
+
function K() {
|
|
1729
1847
|
return d("div", {
|
|
1730
1848
|
class: "full-width"
|
|
1731
1849
|
}, [
|
|
1732
|
-
d(
|
|
1733
|
-
|
|
1734
|
-
d(
|
|
1850
|
+
d(ft),
|
|
1851
|
+
d("div", x.value, [
|
|
1852
|
+
d(ie, w.value),
|
|
1853
|
+
d(ie, m.value)
|
|
1735
1854
|
]),
|
|
1736
|
-
d(
|
|
1737
|
-
d(
|
|
1855
|
+
d(zt, N.value),
|
|
1856
|
+
d(Ss, b.value)
|
|
1738
1857
|
]);
|
|
1739
1858
|
}
|
|
1740
|
-
return () =>
|
|
1859
|
+
return () => K();
|
|
1741
1860
|
}
|
|
1742
|
-
}),
|
|
1861
|
+
}), fo = V({
|
|
1743
1862
|
name: "TdColorsExpansion",
|
|
1744
1863
|
props: {
|
|
1745
1864
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1748,13 +1867,13 @@ const Gt = () => {
|
|
|
1748
1867
|
},
|
|
1749
1868
|
emits: ["click", "update:modelValue"],
|
|
1750
1869
|
setup(e, { slots: t, emit: s }) {
|
|
1751
|
-
const { lang:
|
|
1752
|
-
store:
|
|
1753
|
-
options:
|
|
1754
|
-
tab:
|
|
1755
|
-
}),
|
|
1870
|
+
const { lang: o } = q(), n = Mt(), { expanded: i, selected: r } = X({
|
|
1871
|
+
store: n,
|
|
1872
|
+
options: ne,
|
|
1873
|
+
tab: ne
|
|
1874
|
+
}), c = C(() => {
|
|
1756
1875
|
var u;
|
|
1757
|
-
return (u =
|
|
1876
|
+
return (u = o.value.td) == null ? void 0 : u.components.colors.title;
|
|
1758
1877
|
});
|
|
1759
1878
|
C({
|
|
1760
1879
|
get: () => e.modelValue,
|
|
@@ -1764,71 +1883,71 @@ const Gt = () => {
|
|
|
1764
1883
|
const u = {
|
|
1765
1884
|
class: "td-colors-expansion",
|
|
1766
1885
|
"data-cy": "td-colors-expansion",
|
|
1767
|
-
modelValue:
|
|
1768
|
-
"onUpdate:modelValue": (p) =>
|
|
1769
|
-
label:
|
|
1770
|
-
selected:
|
|
1886
|
+
modelValue: i.value,
|
|
1887
|
+
"onUpdate:modelValue": (p) => i.value = p,
|
|
1888
|
+
label: c.value,
|
|
1889
|
+
selected: r.value,
|
|
1771
1890
|
icon: "f_palette"
|
|
1772
1891
|
};
|
|
1773
|
-
return d(
|
|
1892
|
+
return d(Ve, u, () => d(es));
|
|
1774
1893
|
}
|
|
1775
1894
|
return () => a();
|
|
1776
1895
|
}
|
|
1777
|
-
}),
|
|
1896
|
+
}), ts = V({
|
|
1778
1897
|
name: "TdGridSection",
|
|
1779
1898
|
setup(e, { slots: t, emit: s }) {
|
|
1780
|
-
const { lang:
|
|
1899
|
+
const { lang: o } = q(), n = ve(), i = C(
|
|
1781
1900
|
() => {
|
|
1782
|
-
var w,
|
|
1783
|
-
return
|
|
1901
|
+
var w, m;
|
|
1902
|
+
return r.value ? ((w = o.value.td) == null ? void 0 : w.components.grid.toggle.off) || "" : ((m = o.value.td) == null ? void 0 : m.components.grid.toggle.on) || "";
|
|
1784
1903
|
}
|
|
1785
|
-
),
|
|
1786
|
-
get: () =>
|
|
1787
|
-
set: (w) =>
|
|
1788
|
-
}),
|
|
1789
|
-
get: () =>
|
|
1790
|
-
set: (w) =>
|
|
1904
|
+
), r = C({
|
|
1905
|
+
get: () => n.show,
|
|
1906
|
+
set: (w) => n.setProperty("show", w)
|
|
1907
|
+
}), c = C({
|
|
1908
|
+
get: () => n.opacity,
|
|
1909
|
+
set: (w) => n.setProperty("opacity", w)
|
|
1791
1910
|
}), a = C({
|
|
1792
|
-
get: () =>
|
|
1793
|
-
set: (w) =>
|
|
1911
|
+
get: () => n.size,
|
|
1912
|
+
set: (w) => n.setProperty("size", w)
|
|
1794
1913
|
}), u = C({
|
|
1795
|
-
get: () =>
|
|
1796
|
-
set: (w) =>
|
|
1914
|
+
get: () => n.divisions,
|
|
1915
|
+
set: (w) => n.setProperty("divisions", w)
|
|
1797
1916
|
}), p = C(() => ({
|
|
1798
1917
|
label: "Reset Grid",
|
|
1799
|
-
disable: !
|
|
1800
|
-
onClick:
|
|
1918
|
+
disable: !n.changed,
|
|
1919
|
+
onClick: n.reset
|
|
1801
1920
|
}));
|
|
1802
|
-
function
|
|
1921
|
+
function P() {
|
|
1803
1922
|
const w = {
|
|
1804
1923
|
class: "td-grid-tool"
|
|
1805
|
-
},
|
|
1924
|
+
}, m = {
|
|
1806
1925
|
access: "grd",
|
|
1807
1926
|
// drawer: !props.noIcons,
|
|
1808
|
-
modelValue:
|
|
1809
|
-
"onUpdate:modelValue": (
|
|
1810
|
-
label:
|
|
1927
|
+
modelValue: r.value,
|
|
1928
|
+
"onUpdate:modelValue": (D) => r.value = D,
|
|
1929
|
+
label: i.value
|
|
1811
1930
|
// dark: props.dark,
|
|
1812
1931
|
// disable: props.disable,
|
|
1813
1932
|
// hasAccess: props.hasAccess,
|
|
1814
1933
|
// onBlockAccess: emitBlockAccess,
|
|
1815
|
-
},
|
|
1934
|
+
}, g = {
|
|
1816
1935
|
title: "Opacity",
|
|
1817
1936
|
icon: "f_opacity",
|
|
1818
1937
|
min: 1,
|
|
1819
1938
|
max: 100,
|
|
1820
1939
|
initial: 50,
|
|
1821
|
-
modelValue:
|
|
1822
|
-
"onUpdate:modelValue": (
|
|
1823
|
-
},
|
|
1940
|
+
modelValue: c.value * 100,
|
|
1941
|
+
"onUpdate:modelValue": (D) => c.value = D / 100
|
|
1942
|
+
}, y = {
|
|
1824
1943
|
title: "Size",
|
|
1825
1944
|
icon: "f_size",
|
|
1826
1945
|
min: 100,
|
|
1827
1946
|
max: 300,
|
|
1828
1947
|
initial: 200,
|
|
1829
1948
|
modelValue: a.value * 100,
|
|
1830
|
-
"onUpdate:modelValue": (
|
|
1831
|
-
},
|
|
1949
|
+
"onUpdate:modelValue": (D) => a.value = D / 100
|
|
1950
|
+
}, x = {
|
|
1832
1951
|
title: "Number of lines",
|
|
1833
1952
|
icon: "f_grid",
|
|
1834
1953
|
min: 2,
|
|
@@ -1837,13 +1956,13 @@ const Gt = () => {
|
|
|
1837
1956
|
step: 2,
|
|
1838
1957
|
initial: 6,
|
|
1839
1958
|
modelValue: u.value,
|
|
1840
|
-
"onUpdate:modelValue": (
|
|
1841
|
-
},
|
|
1842
|
-
return
|
|
1959
|
+
"onUpdate:modelValue": (D) => u.value = D
|
|
1960
|
+
}, b = [d(ft), d(Ht, m)];
|
|
1961
|
+
return r.value && (b.push(d(We, y)), b.push(d(We, x)), b.push(d(We, g)), b.push(d(zt, p.value))), d("div", w, b);
|
|
1843
1962
|
}
|
|
1844
|
-
return () =>
|
|
1963
|
+
return () => P();
|
|
1845
1964
|
}
|
|
1846
|
-
}),
|
|
1965
|
+
}), ho = V({
|
|
1847
1966
|
name: "TdGridExpansion",
|
|
1848
1967
|
props: {
|
|
1849
1968
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1852,13 +1971,13 @@ const Gt = () => {
|
|
|
1852
1971
|
},
|
|
1853
1972
|
emits: ["click", "update:modelValue"],
|
|
1854
1973
|
setup(e, { slots: t, emit: s }) {
|
|
1855
|
-
const { lang:
|
|
1856
|
-
store:
|
|
1857
|
-
options:
|
|
1858
|
-
tab:
|
|
1859
|
-
}),
|
|
1974
|
+
const { lang: o } = q(), n = ve(), { expanded: i, selected: r } = X({
|
|
1975
|
+
store: n,
|
|
1976
|
+
options: Ce,
|
|
1977
|
+
tab: Ce
|
|
1978
|
+
}), c = C(() => {
|
|
1860
1979
|
var u;
|
|
1861
|
-
return (u =
|
|
1980
|
+
return (u = o.value.td) == null ? void 0 : u.components.grid.title;
|
|
1862
1981
|
});
|
|
1863
1982
|
C({
|
|
1864
1983
|
get: () => e.modelValue,
|
|
@@ -1868,17 +1987,17 @@ const Gt = () => {
|
|
|
1868
1987
|
const u = {
|
|
1869
1988
|
class: "td-colors-expansion",
|
|
1870
1989
|
"data-cy": "td-colors-expansion",
|
|
1871
|
-
modelValue:
|
|
1872
|
-
"onUpdate:modelValue": (p) =>
|
|
1873
|
-
label:
|
|
1874
|
-
selected:
|
|
1990
|
+
modelValue: i.value,
|
|
1991
|
+
"onUpdate:modelValue": (p) => i.value = p,
|
|
1992
|
+
label: c.value,
|
|
1993
|
+
selected: r.value,
|
|
1875
1994
|
icon: "f_grid"
|
|
1876
1995
|
};
|
|
1877
|
-
return d(
|
|
1996
|
+
return d(Ve, u, () => d(ts));
|
|
1878
1997
|
}
|
|
1879
1998
|
return () => a();
|
|
1880
1999
|
}
|
|
1881
|
-
}),
|
|
2000
|
+
}), ss = V({
|
|
1882
2001
|
name: "TdLightsSection",
|
|
1883
2002
|
props: {
|
|
1884
2003
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1887,89 +2006,90 @@ const Gt = () => {
|
|
|
1887
2006
|
},
|
|
1888
2007
|
emits: ["click", "update:modelValue"],
|
|
1889
2008
|
setup() {
|
|
1890
|
-
const { lang: e } =
|
|
2009
|
+
const { lang: e } = q(), t = ge(), s = T(), o = ae(), n = ut(), i = At(), r = Bt(), { active: c } = O(s), a = C({
|
|
1891
2010
|
get: () => t.move,
|
|
1892
|
-
set: (
|
|
2011
|
+
set: (h) => t.setMove(h)
|
|
1893
2012
|
}), u = C(
|
|
1894
2013
|
() => {
|
|
1895
|
-
var
|
|
1896
|
-
return t.move ? ((
|
|
2014
|
+
var h, A;
|
|
2015
|
+
return t.move ? ((h = e.value.td) == null ? void 0 : h.components.lights.toggles.position.off) || "" : ((A = e.value.td) == null ? void 0 : A.components.lights.toggles.position.on) || "";
|
|
1897
2016
|
}
|
|
1898
2017
|
), p = C(() => ({
|
|
1899
2018
|
modelValue: a.value,
|
|
1900
|
-
"onUpdate:modelValue": (
|
|
2019
|
+
"onUpdate:modelValue": (h) => a.value = h,
|
|
1901
2020
|
label: u.value
|
|
1902
|
-
})),
|
|
2021
|
+
})), P = C(
|
|
1903
2022
|
() => {
|
|
1904
|
-
var
|
|
1905
|
-
return ((
|
|
2023
|
+
var h;
|
|
2024
|
+
return ((h = e.value.td) == null ? void 0 : h.components.lights.ambientIntensity) || "";
|
|
1906
2025
|
}
|
|
1907
2026
|
), w = C(
|
|
1908
2027
|
() => {
|
|
1909
|
-
var
|
|
1910
|
-
return ((
|
|
2028
|
+
var h;
|
|
2029
|
+
return ((h = e.value.td) == null ? void 0 : h.components.lights.userIntensity) || "";
|
|
1911
2030
|
}
|
|
1912
|
-
),
|
|
1913
|
-
toSlider: (z) => z <=
|
|
1914
|
-
fromSlider: (z) => z <=
|
|
1915
|
-
}),
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
),
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
),
|
|
1924
|
-
title:
|
|
2031
|
+
), m = 0, g = 50, y = 100, x = (h, A, j) => ({
|
|
2032
|
+
toSlider: (z) => z <= A ? m + (z - h) / (A - h) * (g - m) : g + (z - A) / (j - A) * (y - g),
|
|
2033
|
+
fromSlider: (z) => z <= g ? h + (z - m) / (g - m) * (A - h) : A + (z - g) / (y - g) * (j - A)
|
|
2034
|
+
}), b = x(
|
|
2035
|
+
Pe,
|
|
2036
|
+
oe,
|
|
2037
|
+
Et
|
|
2038
|
+
), D = x(
|
|
2039
|
+
Pe,
|
|
2040
|
+
oe,
|
|
2041
|
+
kt
|
|
2042
|
+
), L = (h, A, j, z) => ({
|
|
2043
|
+
title: h,
|
|
1925
2044
|
icon: "f_brightness",
|
|
1926
|
-
min:
|
|
1927
|
-
max:
|
|
1928
|
-
modelValue:
|
|
1929
|
-
"onUpdate:modelValue": (
|
|
1930
|
-
z(
|
|
2045
|
+
min: m,
|
|
2046
|
+
max: y,
|
|
2047
|
+
modelValue: A.toSlider(j),
|
|
2048
|
+
"onUpdate:modelValue": ($) => {
|
|
2049
|
+
z(A.fromSlider($));
|
|
1931
2050
|
}
|
|
1932
|
-
}),
|
|
1933
|
-
() =>
|
|
1934
|
-
|
|
1935
|
-
|
|
2051
|
+
}), F = C(
|
|
2052
|
+
() => L(
|
|
2053
|
+
P.value,
|
|
2054
|
+
b,
|
|
1936
2055
|
t.ambientScale,
|
|
1937
|
-
(
|
|
2056
|
+
(h) => t.setAmbientScale(h)
|
|
1938
2057
|
)
|
|
1939
|
-
),
|
|
1940
|
-
() =>
|
|
2058
|
+
), N = C(
|
|
2059
|
+
() => L(
|
|
1941
2060
|
w.value,
|
|
1942
|
-
|
|
2061
|
+
D,
|
|
1943
2062
|
t.userScale,
|
|
1944
|
-
(
|
|
2063
|
+
(h) => t.setUserScale(h)
|
|
1945
2064
|
)
|
|
1946
|
-
),
|
|
2065
|
+
), K = C(() => ({
|
|
1947
2066
|
label: "Reset Lights",
|
|
1948
2067
|
disable: !t.changed,
|
|
1949
2068
|
onClick: () => {
|
|
1950
|
-
var
|
|
2069
|
+
var A;
|
|
1951
2070
|
t.reset();
|
|
1952
|
-
const
|
|
1953
|
-
|
|
2071
|
+
const h = o.bounds;
|
|
2072
|
+
h && (i.activate(), i.frameToBounds(h), i.syncToStore(), r.activate()), (A = n.applyFromStore) == null || A.call(n);
|
|
1954
2073
|
}
|
|
1955
2074
|
}));
|
|
1956
|
-
|
|
1957
|
-
|
|
2075
|
+
G(c, (h) => {
|
|
2076
|
+
h !== fe && (a.value = !1);
|
|
1958
2077
|
});
|
|
1959
|
-
function
|
|
1960
|
-
const
|
|
2078
|
+
function v() {
|
|
2079
|
+
const h = {
|
|
1961
2080
|
class: "td-lights-tool"
|
|
1962
|
-
},
|
|
1963
|
-
d(
|
|
1964
|
-
d(
|
|
1965
|
-
d(
|
|
1966
|
-
d(
|
|
2081
|
+
}, A = [
|
|
2082
|
+
d(ft),
|
|
2083
|
+
d(Ht, p.value),
|
|
2084
|
+
d(We, F.value),
|
|
2085
|
+
d(We, N.value),
|
|
2086
|
+
d(zt, K.value)
|
|
1967
2087
|
];
|
|
1968
|
-
return d("div",
|
|
2088
|
+
return d("div", h, A);
|
|
1969
2089
|
}
|
|
1970
|
-
return () =>
|
|
2090
|
+
return () => v();
|
|
1971
2091
|
}
|
|
1972
|
-
}),
|
|
2092
|
+
}), go = V({
|
|
1973
2093
|
name: "TdLightExpansion",
|
|
1974
2094
|
props: {
|
|
1975
2095
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1978,13 +2098,13 @@ const Gt = () => {
|
|
|
1978
2098
|
},
|
|
1979
2099
|
emits: ["click", "update:modelValue"],
|
|
1980
2100
|
setup(e, { slots: t, emit: s }) {
|
|
1981
|
-
const { lang:
|
|
1982
|
-
store:
|
|
1983
|
-
options:
|
|
1984
|
-
tab:
|
|
1985
|
-
}),
|
|
2101
|
+
const { lang: o } = q(), n = ge(), { expanded: i, selected: r } = X({
|
|
2102
|
+
store: n,
|
|
2103
|
+
options: fe,
|
|
2104
|
+
tab: fe
|
|
2105
|
+
}), c = C(() => {
|
|
1986
2106
|
var u;
|
|
1987
|
-
return (u =
|
|
2107
|
+
return (u = o.value.td) == null ? void 0 : u.components.lights.title;
|
|
1988
2108
|
});
|
|
1989
2109
|
C({
|
|
1990
2110
|
get: () => e.modelValue,
|
|
@@ -1994,75 +2114,105 @@ const Gt = () => {
|
|
|
1994
2114
|
const u = {
|
|
1995
2115
|
class: "td-lights-expansion",
|
|
1996
2116
|
"data-cy": "td-lights-expansion",
|
|
1997
|
-
modelValue:
|
|
1998
|
-
"onUpdate:modelValue": (p) =>
|
|
1999
|
-
label:
|
|
2000
|
-
selected:
|
|
2117
|
+
modelValue: i.value,
|
|
2118
|
+
"onUpdate:modelValue": (p) => i.value = p,
|
|
2119
|
+
label: c.value,
|
|
2120
|
+
selected: r.value,
|
|
2001
2121
|
icon: "f_bulb_light"
|
|
2002
2122
|
};
|
|
2003
|
-
return d(
|
|
2123
|
+
return d(Ve, u, () => d(ss));
|
|
2004
2124
|
}
|
|
2005
2125
|
return () => a();
|
|
2006
2126
|
}
|
|
2007
|
-
}),
|
|
2127
|
+
}), os = V({
|
|
2008
2128
|
name: "TdRelatedSection",
|
|
2009
2129
|
setup() {
|
|
2010
|
-
const e = Symbol.for("RelatedSection"), t =
|
|
2130
|
+
const e = Symbol.for("RelatedSection"), t = Ze(e);
|
|
2011
2131
|
function s() {
|
|
2012
|
-
const
|
|
2132
|
+
const o = {
|
|
2013
2133
|
class: "td-related-section q-mx-lg q-my-sm"
|
|
2014
|
-
},
|
|
2015
|
-
return t &&
|
|
2134
|
+
}, n = [];
|
|
2135
|
+
return t && n.push(d(t)), d("div", o, n);
|
|
2016
2136
|
}
|
|
2017
2137
|
return () => s();
|
|
2018
2138
|
}
|
|
2019
|
-
}),
|
|
2139
|
+
}), vo = V({
|
|
2020
2140
|
name: "TdRelatedExpansion",
|
|
2021
2141
|
setup(e, { slots: t, emit: s }) {
|
|
2022
|
-
const { expanded:
|
|
2023
|
-
options:
|
|
2024
|
-
tab:
|
|
2025
|
-
}),
|
|
2026
|
-
function
|
|
2027
|
-
const
|
|
2142
|
+
const { expanded: o } = X({
|
|
2143
|
+
options: Ee,
|
|
2144
|
+
tab: Ee
|
|
2145
|
+
}), n = C(() => "Related");
|
|
2146
|
+
function i() {
|
|
2147
|
+
const r = {
|
|
2028
2148
|
class: "td-related-expansion",
|
|
2029
|
-
modelValue:
|
|
2030
|
-
"onUpdate:modelValue": (
|
|
2031
|
-
label:
|
|
2149
|
+
modelValue: o.value,
|
|
2150
|
+
"onUpdate:modelValue": (c) => o.value = c,
|
|
2151
|
+
label: n.value,
|
|
2032
2152
|
icon: "f_related"
|
|
2033
2153
|
};
|
|
2034
|
-
return d(
|
|
2154
|
+
return d(Ve, r, () => d(os));
|
|
2035
2155
|
}
|
|
2036
|
-
return () =>
|
|
2156
|
+
return () => i();
|
|
2157
|
+
}
|
|
2158
|
+
}), ns = V({
|
|
2159
|
+
name: "TdSavedSection",
|
|
2160
|
+
setup() {
|
|
2161
|
+
const e = Symbol.for("SavedSection"), t = Ze(e);
|
|
2162
|
+
function s() {
|
|
2163
|
+
return t ? d("div", {
|
|
2164
|
+
class: "td-saved-section q-mx-lg q-my-sm"
|
|
2165
|
+
}, [d(t)]) : null;
|
|
2166
|
+
}
|
|
2167
|
+
return () => s();
|
|
2168
|
+
}
|
|
2169
|
+
}), bo = V({
|
|
2170
|
+
name: "TdSavedExpansion",
|
|
2171
|
+
setup() {
|
|
2172
|
+
const { expanded: e } = X({
|
|
2173
|
+
options: ke,
|
|
2174
|
+
tab: ke
|
|
2175
|
+
}), t = C(() => "Saved");
|
|
2176
|
+
function s() {
|
|
2177
|
+
const o = {
|
|
2178
|
+
class: "td-saved-expansion",
|
|
2179
|
+
modelValue: e.value,
|
|
2180
|
+
"onUpdate:modelValue": (n) => e.value = n,
|
|
2181
|
+
label: t.value,
|
|
2182
|
+
icon: "f_save"
|
|
2183
|
+
};
|
|
2184
|
+
return d(Ve, o, () => d(ns));
|
|
2185
|
+
}
|
|
2186
|
+
return () => s();
|
|
2037
2187
|
}
|
|
2038
2188
|
});
|
|
2039
|
-
function
|
|
2040
|
-
const { freeServer: e, paidServer: t } =
|
|
2041
|
-
return
|
|
2189
|
+
function yo() {
|
|
2190
|
+
const { freeServer: e, paidServer: t } = Es();
|
|
2191
|
+
return ks({ freeServer: e, paidServer: t });
|
|
2042
2192
|
}
|
|
2043
|
-
const
|
|
2044
|
-
function
|
|
2045
|
-
const e =
|
|
2193
|
+
const So = Symbol.for("activity-tracking"), xo = ["nude", "muscle", "smooth"];
|
|
2194
|
+
function wo() {
|
|
2195
|
+
const e = T(), t = ae(), s = Ze(So, null), { getThumbnail: o } = yo();
|
|
2046
2196
|
return { skins: C(() => {
|
|
2047
|
-
const
|
|
2197
|
+
const i = e.setUuid, r = e.selected, c = {};
|
|
2048
2198
|
return Object.values(t.models).forEach((a) => {
|
|
2049
|
-
!(a != null && a.slug) ||
|
|
2050
|
-
}),
|
|
2051
|
-
const u =
|
|
2199
|
+
!(a != null && a.slug) || c[a.slug] || (c[a.slug] = a);
|
|
2200
|
+
}), xo.filter((a) => c[a]).map((a) => {
|
|
2201
|
+
const u = c[a];
|
|
2052
2202
|
return {
|
|
2053
2203
|
id: u.id,
|
|
2054
2204
|
slug: a,
|
|
2055
2205
|
name: a,
|
|
2056
|
-
imageUrl:
|
|
2057
|
-
selected: u.id ===
|
|
2206
|
+
imageUrl: i ? o({ type: "sets", uuid: i, image: a }) : null,
|
|
2207
|
+
selected: u.id === r,
|
|
2058
2208
|
click: () => {
|
|
2059
|
-
e.selected = u.id, s == null || s.trackEvent(
|
|
2209
|
+
e.selected = u.id, s == null || s.trackEvent(Ls, { value: a });
|
|
2060
2210
|
}
|
|
2061
2211
|
};
|
|
2062
2212
|
});
|
|
2063
2213
|
}) };
|
|
2064
2214
|
}
|
|
2065
|
-
const
|
|
2215
|
+
const Co = V({
|
|
2066
2216
|
name: "TdSkinButton",
|
|
2067
2217
|
props: {
|
|
2068
2218
|
id: { type: Number, required: !0 },
|
|
@@ -2078,8 +2228,8 @@ const go = R({
|
|
|
2078
2228
|
margin: "3px",
|
|
2079
2229
|
marginBottom: e.size === "sm" ? "40px" : "30px"
|
|
2080
2230
|
}));
|
|
2081
|
-
function
|
|
2082
|
-
const
|
|
2231
|
+
function o() {
|
|
2232
|
+
const n = {
|
|
2083
2233
|
class: `td-${e.slug}-button td-skin-button`,
|
|
2084
2234
|
key: e.id,
|
|
2085
2235
|
label: e.label,
|
|
@@ -2091,63 +2241,63 @@ const go = R({
|
|
|
2091
2241
|
selected: e.selected,
|
|
2092
2242
|
onClick: () => t("click")
|
|
2093
2243
|
};
|
|
2094
|
-
return d(
|
|
2244
|
+
return d(ie, n);
|
|
2095
2245
|
}
|
|
2096
|
-
return () =>
|
|
2246
|
+
return () => o();
|
|
2097
2247
|
}
|
|
2098
|
-
}),
|
|
2248
|
+
}), rs = V({
|
|
2099
2249
|
name: "TdSkinsSection",
|
|
2100
2250
|
props: { size: { type: String, default: "sm" } },
|
|
2101
2251
|
setup(e) {
|
|
2102
|
-
const { skins: t } =
|
|
2103
|
-
function
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2252
|
+
const { skins: t } = wo(), { lang: s } = q();
|
|
2253
|
+
function o() {
|
|
2254
|
+
const n = [d(ft)];
|
|
2255
|
+
return t.value.forEach((i) => {
|
|
2256
|
+
var r, c;
|
|
2257
|
+
n.push(
|
|
2258
|
+
d(Co, {
|
|
2259
|
+
id: i.id,
|
|
2260
|
+
slug: i.slug,
|
|
2261
|
+
label: ((c = (r = s.value.td) == null ? void 0 : r.components.skins.items) == null ? void 0 : c[i.slug]) ?? i.slug,
|
|
2262
|
+
image: i.imageUrl,
|
|
2263
|
+
selected: i.selected,
|
|
2113
2264
|
size: e.size,
|
|
2114
|
-
onClick:
|
|
2115
|
-
})
|
|
2116
|
-
|
|
2117
|
-
);
|
|
2118
|
-
return d($t, {}, () => r);
|
|
2265
|
+
onClick: i.click
|
|
2266
|
+
})
|
|
2267
|
+
);
|
|
2268
|
+
}), d(Jt, {}, () => n);
|
|
2119
2269
|
}
|
|
2120
|
-
return () =>
|
|
2270
|
+
return () => o();
|
|
2121
2271
|
}
|
|
2122
|
-
}),
|
|
2272
|
+
}), Eo = V({
|
|
2123
2273
|
name: "TdSkinsExpansion",
|
|
2124
2274
|
setup() {
|
|
2125
|
-
const { lang: e } =
|
|
2126
|
-
options:
|
|
2127
|
-
tab:
|
|
2128
|
-
}),
|
|
2129
|
-
var
|
|
2130
|
-
const
|
|
2131
|
-
return !!
|
|
2132
|
-
}),
|
|
2133
|
-
var
|
|
2134
|
-
return (
|
|
2275
|
+
const { lang: e } = q(), t = ae(), { expanded: s } = X({
|
|
2276
|
+
options: ee,
|
|
2277
|
+
tab: ee
|
|
2278
|
+
}), o = C(() => {
|
|
2279
|
+
var c;
|
|
2280
|
+
const r = (c = t.model) == null ? void 0 : c.slug;
|
|
2281
|
+
return !!r && r !== Wt;
|
|
2282
|
+
}), n = C(() => {
|
|
2283
|
+
var r;
|
|
2284
|
+
return (r = e.value.td) == null ? void 0 : r.components.skins.title;
|
|
2135
2285
|
});
|
|
2136
|
-
function
|
|
2137
|
-
const
|
|
2286
|
+
function i() {
|
|
2287
|
+
const r = {
|
|
2138
2288
|
class: "td-skins-expansion",
|
|
2139
2289
|
"data-cy": "td-skins-expansion",
|
|
2140
2290
|
modelValue: s.value,
|
|
2141
|
-
"onUpdate:modelValue": (
|
|
2142
|
-
label:
|
|
2143
|
-
selected:
|
|
2291
|
+
"onUpdate:modelValue": (c) => s.value = c,
|
|
2292
|
+
label: n.value,
|
|
2293
|
+
selected: o.value,
|
|
2144
2294
|
icon: "f_shirt"
|
|
2145
2295
|
};
|
|
2146
|
-
return d(
|
|
2296
|
+
return d(Ve, r, () => d(rs, { size: "sm", class: "q-py-sm" }));
|
|
2147
2297
|
}
|
|
2148
|
-
return () =>
|
|
2298
|
+
return () => i();
|
|
2149
2299
|
}
|
|
2150
|
-
}),
|
|
2300
|
+
}), is = V({
|
|
2151
2301
|
name: "TdButtons",
|
|
2152
2302
|
props: {
|
|
2153
2303
|
modelValue: { type: Number, default: 0 },
|
|
@@ -2159,334 +2309,434 @@ const go = R({
|
|
|
2159
2309
|
}
|
|
2160
2310
|
},
|
|
2161
2311
|
emits: ["click", "update:modelValue"],
|
|
2162
|
-
setup(e, {
|
|
2163
|
-
const
|
|
2164
|
-
function
|
|
2165
|
-
n.reset(),
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2312
|
+
setup(e, { emit: t }) {
|
|
2313
|
+
const s = Bt(), o = At(), n = pt(), i = ae(), r = ve(), c = Fe(), a = ge(), u = mt(), { changed: p } = O(n), { changed: P } = O(r), { changed: w } = O(c), { changed: m } = O(a), { changed: g } = O(u), y = C(() => !(p.value || P.value || w.value || m.value || g.value));
|
|
2314
|
+
function x() {
|
|
2315
|
+
n.reset(), r.reset(), c.reset(), a.reset(), u.reset();
|
|
2316
|
+
const L = i.bounds;
|
|
2317
|
+
L ? (o.activate(), o.frameToBounds(L), o.syncToStore(), s.activate(), s.frameToBounds(L), s.syncToStore()) : (s.applyFromStore(), o.applyFromStore());
|
|
2318
|
+
}
|
|
2319
|
+
const b = (L) => L.preventDefault();
|
|
2320
|
+
function D() {
|
|
2321
|
+
const F = {
|
|
2322
|
+
style: e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : "",
|
|
2323
|
+
class: e.fixed ? "row justify-center items-center q-pa-md glass-background" : "row justify-center items-center q-pa-md"
|
|
2324
|
+
}, N = {
|
|
2173
2325
|
class: "td-reset-button",
|
|
2174
2326
|
label: "Reset All",
|
|
2175
|
-
onClick:
|
|
2176
|
-
onKeyup:
|
|
2327
|
+
onClick: x,
|
|
2328
|
+
onKeyup: b,
|
|
2177
2329
|
rounded: !0,
|
|
2178
2330
|
unelevated: !0,
|
|
2179
2331
|
outline: !0,
|
|
2180
|
-
disable:
|
|
2332
|
+
disable: y.value
|
|
2181
2333
|
};
|
|
2182
|
-
return d("div",
|
|
2334
|
+
return d("div", F, [d(qt, N)]);
|
|
2335
|
+
}
|
|
2336
|
+
return () => D();
|
|
2337
|
+
}
|
|
2338
|
+
}), as = V({
|
|
2339
|
+
name: "TdPoseButtonsSection",
|
|
2340
|
+
setup() {
|
|
2341
|
+
const e = Symbol.for("PoseButtonsSection"), t = Ze(e, null);
|
|
2342
|
+
function s() {
|
|
2343
|
+
const o = {
|
|
2344
|
+
class: "td-pose-buttons-section"
|
|
2345
|
+
}, n = [];
|
|
2346
|
+
return t && n.push(d(t)), d("div", o, n);
|
|
2183
2347
|
}
|
|
2184
|
-
return () =>
|
|
2348
|
+
return () => s();
|
|
2185
2349
|
}
|
|
2186
|
-
}),
|
|
2350
|
+
}), ko = V({
|
|
2187
2351
|
name: "TdExpansions",
|
|
2188
2352
|
setup(e, { slots: t, emit: s }) {
|
|
2189
|
-
function
|
|
2353
|
+
function o() {
|
|
2190
2354
|
return d("div", {
|
|
2191
2355
|
class: "td-expansions",
|
|
2192
|
-
onClick: (
|
|
2356
|
+
onClick: (i) => i.stopPropagation(),
|
|
2193
2357
|
style: "padding-bottom: 60px; position: relative "
|
|
2194
2358
|
}, [
|
|
2195
|
-
|
|
2196
|
-
d(
|
|
2197
|
-
d(
|
|
2198
|
-
d(
|
|
2199
|
-
d(
|
|
2200
|
-
d(
|
|
2201
|
-
d(
|
|
2202
|
-
d(
|
|
2203
|
-
d(
|
|
2204
|
-
d(
|
|
2359
|
+
d(as),
|
|
2360
|
+
d(ye),
|
|
2361
|
+
d(Eo),
|
|
2362
|
+
d(ye),
|
|
2363
|
+
d(fo),
|
|
2364
|
+
d(ye),
|
|
2365
|
+
d(ho),
|
|
2366
|
+
d(ye),
|
|
2367
|
+
d(go),
|
|
2368
|
+
d(ye),
|
|
2205
2369
|
// h(TsGridExpansion),
|
|
2206
2370
|
// h(QSeparator),
|
|
2207
2371
|
// h(TsAdjustmentExpansion),
|
|
2208
|
-
d(
|
|
2209
|
-
d(
|
|
2372
|
+
d(vo),
|
|
2373
|
+
d(ye),
|
|
2374
|
+
d(bo),
|
|
2375
|
+
d(ye),
|
|
2210
2376
|
// h('div', {}, store.loading.percent),
|
|
2211
|
-
d(
|
|
2377
|
+
d(is)
|
|
2212
2378
|
]);
|
|
2213
2379
|
}
|
|
2214
|
-
return () =>
|
|
2380
|
+
return () => o();
|
|
2215
2381
|
}
|
|
2216
|
-
}),
|
|
2382
|
+
}), Io = V({
|
|
2217
2383
|
name: "TdColorsButton",
|
|
2218
2384
|
props: { size: String },
|
|
2219
2385
|
setup(e, {}) {
|
|
2220
|
-
const t =
|
|
2386
|
+
const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
|
|
2221
2387
|
var p;
|
|
2222
|
-
return (p =
|
|
2223
|
-
}), { click:
|
|
2388
|
+
return (p = n.value.td) == null ? void 0 : p.controls.colors.iconTitle;
|
|
2389
|
+
}), { click: r, selected: c } = X({
|
|
2224
2390
|
store: t,
|
|
2225
|
-
options:
|
|
2226
|
-
tab:
|
|
2391
|
+
options: ne,
|
|
2392
|
+
tab: ne
|
|
2227
2393
|
});
|
|
2228
2394
|
function a(p) {
|
|
2229
2395
|
return s.block(p);
|
|
2230
2396
|
}
|
|
2231
2397
|
function u() {
|
|
2232
2398
|
const p = {
|
|
2233
|
-
hasAccess:
|
|
2234
|
-
selected:
|
|
2235
|
-
onClick:
|
|
2399
|
+
hasAccess: o.value,
|
|
2400
|
+
selected: c.value,
|
|
2401
|
+
onClick: r,
|
|
2236
2402
|
onBlockAccess: a,
|
|
2237
2403
|
size: e.size,
|
|
2238
|
-
"data-id":
|
|
2404
|
+
"data-id": ne,
|
|
2239
2405
|
name: "colors",
|
|
2240
2406
|
type: "none",
|
|
2241
2407
|
icon: "f_palette",
|
|
2242
|
-
label:
|
|
2408
|
+
label: i.value
|
|
2243
2409
|
};
|
|
2244
|
-
return d(
|
|
2410
|
+
return d(ie, p, () => []);
|
|
2245
2411
|
}
|
|
2246
2412
|
return () => u();
|
|
2247
2413
|
}
|
|
2248
|
-
}),
|
|
2414
|
+
}), To = V({
|
|
2249
2415
|
name: "TdGridButton",
|
|
2250
2416
|
props: { size: String },
|
|
2251
2417
|
setup(e, {}) {
|
|
2252
|
-
const t =
|
|
2418
|
+
const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
|
|
2253
2419
|
var p;
|
|
2254
|
-
return (p =
|
|
2255
|
-
}), { click:
|
|
2420
|
+
return (p = n.value.td) == null ? void 0 : p.controls.grid.iconTitle;
|
|
2421
|
+
}), { click: r, selected: c } = X({
|
|
2256
2422
|
store: t,
|
|
2257
|
-
options:
|
|
2258
|
-
tab:
|
|
2423
|
+
options: Ce,
|
|
2424
|
+
tab: Ce
|
|
2259
2425
|
});
|
|
2260
2426
|
function a(p) {
|
|
2261
2427
|
return s.block(p);
|
|
2262
2428
|
}
|
|
2263
2429
|
function u() {
|
|
2264
2430
|
const p = {
|
|
2265
|
-
hasAccess:
|
|
2266
|
-
selected:
|
|
2267
|
-
onClick:
|
|
2431
|
+
hasAccess: o.value,
|
|
2432
|
+
selected: c.value,
|
|
2433
|
+
onClick: r,
|
|
2268
2434
|
onBlockAccess: a,
|
|
2269
2435
|
size: e.size,
|
|
2270
|
-
"data-id":
|
|
2436
|
+
"data-id": Ce,
|
|
2271
2437
|
name: "grid",
|
|
2272
2438
|
type: "none",
|
|
2273
2439
|
icon: "f_grid",
|
|
2274
|
-
label:
|
|
2440
|
+
label: i.value
|
|
2275
2441
|
};
|
|
2276
|
-
return d(
|
|
2442
|
+
return d(ie, p, () => []);
|
|
2277
2443
|
}
|
|
2278
2444
|
return () => u();
|
|
2279
2445
|
}
|
|
2280
|
-
}),
|
|
2446
|
+
}), Do = V({
|
|
2281
2447
|
name: "TdLightsButton",
|
|
2282
2448
|
props: { size: String },
|
|
2283
2449
|
setup(e, {}) {
|
|
2284
|
-
const t =
|
|
2450
|
+
const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
|
|
2285
2451
|
var p;
|
|
2286
|
-
return (p =
|
|
2287
|
-
}), { click:
|
|
2452
|
+
return (p = n.value.td) == null ? void 0 : p.controls.lights.iconTitle;
|
|
2453
|
+
}), { click: r, selected: c } = X({
|
|
2288
2454
|
store: t,
|
|
2289
|
-
options:
|
|
2290
|
-
tab:
|
|
2455
|
+
options: fe,
|
|
2456
|
+
tab: fe
|
|
2291
2457
|
});
|
|
2292
2458
|
function a(p) {
|
|
2293
2459
|
return s.block(p);
|
|
2294
2460
|
}
|
|
2295
2461
|
function u() {
|
|
2296
2462
|
const p = {
|
|
2297
|
-
hasAccess:
|
|
2298
|
-
selected:
|
|
2299
|
-
onClick:
|
|
2463
|
+
hasAccess: o.value,
|
|
2464
|
+
selected: c.value,
|
|
2465
|
+
onClick: r,
|
|
2300
2466
|
onBlockAccess: a,
|
|
2301
2467
|
size: e.size,
|
|
2302
|
-
"data-id":
|
|
2468
|
+
"data-id": fe,
|
|
2303
2469
|
name: "lights",
|
|
2304
2470
|
type: "none",
|
|
2305
2471
|
icon: "f_bulb_light",
|
|
2306
|
-
label:
|
|
2472
|
+
label: i.value
|
|
2307
2473
|
};
|
|
2308
|
-
return d(
|
|
2474
|
+
return d(ie, p, () => []);
|
|
2309
2475
|
}
|
|
2310
2476
|
return () => u();
|
|
2311
2477
|
}
|
|
2312
|
-
}),
|
|
2478
|
+
}), Mo = V({
|
|
2313
2479
|
name: "TsAdjustmentsButton",
|
|
2314
2480
|
props: { size: String },
|
|
2315
2481
|
setup(e, {}) {
|
|
2316
|
-
const t =
|
|
2482
|
+
const t = T(), { lang: s } = q(), o = C(() => {
|
|
2317
2483
|
var a;
|
|
2318
2484
|
return (a = s.value.td) == null ? void 0 : a.controls.related.iconTitle;
|
|
2319
|
-
}), { click:
|
|
2320
|
-
options:
|
|
2321
|
-
tab:
|
|
2485
|
+
}), { click: n, selected: i } = X({
|
|
2486
|
+
options: Ee,
|
|
2487
|
+
tab: Ee
|
|
2322
2488
|
});
|
|
2323
|
-
function
|
|
2489
|
+
function r(a) {
|
|
2324
2490
|
return t.block(a);
|
|
2325
2491
|
}
|
|
2326
|
-
function
|
|
2492
|
+
function c() {
|
|
2327
2493
|
const a = {
|
|
2328
2494
|
hasAccess: !0,
|
|
2329
|
-
selected:
|
|
2330
|
-
onClick:
|
|
2331
|
-
onBlockAccess:
|
|
2332
|
-
"data-id":
|
|
2495
|
+
selected: i.value,
|
|
2496
|
+
onClick: n,
|
|
2497
|
+
onBlockAccess: r,
|
|
2498
|
+
"data-id": Ee,
|
|
2333
2499
|
size: e.size,
|
|
2334
2500
|
name: "related",
|
|
2335
2501
|
icon: "f_related",
|
|
2336
2502
|
type: "none",
|
|
2337
|
-
label:
|
|
2503
|
+
label: o.value
|
|
2504
|
+
};
|
|
2505
|
+
return d(ie, a, () => []);
|
|
2506
|
+
}
|
|
2507
|
+
return () => c();
|
|
2508
|
+
}
|
|
2509
|
+
}), Bo = V({
|
|
2510
|
+
name: "TdSavedButton",
|
|
2511
|
+
props: { size: String },
|
|
2512
|
+
setup(e) {
|
|
2513
|
+
const t = T(), { lang: s } = q(), o = C(
|
|
2514
|
+
() => {
|
|
2515
|
+
var a, u;
|
|
2516
|
+
return ((u = (a = s.value.td) == null ? void 0 : a.controls.saved) == null ? void 0 : u.iconTitle) || "Saved";
|
|
2517
|
+
}
|
|
2518
|
+
), { click: n, selected: i } = X({
|
|
2519
|
+
options: ke,
|
|
2520
|
+
tab: ke
|
|
2521
|
+
});
|
|
2522
|
+
function r(a) {
|
|
2523
|
+
return t.block(a);
|
|
2524
|
+
}
|
|
2525
|
+
function c() {
|
|
2526
|
+
const a = {
|
|
2527
|
+
hasAccess: !0,
|
|
2528
|
+
selected: i.value,
|
|
2529
|
+
onClick: n,
|
|
2530
|
+
onBlockAccess: r,
|
|
2531
|
+
"data-id": ke,
|
|
2532
|
+
size: e.size,
|
|
2533
|
+
name: "saved",
|
|
2534
|
+
icon: "f_save",
|
|
2535
|
+
type: "none",
|
|
2536
|
+
label: o.value
|
|
2338
2537
|
};
|
|
2339
|
-
return d(
|
|
2538
|
+
return d(ie, a, () => []);
|
|
2340
2539
|
}
|
|
2341
|
-
return () =>
|
|
2540
|
+
return () => c();
|
|
2342
2541
|
}
|
|
2343
|
-
}),
|
|
2344
|
-
name: "
|
|
2542
|
+
}), Ao = V({
|
|
2543
|
+
name: "TdSkinsButton",
|
|
2544
|
+
props: { size: String },
|
|
2545
|
+
setup(e) {
|
|
2546
|
+
const t = T(), { lang: s } = q(), o = C(() => {
|
|
2547
|
+
var a;
|
|
2548
|
+
return (a = s.value.td) == null ? void 0 : a.controls.skins.iconTitle;
|
|
2549
|
+
}), { click: n, selected: i } = X({
|
|
2550
|
+
options: ee,
|
|
2551
|
+
tab: ee
|
|
2552
|
+
});
|
|
2553
|
+
function r(a) {
|
|
2554
|
+
return t.block(a);
|
|
2555
|
+
}
|
|
2556
|
+
function c() {
|
|
2557
|
+
const a = {
|
|
2558
|
+
hasAccess: !0,
|
|
2559
|
+
selected: i.value,
|
|
2560
|
+
onClick: n,
|
|
2561
|
+
onBlockAccess: r,
|
|
2562
|
+
"data-id": ee,
|
|
2563
|
+
size: e.size,
|
|
2564
|
+
name: "skins",
|
|
2565
|
+
icon: "f_shirt",
|
|
2566
|
+
type: "none",
|
|
2567
|
+
label: o.value
|
|
2568
|
+
};
|
|
2569
|
+
return d(ie, a, () => []);
|
|
2570
|
+
}
|
|
2571
|
+
return () => c();
|
|
2572
|
+
}
|
|
2573
|
+
}), zo = V({
|
|
2574
|
+
name: "TdDefaultDrawer",
|
|
2345
2575
|
props: {},
|
|
2346
2576
|
emits: ["click"],
|
|
2347
|
-
setup(
|
|
2348
|
-
const
|
|
2349
|
-
function
|
|
2577
|
+
setup() {
|
|
2578
|
+
const e = T(), t = "q-ma-xs";
|
|
2579
|
+
function s(o) {
|
|
2350
2580
|
return {
|
|
2351
|
-
class:
|
|
2352
|
-
size: "
|
|
2353
|
-
onClick: () =>
|
|
2581
|
+
class: t,
|
|
2582
|
+
size: "xs",
|
|
2583
|
+
onClick: () => e.setActive(o)
|
|
2354
2584
|
};
|
|
2355
2585
|
}
|
|
2356
2586
|
return () => d(
|
|
2357
|
-
|
|
2358
|
-
{ name:
|
|
2587
|
+
Te,
|
|
2588
|
+
{ name: lt },
|
|
2359
2589
|
{
|
|
2360
|
-
default: () => d(
|
|
2361
|
-
d(
|
|
2362
|
-
d(
|
|
2363
|
-
d(
|
|
2364
|
-
d(
|
|
2590
|
+
default: () => d(Jt, {}, () => [
|
|
2591
|
+
d(Ao, s(ee)),
|
|
2592
|
+
d(Io, s(ne)),
|
|
2593
|
+
d(To, s(Ce)),
|
|
2594
|
+
d(Do, s(fe)),
|
|
2595
|
+
d(Mo, s(Ee)),
|
|
2596
|
+
d(Bo, s(ke))
|
|
2365
2597
|
]),
|
|
2366
|
-
secondary: () => d(
|
|
2598
|
+
secondary: () => [d(as), d(is, { fixed: !1 })]
|
|
2367
2599
|
}
|
|
2368
2600
|
);
|
|
2369
2601
|
}
|
|
2370
|
-
}),
|
|
2602
|
+
}), Po = V({
|
|
2371
2603
|
name: "TdGridDrawer",
|
|
2372
2604
|
setup(e, { slots: t, emit: s }) {
|
|
2373
|
-
const { lang:
|
|
2374
|
-
var
|
|
2375
|
-
return (
|
|
2605
|
+
const { lang: o } = q(), n = C(() => {
|
|
2606
|
+
var r;
|
|
2607
|
+
return (r = o.value.td) == null ? void 0 : r.controls.grid.title;
|
|
2376
2608
|
});
|
|
2377
|
-
function
|
|
2378
|
-
const
|
|
2609
|
+
function i() {
|
|
2610
|
+
const r = {
|
|
2379
2611
|
class: "td-grid-drawer",
|
|
2380
|
-
name:
|
|
2381
|
-
label:
|
|
2612
|
+
name: Ce,
|
|
2613
|
+
label: n.value
|
|
2382
2614
|
};
|
|
2383
|
-
return d(
|
|
2615
|
+
return d(Te, r, () => d(ts));
|
|
2384
2616
|
}
|
|
2385
|
-
return () =>
|
|
2617
|
+
return () => i();
|
|
2386
2618
|
}
|
|
2387
|
-
}),
|
|
2619
|
+
}), Lo = V({
|
|
2388
2620
|
name: "TdRelatedDrawer",
|
|
2389
2621
|
setup(e, { slots: t, emit: s }) {
|
|
2390
|
-
const { lang:
|
|
2391
|
-
var
|
|
2392
|
-
return (
|
|
2622
|
+
const { lang: o } = q(), n = C(() => {
|
|
2623
|
+
var r;
|
|
2624
|
+
return (r = o.value.td) == null ? void 0 : r.controls.related.title;
|
|
2393
2625
|
});
|
|
2394
|
-
function
|
|
2395
|
-
const
|
|
2626
|
+
function i() {
|
|
2627
|
+
const r = {
|
|
2396
2628
|
class: "td-related-drawer",
|
|
2397
|
-
name:
|
|
2398
|
-
label:
|
|
2629
|
+
name: Ee,
|
|
2630
|
+
label: n.value
|
|
2399
2631
|
};
|
|
2400
|
-
return d(
|
|
2632
|
+
return d(Te, r, () => d(os));
|
|
2401
2633
|
}
|
|
2402
|
-
return () =>
|
|
2634
|
+
return () => i();
|
|
2403
2635
|
}
|
|
2404
|
-
}),
|
|
2636
|
+
}), Ro = V({
|
|
2637
|
+
name: "TdSavedDrawer",
|
|
2638
|
+
setup() {
|
|
2639
|
+
const { lang: e } = q(), t = C(() => {
|
|
2640
|
+
var o, n;
|
|
2641
|
+
return ((n = (o = e.value.td) == null ? void 0 : o.controls.saved) == null ? void 0 : n.title) || "Saved";
|
|
2642
|
+
});
|
|
2643
|
+
function s() {
|
|
2644
|
+
const o = {
|
|
2645
|
+
class: "td-saved-drawer",
|
|
2646
|
+
name: ke,
|
|
2647
|
+
label: t.value
|
|
2648
|
+
};
|
|
2649
|
+
return d(Te, o, () => d(ns));
|
|
2650
|
+
}
|
|
2651
|
+
return () => s();
|
|
2652
|
+
}
|
|
2653
|
+
}), Vo = V({
|
|
2405
2654
|
name: "TdLightsDrawer",
|
|
2406
2655
|
setup(e, { slots: t, emit: s }) {
|
|
2407
|
-
const { lang:
|
|
2408
|
-
var
|
|
2409
|
-
return (
|
|
2656
|
+
const { lang: o } = q(), n = C(() => {
|
|
2657
|
+
var r;
|
|
2658
|
+
return (r = o.value.td) == null ? void 0 : r.controls.lights.title;
|
|
2410
2659
|
});
|
|
2411
|
-
function
|
|
2412
|
-
const
|
|
2660
|
+
function i() {
|
|
2661
|
+
const r = {
|
|
2413
2662
|
class: "td-lights-drawer",
|
|
2414
|
-
name:
|
|
2415
|
-
label:
|
|
2663
|
+
name: fe,
|
|
2664
|
+
label: n.value
|
|
2416
2665
|
};
|
|
2417
|
-
return d(
|
|
2666
|
+
return d(Te, r, () => d(ss));
|
|
2418
2667
|
}
|
|
2419
|
-
return () =>
|
|
2668
|
+
return () => i();
|
|
2420
2669
|
}
|
|
2421
|
-
}),
|
|
2670
|
+
}), Fo = V({
|
|
2422
2671
|
name: "TdLightsDrawer",
|
|
2423
2672
|
setup(e, { slots: t, emit: s }) {
|
|
2424
|
-
const { lang:
|
|
2425
|
-
var
|
|
2426
|
-
return (
|
|
2673
|
+
const { lang: o } = q(), n = C(() => {
|
|
2674
|
+
var r;
|
|
2675
|
+
return (r = o.value.td) == null ? void 0 : r.controls.colors.title;
|
|
2427
2676
|
});
|
|
2428
|
-
function
|
|
2429
|
-
const
|
|
2677
|
+
function i() {
|
|
2678
|
+
const r = {
|
|
2430
2679
|
class: "td-colors-drawer",
|
|
2431
|
-
name:
|
|
2432
|
-
label:
|
|
2680
|
+
name: ne,
|
|
2681
|
+
label: n.value
|
|
2433
2682
|
};
|
|
2434
|
-
return d(
|
|
2683
|
+
return d(Te, r, () => d(es));
|
|
2435
2684
|
}
|
|
2436
|
-
return () =>
|
|
2685
|
+
return () => i();
|
|
2437
2686
|
}
|
|
2438
|
-
}),
|
|
2687
|
+
}), _o = V({
|
|
2439
2688
|
name: "TdSkinsDrawer",
|
|
2440
2689
|
setup() {
|
|
2441
|
-
const { lang: e } =
|
|
2442
|
-
options:
|
|
2443
|
-
tab:
|
|
2690
|
+
const { lang: e } = q(), { expanded: t } = X({
|
|
2691
|
+
options: ee,
|
|
2692
|
+
tab: ee
|
|
2444
2693
|
}), s = C(() => {
|
|
2445
|
-
var
|
|
2446
|
-
return (
|
|
2694
|
+
var n;
|
|
2695
|
+
return (n = e.value.td) == null ? void 0 : n.controls.skins.title;
|
|
2447
2696
|
});
|
|
2448
|
-
function
|
|
2449
|
-
const
|
|
2697
|
+
function o() {
|
|
2698
|
+
const n = {
|
|
2450
2699
|
class: "td-skins-drawer",
|
|
2451
|
-
name:
|
|
2700
|
+
name: ee,
|
|
2452
2701
|
label: s.value,
|
|
2453
2702
|
modelValue: t.value,
|
|
2454
|
-
"onUpdate:modelValue": (
|
|
2703
|
+
"onUpdate:modelValue": (i) => t.value = i
|
|
2455
2704
|
};
|
|
2456
|
-
return d(
|
|
2705
|
+
return d(Te, n, () => d(rs));
|
|
2457
2706
|
}
|
|
2458
|
-
return () =>
|
|
2707
|
+
return () => o();
|
|
2459
2708
|
}
|
|
2460
|
-
}),
|
|
2709
|
+
}), jo = V({
|
|
2461
2710
|
name: "TsDrawers",
|
|
2462
2711
|
setup(e, { slots: t, emit: s }) {
|
|
2463
|
-
const
|
|
2464
|
-
get: () =>
|
|
2465
|
-
set: (
|
|
2712
|
+
const o = T(), n = C({
|
|
2713
|
+
get: () => o.active,
|
|
2714
|
+
set: (r) => o.setActive(r)
|
|
2466
2715
|
});
|
|
2467
|
-
function
|
|
2468
|
-
const
|
|
2469
|
-
modelValue:
|
|
2470
|
-
"onUpdate:modelValue": (
|
|
2716
|
+
function i() {
|
|
2717
|
+
const r = {
|
|
2718
|
+
modelValue: n.value,
|
|
2719
|
+
"onUpdate:modelValue": (c) => n.value = c
|
|
2471
2720
|
};
|
|
2472
|
-
return d(
|
|
2473
|
-
d(
|
|
2474
|
-
d(
|
|
2475
|
-
d(
|
|
2476
|
-
d(
|
|
2477
|
-
d(
|
|
2478
|
-
d(
|
|
2721
|
+
return d(xs, r, () => [
|
|
2722
|
+
d(zo),
|
|
2723
|
+
d(_o),
|
|
2724
|
+
d(Vo),
|
|
2725
|
+
d(Fo),
|
|
2726
|
+
d(Po),
|
|
2727
|
+
d(Lo),
|
|
2728
|
+
d(Ro)
|
|
2479
2729
|
]);
|
|
2480
2730
|
}
|
|
2481
|
-
return () =>
|
|
2731
|
+
return () => i();
|
|
2482
2732
|
}
|
|
2483
|
-
}),
|
|
2733
|
+
}), en = /* @__PURE__ */ Object.assign({
|
|
2484
2734
|
name: "TdPage",
|
|
2485
2735
|
slug: "td-page",
|
|
2486
2736
|
inheritAttrs: !1
|
|
2487
2737
|
}, {
|
|
2488
2738
|
__name: "TdPage",
|
|
2489
|
-
props: /* @__PURE__ */
|
|
2739
|
+
props: /* @__PURE__ */ bs({
|
|
2490
2740
|
id: Number
|
|
2491
2741
|
}, {
|
|
2492
2742
|
miniState: { type: Boolean },
|
|
@@ -2494,41 +2744,41 @@ const go = R({
|
|
|
2494
2744
|
}),
|
|
2495
2745
|
emits: ["update:miniState"],
|
|
2496
2746
|
setup(e) {
|
|
2497
|
-
const t = e, s = Symbol.for("activity-tracking"),
|
|
2498
|
-
a && (
|
|
2499
|
-
glb_id:
|
|
2747
|
+
const t = e, s = Symbol.for("activity-tracking"), o = T(), n = Ze(s, null), i = C(() => Number(t.id)), r = hs(e, "miniState"), c = (a) => {
|
|
2748
|
+
a && (n == null || n.trackEvent(Ps, {
|
|
2749
|
+
glb_id: o.selected || null,
|
|
2500
2750
|
base_pose_id: a
|
|
2501
2751
|
}));
|
|
2502
2752
|
};
|
|
2503
|
-
return
|
|
2504
|
-
|
|
2505
|
-
}),
|
|
2506
|
-
() =>
|
|
2753
|
+
return $t(async () => {
|
|
2754
|
+
n && (await n.beginExplore(), n.trackEvent(zs, { from: null, to: "3d" }), o.basePoseId && (n.beginSegment(String(o.basePoseId)), c(o.basePoseId)));
|
|
2755
|
+
}), G(
|
|
2756
|
+
() => o.basePoseId,
|
|
2507
2757
|
(a, u) => {
|
|
2508
|
-
!a || a === u || (
|
|
2758
|
+
!a || a === u || (n == null || n.beginSegment(String(a)), c(a));
|
|
2509
2759
|
}
|
|
2510
|
-
),
|
|
2511
|
-
|
|
2512
|
-
}), (a, u) => (
|
|
2760
|
+
), gs(() => {
|
|
2761
|
+
o.setActive(Ct.is.mobile ? lt : ne), n == null || n.end();
|
|
2762
|
+
}), (a, u) => (at(), vt(bt(ws), {
|
|
2513
2763
|
class: "three-dimension-page",
|
|
2514
|
-
miniState:
|
|
2515
|
-
"onUpdate:miniState": u[0] || (u[0] = (p) =>
|
|
2764
|
+
miniState: r.value,
|
|
2765
|
+
"onUpdate:miniState": u[0] || (u[0] = (p) => r.value = p),
|
|
2516
2766
|
"no-drawer-padding": !0,
|
|
2517
2767
|
title: "3D Viewer"
|
|
2518
2768
|
}, {
|
|
2519
|
-
toolDrawer:
|
|
2520
|
-
a.$q.platform.is.mobile ?
|
|
2769
|
+
toolDrawer: yt(() => [
|
|
2770
|
+
a.$q.platform.is.mobile ? wt("", !0) : (at(), vt(bt(ko), { key: 0 }))
|
|
2521
2771
|
]),
|
|
2522
|
-
bottomDrawer:
|
|
2523
|
-
a.$q.platform.is.mobile ? (
|
|
2772
|
+
bottomDrawer: yt(() => [
|
|
2773
|
+
a.$q.platform.is.mobile ? (at(), vt(bt(jo), { key: 0 })) : wt("", !0)
|
|
2524
2774
|
]),
|
|
2525
|
-
default:
|
|
2526
|
-
|
|
2775
|
+
default: yt(() => [
|
|
2776
|
+
vs(mo, { id: i.value }, null, 8, ["id"])
|
|
2527
2777
|
]),
|
|
2528
2778
|
_: 1
|
|
2529
2779
|
}, 8, ["miniState"]));
|
|
2530
2780
|
}
|
|
2531
|
-
}),
|
|
2781
|
+
}), Go = [
|
|
2532
2782
|
"#141111",
|
|
2533
2783
|
"#3E251E",
|
|
2534
2784
|
"#633C30",
|
|
@@ -2569,28 +2819,28 @@ const go = R({
|
|
|
2569
2819
|
"#BDACA8",
|
|
2570
2820
|
"#DACDC9",
|
|
2571
2821
|
"#E5E4E3"
|
|
2572
|
-
],
|
|
2822
|
+
], tn = Ye("3d-fbxs", {
|
|
2573
2823
|
state: () => ({
|
|
2574
2824
|
models: {},
|
|
2575
2825
|
loadingUrl: null,
|
|
2576
|
-
palette:
|
|
2826
|
+
palette: Go
|
|
2577
2827
|
}),
|
|
2578
2828
|
getters: {
|
|
2579
2829
|
changed(e) {
|
|
2580
|
-
var
|
|
2581
|
-
const s =
|
|
2582
|
-
return console.log("fbx model", (
|
|
2830
|
+
var o, n, i, r, c;
|
|
2831
|
+
const s = T().selected;
|
|
2832
|
+
return console.log("fbx model", (o = e.models) == null ? void 0 : o[s]), (i = (n = e.models) == null ? void 0 : n[s]) != null && i.color ? ((c = (r = e.models) == null ? void 0 : r[s]) == null ? void 0 : c.color) !== 16777215 : !1;
|
|
2583
2833
|
},
|
|
2584
2834
|
selectedId() {
|
|
2585
|
-
return
|
|
2835
|
+
return T().selected;
|
|
2586
2836
|
},
|
|
2587
2837
|
poseId(e) {
|
|
2588
|
-
var
|
|
2589
|
-
const s =
|
|
2590
|
-
return (
|
|
2838
|
+
var o, n;
|
|
2839
|
+
const s = T().selected;
|
|
2840
|
+
return (n = (o = e.models) == null ? void 0 : o[s]) == null ? void 0 : n.poseId;
|
|
2591
2841
|
},
|
|
2592
2842
|
model(e) {
|
|
2593
|
-
const s =
|
|
2843
|
+
const s = T().selected;
|
|
2594
2844
|
return s && e.models[s] ? e.models[s] : null;
|
|
2595
2845
|
},
|
|
2596
2846
|
url() {
|
|
@@ -2607,37 +2857,37 @@ const go = R({
|
|
|
2607
2857
|
},
|
|
2608
2858
|
colorHex() {
|
|
2609
2859
|
var e;
|
|
2610
|
-
return (e = this.model) != null && e.color ?
|
|
2860
|
+
return (e = this.model) != null && e.color ? me(this.model.color) : "#fefefe";
|
|
2611
2861
|
}
|
|
2612
2862
|
},
|
|
2613
2863
|
actions: {
|
|
2614
2864
|
resetColor() {
|
|
2615
|
-
const t =
|
|
2865
|
+
const t = T().selected;
|
|
2616
2866
|
this.models[t].color = 16777215;
|
|
2617
2867
|
},
|
|
2618
2868
|
setBounds(e) {
|
|
2619
|
-
const s =
|
|
2620
|
-
this.models[s].bounds =
|
|
2869
|
+
const s = T().selected;
|
|
2870
|
+
this.models[s].bounds = Kt(e);
|
|
2621
2871
|
},
|
|
2622
2872
|
setSubjectsFromResponse(e) {
|
|
2623
2873
|
const t = e.entities.fbx;
|
|
2624
2874
|
this.models = { ...this.models, ...t };
|
|
2625
2875
|
},
|
|
2626
2876
|
setColorHex(e) {
|
|
2627
|
-
const s =
|
|
2628
|
-
this.models[s].color =
|
|
2877
|
+
const s = T().selected;
|
|
2878
|
+
this.models[s].color = et(e);
|
|
2629
2879
|
}
|
|
2630
2880
|
}
|
|
2631
2881
|
});
|
|
2632
2882
|
export {
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2883
|
+
en as TdPage,
|
|
2884
|
+
T as use3dStore,
|
|
2885
|
+
Mt as useColorsStore,
|
|
2886
|
+
pt as useControlsStore,
|
|
2887
|
+
tn as useFBXStore,
|
|
2888
|
+
ae as useGLBStore,
|
|
2889
|
+
ve as useGridStore,
|
|
2890
|
+
Fe as useGroundStore,
|
|
2891
|
+
ge as useLightsStore,
|
|
2892
|
+
mt as useSceneStore
|
|
2643
2893
|
};
|