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