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