@liveroom-tech/react-immersive 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DownloadedEnvironment-NHM4U2LJ.mjs +1 -0
- package/dist/{SequencesTab-ODR5IGDX.mjs → SequencesTab-VZKEKAUG.mjs} +1 -1
- package/dist/StreamingTilesModel-6Z7SIC2J.mjs +16 -0
- package/dist/binding-builder.css +1 -1
- package/dist/binding-builder.d.mts +3 -3
- package/dist/binding-builder.d.ts +3 -3
- package/dist/binding-builder.js +59 -58
- package/dist/binding-builder.mjs +1 -1
- package/dist/chunk-25WC5KDO.mjs +50 -0
- package/dist/chunk-2AJK643D.mjs +1 -0
- package/dist/chunk-3OCHN3CA.mjs +1 -0
- package/dist/{chunk-3XZKDTB2.mjs → chunk-7OVEHDDE.mjs} +1 -1
- package/dist/chunk-KFLS7GI6.mjs +1 -0
- package/dist/{chunk-EWNN4BBR.mjs → chunk-KYXJG3TX.mjs} +1 -1
- package/dist/{chunk-2CUPPOBW.mjs → chunk-LD7QWHB4.mjs} +2 -2
- package/dist/{chunk-GXY3VML4.mjs → chunk-NMRTI3NQ.mjs} +1 -1
- package/dist/chunk-RKDATTUM.mjs +1 -0
- package/dist/chunk-RXZ4Q7CY.mjs +1 -0
- package/dist/chunk-TUYVYSN5.mjs +1 -0
- package/dist/{chunk-IOLT2VXU.mjs → chunk-UAZ6I25Y.mjs} +1 -1
- package/dist/chunk-UCD76KQ6.mjs +1 -0
- package/dist/chunk-UHRJ2RBF.mjs +1 -0
- package/dist/chunk-UTVFRMYW.mjs +47 -0
- package/dist/chunk-YKDDNX2D.mjs +69 -0
- package/dist/exportSceneMesh-YJFOLFHS.mjs +1 -0
- package/dist/hosted.css +1 -1
- package/dist/hosted.d.mts +3 -3
- package/dist/hosted.d.ts +3 -3
- package/dist/hosted.js +58 -57
- package/dist/hosted.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +52 -51
- package/dist/index.mjs +1 -1
- package/dist/meshFormats-4C6NHYOA.mjs +1 -0
- package/dist/modelFileResolver-CVmON8hg.d.mts +1724 -0
- package/dist/modelFileResolver-CVmON8hg.d.ts +1724 -0
- package/dist/modelViewerProps-BBnZTFO-.d.ts +949 -0
- package/dist/modelViewerProps-CIY4nsNY.d.mts +949 -0
- package/dist/{publicProps-Cmh9JtzJ.d.ts → publicProps-BARVwXu7.d.ts} +1 -1
- package/dist/{publicProps-TMARX628.d.mts → publicProps-n0Yvr_Km.d.mts} +1 -1
- package/dist/simple-model-viewer.css +1 -1
- package/dist/simple-model-viewer.d.mts +22 -4
- package/dist/simple-model-viewer.d.ts +22 -4
- package/dist/simple-model-viewer.js +5 -5
- package/dist/simple-model-viewer.mjs +1 -1
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +2 -2
- package/dist/utils.mjs +1 -1
- package/dist/xrRuntime-5S7KYUVB.mjs +1 -0
- package/package.json +1 -1
- package/dist/chunk-3MIILDHB.mjs +0 -83
- package/dist/chunk-6Q6YZ7O5.mjs +0 -1
- package/dist/chunk-7MN2TMY6.mjs +0 -47
- package/dist/chunk-X4WRTDO6.mjs +0 -50
- package/dist/modelFileResolver-ChKYsF21.d.mts +0 -495
- package/dist/modelFileResolver-ChKYsF21.d.ts +0 -495
- package/dist/modelViewerProps-Ch6pIZIE.d.ts +0 -2159
- package/dist/modelViewerProps-HazR2IE_.d.mts +0 -2159
|
@@ -0,0 +1,1724 @@
|
|
|
1
|
+
type ViewerCameraState = {
|
|
2
|
+
position: [number, number, number];
|
|
3
|
+
target: [number, number, number];
|
|
4
|
+
fov: number | null;
|
|
5
|
+
zoom: number;
|
|
6
|
+
/**
|
|
7
|
+
* The camera's orbit angles, in radians, captured so setCameraState can
|
|
8
|
+
* restore the exact rotation (position and target alone are ambiguous
|
|
9
|
+
* straight above or below the target). Pass the state back as-is; to move
|
|
10
|
+
* the camera to angles you choose, use orbitTo, which takes degrees.
|
|
11
|
+
*/
|
|
12
|
+
azimuthAngle?: number;
|
|
13
|
+
polarAngle?: number;
|
|
14
|
+
};
|
|
15
|
+
/** Where ModelViewer's camera starts. Setting it skips the automatic fit. */
|
|
16
|
+
type ViewerCameraConfig = {
|
|
17
|
+
position?: [number, number, number];
|
|
18
|
+
/** Vertical field of view in degrees. */
|
|
19
|
+
fov?: number;
|
|
20
|
+
near?: number;
|
|
21
|
+
far?: number;
|
|
22
|
+
zoom?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type DeepPartial<T> = T extends readonly unknown[] ? T : T extends object ? {
|
|
26
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
27
|
+
} : T;
|
|
28
|
+
|
|
29
|
+
type ObjectBindingSelector = {
|
|
30
|
+
group: string;
|
|
31
|
+
} | {
|
|
32
|
+
tag: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: ObjectBindingType;
|
|
35
|
+
};
|
|
36
|
+
type ObjectBindingTarget = string | readonly string[] | ObjectBindingSelector;
|
|
37
|
+
/**
|
|
38
|
+
* Resolves IDs and selectors to binding-map keys in stable record order.
|
|
39
|
+
* Explicit ID arrays keep their supplied order. Duplicate matches are removed.
|
|
40
|
+
*/
|
|
41
|
+
declare function selectBindingKeys(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): string[];
|
|
42
|
+
/** Selects bindings by ID, group, tag, or binding type. */
|
|
43
|
+
declare function selectBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget): ObjectBinding[];
|
|
44
|
+
|
|
45
|
+
type ObjectBindingPatch = DeepPartial<ObjectBinding>;
|
|
46
|
+
type BindingEdit = {
|
|
47
|
+
ids: ObjectBindingTarget;
|
|
48
|
+
patch: ObjectBindingPatch;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Applies field-level patches to object bindings and returns the updated
|
|
52
|
+
* record. Pure — nothing is mutated, and the original reference comes back
|
|
53
|
+
* untouched when no id matched, so React can skip the re-render.
|
|
54
|
+
*
|
|
55
|
+
* Ids resolve the same way everywhere else in the library: binding key first,
|
|
56
|
+
* then `binding.id`, then `binding.modelObjectId`.
|
|
57
|
+
*/
|
|
58
|
+
declare function patchBindings(bindings: Record<string, ObjectBinding>, target: ObjectBindingTarget, patch: ObjectBindingPatch): Record<string, ObjectBinding>;
|
|
59
|
+
declare function patchBindings(bindings: Record<string, ObjectBinding>, edits: BindingEdit[]): Record<string, ObjectBinding>;
|
|
60
|
+
/** Shorthand for the common `{ style: { material: … } }` nesting. */
|
|
61
|
+
declare function material(value: ObjectBindingMaterial): ObjectBindingPatch;
|
|
62
|
+
|
|
63
|
+
type SequenceVector3 = [number, number, number];
|
|
64
|
+
type SequenceEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "step";
|
|
65
|
+
type SequenceCameraView = {
|
|
66
|
+
position: SequenceVector3;
|
|
67
|
+
target: SequenceVector3;
|
|
68
|
+
fov: number | null;
|
|
69
|
+
zoom: number;
|
|
70
|
+
};
|
|
71
|
+
type SequenceValue = number | boolean | string | SequenceVector3 | SequenceCameraView;
|
|
72
|
+
type SequenceKeyframe = {
|
|
73
|
+
id: string;
|
|
74
|
+
/** Seconds on the sequence timeline. */
|
|
75
|
+
time: number;
|
|
76
|
+
value: SequenceValue;
|
|
77
|
+
/** Interpolation from this keyframe to the next. Default ease-in-out. */
|
|
78
|
+
easing?: SequenceEasing;
|
|
79
|
+
};
|
|
80
|
+
type SequenceObjectProperty = "position" | "rotation" | "scale" | "visible" | "baseColor" | "emissive" | "opacity" | "roughness" | "metalness" | "emissiveIntensity";
|
|
81
|
+
type SequenceTarget = {
|
|
82
|
+
kind: "object";
|
|
83
|
+
objectId: string;
|
|
84
|
+
property: SequenceObjectProperty;
|
|
85
|
+
} | {
|
|
86
|
+
kind: "camera";
|
|
87
|
+
} | {
|
|
88
|
+
kind: "clip";
|
|
89
|
+
clip: string;
|
|
90
|
+
};
|
|
91
|
+
type SequenceTrack = {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
target: SequenceTarget;
|
|
95
|
+
muted?: boolean;
|
|
96
|
+
keyframes: SequenceKeyframe[];
|
|
97
|
+
};
|
|
98
|
+
/** All object/clip ids are scoped to the model that owns this scene config. */
|
|
99
|
+
type SceneSequence = {
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
duration: number;
|
|
103
|
+
loop: boolean;
|
|
104
|
+
autoPlay: boolean;
|
|
105
|
+
tracks: SequenceTrack[];
|
|
106
|
+
};
|
|
107
|
+
type SequencePlaybackState = {
|
|
108
|
+
sequenceId: string | null;
|
|
109
|
+
time: number;
|
|
110
|
+
duration: number;
|
|
111
|
+
status: "stopped" | "playing" | "paused" | "finished";
|
|
112
|
+
previewing: boolean;
|
|
113
|
+
ready: boolean;
|
|
114
|
+
issues: string[];
|
|
115
|
+
};
|
|
116
|
+
type SequenceControls = {
|
|
117
|
+
/** Stable snapshot for useSyncExternalStore. UI updates are throttled during playback. */
|
|
118
|
+
getState: () => SequencePlaybackState;
|
|
119
|
+
subscribe: (listener: () => void) => () => void;
|
|
120
|
+
select: (sequenceId: string) => boolean;
|
|
121
|
+
play: (sequenceId?: string) => boolean;
|
|
122
|
+
pause: () => void;
|
|
123
|
+
/** Restore the authored object, material, clip and camera state. */
|
|
124
|
+
stop: () => void;
|
|
125
|
+
/** Deterministic scrubbing, including backwards, without changing authored bindings. */
|
|
126
|
+
seek: (time: number) => boolean;
|
|
127
|
+
/** Read the live value for capture in the authoring UI. */
|
|
128
|
+
capture: (target: SequenceTarget) => SequenceValue | null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
type MeasurementUnit = "m" | "cm" | "mm" | "in" | "ft";
|
|
132
|
+
type MeasurementTool = "distance" | "angle" | "area" | "pointToPlane" | "wrap" | "wrapHorizontal";
|
|
133
|
+
type MeasurementPosition = [number, number, number];
|
|
134
|
+
type MeasurementSettings = {
|
|
135
|
+
/** Authored model units. Default metres. Changing this should clear calibration. */
|
|
136
|
+
sourceUnit?: MeasurementUnit;
|
|
137
|
+
/** Unit used for lengths and areas. Default metres (or measurementUnit). */
|
|
138
|
+
displayUnit?: MeasurementUnit;
|
|
139
|
+
/** Calibration override: metres represented by one model unit. */
|
|
140
|
+
metersPerUnit?: number;
|
|
141
|
+
};
|
|
142
|
+
type MeasurementAnchor = {
|
|
143
|
+
nodeId: string;
|
|
144
|
+
localPosition: MeasurementPosition;
|
|
145
|
+
localNormal?: MeasurementPosition;
|
|
146
|
+
localFaceVertices?: MeasurementPosition[];
|
|
147
|
+
instanceId?: number;
|
|
148
|
+
/** Deterministic fingerprint of source geometry, independent of rigid transforms. */
|
|
149
|
+
geometrySignature: string;
|
|
150
|
+
/** Posed measurements are snapshots; a different pose requires remeasurement. */
|
|
151
|
+
poseSignature: string;
|
|
152
|
+
};
|
|
153
|
+
type MeasurementPoint = {
|
|
154
|
+
id: number;
|
|
155
|
+
position: MeasurementPosition;
|
|
156
|
+
normal?: MeasurementPosition;
|
|
157
|
+
faceVertices?: MeasurementPosition[];
|
|
158
|
+
snapped?: "vertex" | "edge";
|
|
159
|
+
anchor?: MeasurementAnchor;
|
|
160
|
+
};
|
|
161
|
+
type SavedMeasurement = {
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
/** Stable model identity; defaults to the canonical model URL. */
|
|
165
|
+
modelId: string;
|
|
166
|
+
tilesetUrl?: string | null;
|
|
167
|
+
tool: MeasurementTool;
|
|
168
|
+
points: MeasurementPoint[];
|
|
169
|
+
createdAt: string;
|
|
170
|
+
visible?: boolean;
|
|
171
|
+
/** Streamed geometry may represent a coarser LOD than the source model. */
|
|
172
|
+
approximate?: boolean;
|
|
173
|
+
};
|
|
174
|
+
/** Stored with sceneConfig, JSON exports, and shareable configurations. */
|
|
175
|
+
type MeasurementCollection = {
|
|
176
|
+
settings: MeasurementSettings;
|
|
177
|
+
items: SavedMeasurement[];
|
|
178
|
+
};
|
|
179
|
+
type MeasurementStatus = "ready" | "approximate" | "model-changed" | "missing-object" | "geometry-changed" | "pose-changed" | "hidden-object" | "invalid";
|
|
180
|
+
type MeasurementResult = {
|
|
181
|
+
id: string;
|
|
182
|
+
status: MeasurementStatus;
|
|
183
|
+
rawValue: number | null;
|
|
184
|
+
value: number | null;
|
|
185
|
+
unit: string;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
type SceneSelectionSet = {
|
|
189
|
+
id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
/** Stable modelObjectId values, scoped to this model. */
|
|
192
|
+
objectIds: string[];
|
|
193
|
+
};
|
|
194
|
+
/** Validate saved selections from scene JSON, shared state, or browser storage. */
|
|
195
|
+
declare function parseSelectionSets(input: unknown): SceneSelectionSet[];
|
|
196
|
+
|
|
197
|
+
type ProductSelections = Record<string, string | null>;
|
|
198
|
+
type ProductOptionRef = {
|
|
199
|
+
groupId: string;
|
|
200
|
+
optionId: string;
|
|
201
|
+
};
|
|
202
|
+
type ProductAppearance = {
|
|
203
|
+
target: ObjectBindingTarget;
|
|
204
|
+
material?: ObjectBindingMaterial;
|
|
205
|
+
visible?: boolean;
|
|
206
|
+
};
|
|
207
|
+
type ProductOption = {
|
|
208
|
+
id: string;
|
|
209
|
+
label: string;
|
|
210
|
+
sku?: string;
|
|
211
|
+
/** Shown under the label. */
|
|
212
|
+
description?: string;
|
|
213
|
+
/** A hex color, shown as this option's swatch. */
|
|
214
|
+
swatch?: string;
|
|
215
|
+
/** Added to the price, in the currency's smallest unit. Can be negative. */
|
|
216
|
+
priceDeltaMinor?: number;
|
|
217
|
+
appearance?: ProductAppearance[];
|
|
218
|
+
variants?: string[];
|
|
219
|
+
};
|
|
220
|
+
/** Single-choice group. Optional groups may have no selected option. */
|
|
221
|
+
type ProductOptionGroup = {
|
|
222
|
+
id: string;
|
|
223
|
+
label: string;
|
|
224
|
+
required?: boolean;
|
|
225
|
+
defaultOptionId?: string;
|
|
226
|
+
display?: ProductGroupDisplay;
|
|
227
|
+
options: ProductOption[];
|
|
228
|
+
};
|
|
229
|
+
type ProductGroupDisplay = "list" | "chips" | "swatches";
|
|
230
|
+
/** A price worked out from the definition, for products without a pricing service. */
|
|
231
|
+
type ProductPricing = {
|
|
232
|
+
currency: string;
|
|
233
|
+
basePriceMinor: number;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* A link to buy this configuration, with no code. The URL can use {sku},
|
|
237
|
+
* {quantity}, {productId}, {revision} and {selections}.
|
|
238
|
+
*/
|
|
239
|
+
type ProductCheckoutLink = {
|
|
240
|
+
urlTemplate: string;
|
|
241
|
+
label?: string;
|
|
242
|
+
};
|
|
243
|
+
type ProductOptionRule = {
|
|
244
|
+
id: string;
|
|
245
|
+
when: ProductOptionRef;
|
|
246
|
+
requires?: ProductOptionRef[];
|
|
247
|
+
excludes?: ProductOptionRef[];
|
|
248
|
+
message?: string;
|
|
249
|
+
};
|
|
250
|
+
/** Exact combination-to-SKU mapping, including null for unselected optional groups. */
|
|
251
|
+
type ProductSku = {
|
|
252
|
+
sku: string;
|
|
253
|
+
selections: ProductSelections;
|
|
254
|
+
};
|
|
255
|
+
type ProductDefinition = {
|
|
256
|
+
id: string;
|
|
257
|
+
label: string;
|
|
258
|
+
revision: string;
|
|
259
|
+
groups: ProductOptionGroup[];
|
|
260
|
+
pricing?: ProductPricing;
|
|
261
|
+
checkout?: ProductCheckoutLink;
|
|
262
|
+
rules?: ProductOptionRule[];
|
|
263
|
+
skus?: ProductSku[];
|
|
264
|
+
};
|
|
265
|
+
type SceneProductConfig = {
|
|
266
|
+
definition: ProductDefinition;
|
|
267
|
+
selections: ProductSelections;
|
|
268
|
+
};
|
|
269
|
+
type ProductConfigurationIssue = {
|
|
270
|
+
code: "required" | "unknown-group" | "unknown-option" | "requires" | "excludes" | "sku";
|
|
271
|
+
message: string;
|
|
272
|
+
groupIds: string[];
|
|
273
|
+
ruleId?: string;
|
|
274
|
+
};
|
|
275
|
+
type ProductConfiguration = {
|
|
276
|
+
version: 1;
|
|
277
|
+
productId: string;
|
|
278
|
+
revision: string;
|
|
279
|
+
/** Canonical JSON identity of product, revision, quantity, and sorted selections. */
|
|
280
|
+
key: string;
|
|
281
|
+
quantity: number;
|
|
282
|
+
selections: ProductSelections;
|
|
283
|
+
sku: string | null;
|
|
284
|
+
items: Array<{
|
|
285
|
+
groupId: string;
|
|
286
|
+
optionId: string;
|
|
287
|
+
label: string;
|
|
288
|
+
sku?: string;
|
|
289
|
+
}>;
|
|
290
|
+
valid: boolean;
|
|
291
|
+
issues: ProductConfigurationIssue[];
|
|
292
|
+
};
|
|
293
|
+
type ProductOptionState = {
|
|
294
|
+
groupId: string;
|
|
295
|
+
optionId: string;
|
|
296
|
+
selected: boolean;
|
|
297
|
+
available: boolean;
|
|
298
|
+
reasons: string[];
|
|
299
|
+
/** For a choice blocked by a rule: the other choices that would have to change to allow it. */
|
|
300
|
+
fix?: ProductOptionRef[];
|
|
301
|
+
};
|
|
302
|
+
/** Something in a definition that won't work as its author expects. */
|
|
303
|
+
type ProductDefinitionWarning = {
|
|
304
|
+
code: "missing-sku" | "no-objects" | "missing-variant" | "invalid-default" | "unreachable" | "nothing-changes";
|
|
305
|
+
message: string;
|
|
306
|
+
groupId?: string;
|
|
307
|
+
optionId?: string;
|
|
308
|
+
};
|
|
309
|
+
type ProductAvailability = {
|
|
310
|
+
available: boolean;
|
|
311
|
+
message?: string;
|
|
312
|
+
options?: Array<ProductOptionRef & {
|
|
313
|
+
available: boolean;
|
|
314
|
+
reason?: string;
|
|
315
|
+
}>;
|
|
316
|
+
};
|
|
317
|
+
/** Display-only price supplied by the host's pricing service. */
|
|
318
|
+
type ProductPrice = {
|
|
319
|
+
amountMinor: number;
|
|
320
|
+
currency: string;
|
|
321
|
+
expiresAt?: string;
|
|
322
|
+
label?: string;
|
|
323
|
+
};
|
|
324
|
+
type ProductCommerceResult = {
|
|
325
|
+
id?: string;
|
|
326
|
+
message?: string;
|
|
327
|
+
};
|
|
328
|
+
type ProductCommerceContext = {
|
|
329
|
+
signal: AbortSignal;
|
|
330
|
+
};
|
|
331
|
+
type ProductCheckoutContext = ProductCommerceContext & {
|
|
332
|
+
idempotencyKey: string;
|
|
333
|
+
price: ProductPrice | null;
|
|
334
|
+
};
|
|
335
|
+
/** Implement these methods in your application; validate/reprice again on your server. */
|
|
336
|
+
type ProductCommerceAdapter = {
|
|
337
|
+
/** Stable backend/pricing-context identity; change when provider, currency, or customer context changes. */
|
|
338
|
+
key: string;
|
|
339
|
+
resolveSku?: (configuration: ProductConfiguration, context: ProductCommerceContext) => string | null | Promise<string | null>;
|
|
340
|
+
getAvailability?: (configuration: ProductConfiguration, context: ProductCommerceContext) => ProductAvailability | Promise<ProductAvailability>;
|
|
341
|
+
getPrice?: (configuration: ProductConfiguration, context: ProductCommerceContext) => ProductPrice | Promise<ProductPrice>;
|
|
342
|
+
addToCart?: (configuration: ProductConfiguration, context: ProductCheckoutContext) => ProductCommerceResult | Promise<ProductCommerceResult>;
|
|
343
|
+
requestQuote?: (configuration: ProductConfiguration, context: ProductCheckoutContext) => ProductCommerceResult | Promise<ProductCommerceResult>;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
declare const LIGHT_TYPES: readonly ["none", "directional", "point", "spot", "hemisphere"];
|
|
347
|
+
type SceneLightType = (typeof LIGHT_TYPES)[number];
|
|
348
|
+
type SceneLightAttachment = {
|
|
349
|
+
/** Binding key, binding id, modelObjectId, or raw model node name. */
|
|
350
|
+
objectId: string;
|
|
351
|
+
/** Local-space offset from the attached model object. */
|
|
352
|
+
offset: [number, number, number];
|
|
353
|
+
};
|
|
354
|
+
type SceneLight = {
|
|
355
|
+
id: string;
|
|
356
|
+
type: SceneLightType;
|
|
357
|
+
color: string;
|
|
358
|
+
intensity: number;
|
|
359
|
+
position: [number, number, number];
|
|
360
|
+
rotation?: [number, number, number];
|
|
361
|
+
/** Point-light range. Zero means no distance limit. */
|
|
362
|
+
distance?: number;
|
|
363
|
+
/** Point-light physically correct decay. */
|
|
364
|
+
decay?: number;
|
|
365
|
+
angle?: number;
|
|
366
|
+
penumbra?: number;
|
|
367
|
+
/** Spot/directional aim point; unset aims at the origin (model centre with shadows). */
|
|
368
|
+
target?: [number, number, number];
|
|
369
|
+
attachedToCamera: boolean;
|
|
370
|
+
/** Follow a model object instead of using the world-space position. */
|
|
371
|
+
attachment?: SceneLightAttachment;
|
|
372
|
+
castShadow: boolean;
|
|
373
|
+
shadowBias: number;
|
|
374
|
+
visible: boolean;
|
|
375
|
+
};
|
|
376
|
+
type SceneLightingConfig = {
|
|
377
|
+
ambient: {
|
|
378
|
+
intensity: number;
|
|
379
|
+
color: string;
|
|
380
|
+
};
|
|
381
|
+
lights: SceneLight[];
|
|
382
|
+
};
|
|
383
|
+
declare const SCENE_MODEL_RENDERERS: readonly ["pbr", "matcap", "uv-checker"];
|
|
384
|
+
type SceneModelRenderer = (typeof SCENE_MODEL_RENDERERS)[number];
|
|
385
|
+
type SceneModelConfig = {
|
|
386
|
+
rotation: [number, number, number];
|
|
387
|
+
showAdvancedRotation: boolean;
|
|
388
|
+
renderer: SceneModelRenderer;
|
|
389
|
+
shading: "lit" | "unlit" | "normals";
|
|
390
|
+
autoRotate?: boolean;
|
|
391
|
+
autoRotateSpeed?: number;
|
|
392
|
+
/**
|
|
393
|
+
* The glTF material variants (KHR_materials_variants) to show, by name: at
|
|
394
|
+
* most one from each option group (see `MaterialVariantGroup`). Empty, or
|
|
395
|
+
* left out, for the model's default materials.
|
|
396
|
+
*/
|
|
397
|
+
activeVariants?: string[];
|
|
398
|
+
};
|
|
399
|
+
type SceneCameraConfig = {
|
|
400
|
+
fieldOfView: number;
|
|
401
|
+
showAdvancedSettings: boolean;
|
|
402
|
+
};
|
|
403
|
+
type SceneShadowConfig = {
|
|
404
|
+
enabled: boolean;
|
|
405
|
+
mapSize: number;
|
|
406
|
+
bias: number;
|
|
407
|
+
normalBias: number;
|
|
408
|
+
radius: number;
|
|
409
|
+
};
|
|
410
|
+
declare const ENVIRONMENT_PRESETS: readonly ["neutral", "apartment", "city", "dawn", "forest", "lobby", "night", "park", "studio", "sunset", "warehouse"];
|
|
411
|
+
type EnvironmentPreset = (typeof ENVIRONMENT_PRESETS)[number];
|
|
412
|
+
type SceneEnvironmentConfig = {
|
|
413
|
+
source: "preset" | "custom";
|
|
414
|
+
preset: EnvironmentPreset;
|
|
415
|
+
customEnvironmentUrl: string;
|
|
416
|
+
intensity: number;
|
|
417
|
+
rotation: number;
|
|
418
|
+
shadowLight: {
|
|
419
|
+
enabled: boolean;
|
|
420
|
+
intensity: number;
|
|
421
|
+
bias: number;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
424
|
+
type SceneWireframeConfig = {
|
|
425
|
+
enabled: boolean;
|
|
426
|
+
color: string;
|
|
427
|
+
opacity: number;
|
|
428
|
+
};
|
|
429
|
+
type SceneBackgroundConfig = {
|
|
430
|
+
enabled: boolean;
|
|
431
|
+
type: "environment" | "image" | "color";
|
|
432
|
+
color: string;
|
|
433
|
+
imageUrl: string;
|
|
434
|
+
};
|
|
435
|
+
type SceneGroundShadowConfig = {
|
|
436
|
+
enabled: boolean;
|
|
437
|
+
mode: "shadowCatcher" | "bakedAO";
|
|
438
|
+
intensity: number;
|
|
439
|
+
borderFade: number;
|
|
440
|
+
height: number;
|
|
441
|
+
size: number;
|
|
442
|
+
};
|
|
443
|
+
declare const ANIMATION_LOOP_MODES: readonly ["repeat", "once", "ping-pong"];
|
|
444
|
+
type AnimationLoopMode = (typeof ANIMATION_LOOP_MODES)[number];
|
|
445
|
+
type SceneAnimationClipConfig = {
|
|
446
|
+
sourceName: string;
|
|
447
|
+
displayName: string;
|
|
448
|
+
hidden: boolean;
|
|
449
|
+
loopMode: AnimationLoopMode;
|
|
450
|
+
speed: number;
|
|
451
|
+
};
|
|
452
|
+
type SceneAnimationConfig = {
|
|
453
|
+
clips: SceneAnimationClipConfig[];
|
|
454
|
+
autoplayClip: string | null;
|
|
455
|
+
};
|
|
456
|
+
declare const GLITCH_MODES: readonly ["sporadic", "constantMild", "constantWild"];
|
|
457
|
+
type GlitchModeName = (typeof GLITCH_MODES)[number];
|
|
458
|
+
declare const RAMP_TYPES: readonly ["linear", "radial", "mirroredLinear"];
|
|
459
|
+
type RampTypeName = (typeof RAMP_TYPES)[number];
|
|
460
|
+
declare const KERNEL_SIZE_NAMES: readonly ["verySmall", "small", "medium", "large", "veryLarge", "huge"];
|
|
461
|
+
type KernelSizeName = (typeof KERNEL_SIZE_NAMES)[number];
|
|
462
|
+
type ScenePostProcessingConfig = {
|
|
463
|
+
autofocus: {
|
|
464
|
+
enabled: boolean;
|
|
465
|
+
focusDistance: number;
|
|
466
|
+
focusRange: number;
|
|
467
|
+
focalLength: number;
|
|
468
|
+
bokehScale: number;
|
|
469
|
+
target: [number, number, number];
|
|
470
|
+
mouse: boolean;
|
|
471
|
+
debug: number;
|
|
472
|
+
manual: boolean;
|
|
473
|
+
smoothTime: number;
|
|
474
|
+
};
|
|
475
|
+
toneMapping: {
|
|
476
|
+
enabled: boolean;
|
|
477
|
+
mode: "linear" | "reinhard" | "aces";
|
|
478
|
+
exposure: number;
|
|
479
|
+
resolution: number;
|
|
480
|
+
whitePoint: number;
|
|
481
|
+
middleGrey: number;
|
|
482
|
+
minLuminance: number;
|
|
483
|
+
averageLuminance: number;
|
|
484
|
+
adaptationRate: number;
|
|
485
|
+
};
|
|
486
|
+
brightnessContrast: {
|
|
487
|
+
enabled: boolean;
|
|
488
|
+
brightness: number;
|
|
489
|
+
contrast: number;
|
|
490
|
+
};
|
|
491
|
+
hueSaturation: {
|
|
492
|
+
enabled: boolean;
|
|
493
|
+
hue: number;
|
|
494
|
+
saturation: number;
|
|
495
|
+
};
|
|
496
|
+
colorAverage: {
|
|
497
|
+
enabled: boolean;
|
|
498
|
+
};
|
|
499
|
+
dotScreen: {
|
|
500
|
+
enabled: boolean;
|
|
501
|
+
angle: number;
|
|
502
|
+
scale: number;
|
|
503
|
+
};
|
|
504
|
+
glitch: {
|
|
505
|
+
enabled: boolean;
|
|
506
|
+
mode: GlitchModeName;
|
|
507
|
+
delay: [number, number];
|
|
508
|
+
duration: [number, number];
|
|
509
|
+
strength: [number, number];
|
|
510
|
+
chromaticAberrationOffset: [number, number];
|
|
511
|
+
columns: number;
|
|
512
|
+
ratio: number;
|
|
513
|
+
};
|
|
514
|
+
ssao: {
|
|
515
|
+
enabled: boolean;
|
|
516
|
+
samples: number;
|
|
517
|
+
rings: number;
|
|
518
|
+
intensity: number;
|
|
519
|
+
radius: number;
|
|
520
|
+
bias: number;
|
|
521
|
+
luminanceInfluence: number;
|
|
522
|
+
fade: number;
|
|
523
|
+
minRadiusScale: number;
|
|
524
|
+
worldDistanceThreshold: number;
|
|
525
|
+
worldDistanceFalloff: number;
|
|
526
|
+
worldProximityThreshold: number;
|
|
527
|
+
worldProximityFalloff: number;
|
|
528
|
+
};
|
|
529
|
+
bloom: {
|
|
530
|
+
enabled: boolean;
|
|
531
|
+
intensity: number;
|
|
532
|
+
luminanceThreshold: number;
|
|
533
|
+
luminanceSmoothing: number;
|
|
534
|
+
mipmapBlur: boolean;
|
|
535
|
+
radius: number;
|
|
536
|
+
levels: number;
|
|
537
|
+
};
|
|
538
|
+
godRays: {
|
|
539
|
+
enabled: boolean;
|
|
540
|
+
sunPosition: [number, number, number];
|
|
541
|
+
samples: number;
|
|
542
|
+
density: number;
|
|
543
|
+
decay: number;
|
|
544
|
+
weight: number;
|
|
545
|
+
exposure: number;
|
|
546
|
+
clampMax: number;
|
|
547
|
+
blur: boolean;
|
|
548
|
+
kernelSize: KernelSizeName;
|
|
549
|
+
};
|
|
550
|
+
grid: {
|
|
551
|
+
enabled: boolean;
|
|
552
|
+
scale: number;
|
|
553
|
+
lineWidth: number;
|
|
554
|
+
};
|
|
555
|
+
noise: {
|
|
556
|
+
enabled: boolean;
|
|
557
|
+
opacity: number;
|
|
558
|
+
premultiply: boolean;
|
|
559
|
+
};
|
|
560
|
+
depthOfField: {
|
|
561
|
+
enabled: boolean;
|
|
562
|
+
focusDistance: number;
|
|
563
|
+
focusRange: number;
|
|
564
|
+
focalLength: number;
|
|
565
|
+
bokehScale: number;
|
|
566
|
+
};
|
|
567
|
+
chromaticAberration: {
|
|
568
|
+
enabled: boolean;
|
|
569
|
+
offsetX: number;
|
|
570
|
+
offsetY: number;
|
|
571
|
+
radialModulation: boolean;
|
|
572
|
+
modulationOffset: number;
|
|
573
|
+
};
|
|
574
|
+
lensflare: {
|
|
575
|
+
enabled: boolean;
|
|
576
|
+
lensPosition: [number, number, number];
|
|
577
|
+
smoothTime: number;
|
|
578
|
+
glareSize: number;
|
|
579
|
+
flareSize: number;
|
|
580
|
+
flareSpeed: number;
|
|
581
|
+
flareShape: number;
|
|
582
|
+
animated: boolean;
|
|
583
|
+
anamorphic: boolean;
|
|
584
|
+
colorGain: string;
|
|
585
|
+
haloScale: number;
|
|
586
|
+
secondaryGhosts: boolean;
|
|
587
|
+
aditionalStreaks: boolean;
|
|
588
|
+
ghostScale: number;
|
|
589
|
+
opacity: number;
|
|
590
|
+
starBurst: boolean;
|
|
591
|
+
};
|
|
592
|
+
vignette: {
|
|
593
|
+
enabled: boolean;
|
|
594
|
+
offset: number;
|
|
595
|
+
darkness: number;
|
|
596
|
+
eskil: boolean;
|
|
597
|
+
};
|
|
598
|
+
smaa: {
|
|
599
|
+
enabled: boolean;
|
|
600
|
+
};
|
|
601
|
+
sepia: {
|
|
602
|
+
enabled: boolean;
|
|
603
|
+
intensity: number;
|
|
604
|
+
};
|
|
605
|
+
scanline: {
|
|
606
|
+
enabled: boolean;
|
|
607
|
+
density: number;
|
|
608
|
+
};
|
|
609
|
+
pixelation: {
|
|
610
|
+
enabled: boolean;
|
|
611
|
+
granularity: number;
|
|
612
|
+
};
|
|
613
|
+
outline: {
|
|
614
|
+
enabled: boolean;
|
|
615
|
+
selectionLayer: number;
|
|
616
|
+
edgeStrength: number;
|
|
617
|
+
pulseSpeed: number;
|
|
618
|
+
visibleEdgeColor: string;
|
|
619
|
+
hiddenEdgeColor: string;
|
|
620
|
+
kernelSize: KernelSizeName;
|
|
621
|
+
blur: boolean;
|
|
622
|
+
xRay: boolean;
|
|
623
|
+
};
|
|
624
|
+
selectiveBloom: {
|
|
625
|
+
enabled: boolean;
|
|
626
|
+
selectionLayer: number;
|
|
627
|
+
intensity: number;
|
|
628
|
+
luminanceThreshold: number;
|
|
629
|
+
luminanceSmoothing: number;
|
|
630
|
+
kernelSize: KernelSizeName;
|
|
631
|
+
mipmapBlur: boolean;
|
|
632
|
+
inverted: boolean;
|
|
633
|
+
ignoreBackground: boolean;
|
|
634
|
+
};
|
|
635
|
+
ramp: {
|
|
636
|
+
enabled: boolean;
|
|
637
|
+
rampType: RampTypeName;
|
|
638
|
+
rampStart: [number, number];
|
|
639
|
+
rampEnd: [number, number];
|
|
640
|
+
startColor: string;
|
|
641
|
+
endColor: string;
|
|
642
|
+
opacity?: number;
|
|
643
|
+
rampBias: number;
|
|
644
|
+
rampGain: number;
|
|
645
|
+
rampMask: boolean;
|
|
646
|
+
rampInvert: boolean;
|
|
647
|
+
};
|
|
648
|
+
};
|
|
649
|
+
type SceneAnnotationCameraView = {
|
|
650
|
+
position: [number, number, number];
|
|
651
|
+
target: [number, number, number];
|
|
652
|
+
azimuthAngle?: number;
|
|
653
|
+
polarAngle?: number;
|
|
654
|
+
fov?: number | null;
|
|
655
|
+
zoom?: number;
|
|
656
|
+
};
|
|
657
|
+
type SceneAnnotationImage = {
|
|
658
|
+
src: string;
|
|
659
|
+
alt?: string;
|
|
660
|
+
};
|
|
661
|
+
type SceneAnnotationLink = {
|
|
662
|
+
href: string;
|
|
663
|
+
label: string;
|
|
664
|
+
};
|
|
665
|
+
type SceneAnnotationMarker = {
|
|
666
|
+
id: number;
|
|
667
|
+
worldPosition: [number, number, number];
|
|
668
|
+
localPosition: [number, number, number];
|
|
669
|
+
worldNormal?: [number, number, number];
|
|
670
|
+
anchorNodeName?: string;
|
|
671
|
+
anchorLocalPosition?: [number, number, number];
|
|
672
|
+
title: string;
|
|
673
|
+
description: string;
|
|
674
|
+
/** World-space camera framing restored on selection and during tours. */
|
|
675
|
+
cameraView?: SceneAnnotationCameraView;
|
|
676
|
+
images?: SceneAnnotationImage[];
|
|
677
|
+
links?: SceneAnnotationLink[];
|
|
678
|
+
category?: string;
|
|
679
|
+
/** Inclusive camera-to-marker distance bounds, in scene units. */
|
|
680
|
+
minDistance?: number;
|
|
681
|
+
maxDistance?: number;
|
|
682
|
+
};
|
|
683
|
+
type SceneCinematicWaypoint = {
|
|
684
|
+
position: [number, number, number];
|
|
685
|
+
target: [number, number, number];
|
|
686
|
+
/**
|
|
687
|
+
* Orbit angles in radians, captured with the view in BindingBuilder. They
|
|
688
|
+
* keep the rotation when position and target are vertically aligned; older
|
|
689
|
+
* scene configs without them still work.
|
|
690
|
+
*/
|
|
691
|
+
azimuthAngle?: number;
|
|
692
|
+
polarAngle?: number;
|
|
693
|
+
segmentDuration?: number;
|
|
694
|
+
};
|
|
695
|
+
type SceneCinematicConfig = {
|
|
696
|
+
enabled: boolean;
|
|
697
|
+
waypoints: SceneCinematicWaypoint[];
|
|
698
|
+
duration?: number;
|
|
699
|
+
loop: boolean;
|
|
700
|
+
autoPlay: boolean;
|
|
701
|
+
};
|
|
702
|
+
declare const SECTION_AXES: readonly ["x", "y", "z"];
|
|
703
|
+
type SceneSectionAxis = (typeof SECTION_AXES)[number];
|
|
704
|
+
type SceneSectionPlane = {
|
|
705
|
+
id: string;
|
|
706
|
+
name: string;
|
|
707
|
+
enabled: boolean;
|
|
708
|
+
axis: SceneSectionAxis;
|
|
709
|
+
position: number;
|
|
710
|
+
flip: boolean;
|
|
711
|
+
/** Optional world-space normal; normalized when used. Overrides axis. */
|
|
712
|
+
normal?: [number, number, number];
|
|
713
|
+
};
|
|
714
|
+
type SceneSectionSettings = {
|
|
715
|
+
enabled: boolean;
|
|
716
|
+
/** The world axis the cut runs across; `"y"` gives a floor-plan cut. */
|
|
717
|
+
axis: SceneSectionAxis;
|
|
718
|
+
/**
|
|
719
|
+
* Where the cut is along the axis, as a share of the model's size: 0 at
|
|
720
|
+
* its minimum, 1 at its maximum.
|
|
721
|
+
*/
|
|
722
|
+
position: number;
|
|
723
|
+
/**
|
|
724
|
+
* Keep the part above the cut (the higher side along the axis) instead of
|
|
725
|
+
* the part below it.
|
|
726
|
+
*/
|
|
727
|
+
flip: boolean;
|
|
728
|
+
/** Default: the original single plane. */
|
|
729
|
+
mode?: "plane" | "planes" | "box";
|
|
730
|
+
/** Up to six independently enabled cuts. */
|
|
731
|
+
planes?: SceneSectionPlane[];
|
|
732
|
+
activePlaneId?: string;
|
|
733
|
+
/** Custom normal for the single plane. */
|
|
734
|
+
normal?: [number, number, number];
|
|
735
|
+
/** Normalized bounds within the model bounds. Default: the full model. */
|
|
736
|
+
box?: {
|
|
737
|
+
min: [number, number, number];
|
|
738
|
+
max: [number, number, number];
|
|
739
|
+
};
|
|
740
|
+
/** Keep the outside of a section box instead of its inside. */
|
|
741
|
+
invertBox?: boolean;
|
|
742
|
+
};
|
|
743
|
+
type SceneSectionPreset = {
|
|
744
|
+
id: string;
|
|
745
|
+
name: string;
|
|
746
|
+
settings: SceneSectionSettings;
|
|
747
|
+
};
|
|
748
|
+
type SceneSectionConfig = SceneSectionSettings & {
|
|
749
|
+
presets?: SceneSectionPreset[];
|
|
750
|
+
};
|
|
751
|
+
declare const DEFAULT_SECTION_CONFIG: SceneSectionConfig;
|
|
752
|
+
/**
|
|
753
|
+
* What an object's data must look like for a rule to apply to it. A list
|
|
754
|
+
* applies when every condition in it matches.
|
|
755
|
+
*/
|
|
756
|
+
type SceneStyleCondition = {
|
|
757
|
+
/** A key of `binding.metrics`. */
|
|
758
|
+
metric: string;
|
|
759
|
+
/** Applies when the value is greater than this. */
|
|
760
|
+
above?: number;
|
|
761
|
+
/** Applies when the value is less than this. */
|
|
762
|
+
below?: number;
|
|
763
|
+
} | {
|
|
764
|
+
status: ObjectBindingStatus | ObjectBindingStatus[];
|
|
765
|
+
} | {
|
|
766
|
+
/** A key of `binding.metadata`; dots reach into nested objects. */
|
|
767
|
+
metadata: string;
|
|
768
|
+
equals: string | number | boolean | null;
|
|
769
|
+
};
|
|
770
|
+
type SceneStyleColorScale = {
|
|
771
|
+
/** A key of `binding.metrics`. */
|
|
772
|
+
metric: string;
|
|
773
|
+
/**
|
|
774
|
+
* `[value, "#rrggbb"]` pairs. Values between two stops blend their colours;
|
|
775
|
+
* values outside the stops take the nearest one.
|
|
776
|
+
*/
|
|
777
|
+
stops: [number, string][];
|
|
778
|
+
/** The material colour it sets. Default `"baseColor"`. */
|
|
779
|
+
channel?: "baseColor" | "emissive";
|
|
780
|
+
};
|
|
781
|
+
type SceneStylePulse = {
|
|
782
|
+
/** The glow colour at the pulse's peak. Default `"#ff3b30"`. */
|
|
783
|
+
color?: string;
|
|
784
|
+
/** Pulses per second. Default `1`. */
|
|
785
|
+
speed?: number;
|
|
786
|
+
};
|
|
787
|
+
type SceneStyleRule = {
|
|
788
|
+
id: string;
|
|
789
|
+
label?: string;
|
|
790
|
+
/** The objects the rule considers; every bound object when left out. */
|
|
791
|
+
target?: ObjectBindingTarget;
|
|
792
|
+
/** When the rule applies; always, when left out. */
|
|
793
|
+
when?: SceneStyleCondition | SceneStyleCondition[];
|
|
794
|
+
/** Material overrides, over the object's own `style.material`. */
|
|
795
|
+
material?: ObjectBindingMaterial;
|
|
796
|
+
/** A colour taken from a metric's value. */
|
|
797
|
+
colorScale?: SceneStyleColorScale;
|
|
798
|
+
/** A glow that fades in and out, to draw attention. */
|
|
799
|
+
pulse?: boolean | SceneStylePulse;
|
|
800
|
+
};
|
|
801
|
+
type SceneConfig = {
|
|
802
|
+
model: SceneModelConfig;
|
|
803
|
+
camera: SceneCameraConfig;
|
|
804
|
+
lighting: SceneLightingConfig;
|
|
805
|
+
wireframe: SceneWireframeConfig;
|
|
806
|
+
shadows: SceneShadowConfig;
|
|
807
|
+
environment: SceneEnvironmentConfig;
|
|
808
|
+
background: SceneBackgroundConfig;
|
|
809
|
+
groundShadows: SceneGroundShadowConfig;
|
|
810
|
+
postProcessing: ScenePostProcessingConfig;
|
|
811
|
+
animations: SceneAnimationConfig;
|
|
812
|
+
annotations: SceneAnnotationMarker[];
|
|
813
|
+
cinematic?: SceneCinematicConfig;
|
|
814
|
+
/**
|
|
815
|
+
* Data-driven looks for bound objects, applied in order, so a later rule
|
|
816
|
+
* wins over an earlier one where both set something.
|
|
817
|
+
*/
|
|
818
|
+
styleRules?: SceneStyleRule[];
|
|
819
|
+
/** A cut-away view across the model. Off when left out. */
|
|
820
|
+
section?: SceneSectionConfig;
|
|
821
|
+
/** Named measurements and model-unit calibration, owned by this model. */
|
|
822
|
+
measurements?: MeasurementCollection;
|
|
823
|
+
/** Named object selections scoped to this model's stable object ids. */
|
|
824
|
+
selectionSets?: SceneSelectionSet[];
|
|
825
|
+
/** Product choices, constraints, appearance overrides, and selected options for this model. */
|
|
826
|
+
product?: SceneProductConfig;
|
|
827
|
+
/** Authored timed camera, object, appearance and clip tracks. Model-local IDs. */
|
|
828
|
+
sequences?: SceneSequence[];
|
|
829
|
+
};
|
|
830
|
+
declare const DEFAULT_SCENE_CONFIG: SceneConfig;
|
|
831
|
+
|
|
832
|
+
type SceneConfigPatch = DeepPartial<SceneConfig>;
|
|
833
|
+
/**
|
|
834
|
+
* Applies a nested scene-config patch without mutating either input. Objects
|
|
835
|
+
* are merged recursively, while arrays and tuples are replaced wholesale.
|
|
836
|
+
*/
|
|
837
|
+
declare function patchSceneConfig(sceneConfig: SceneConfig, patch: SceneConfigPatch): SceneConfig;
|
|
838
|
+
|
|
839
|
+
type AnimationClipInfo = {
|
|
840
|
+
sourceName: string;
|
|
841
|
+
duration: number;
|
|
842
|
+
};
|
|
843
|
+
/** How `play` starts a clip. */
|
|
844
|
+
type AnimationPlayOptions = {
|
|
845
|
+
/**
|
|
846
|
+
* Keep the clips already playing, instead of stopping them, so several
|
|
847
|
+
* clips run at once (a left and a right door, say). Default `false`.
|
|
848
|
+
*/
|
|
849
|
+
alongside?: boolean;
|
|
850
|
+
/**
|
|
851
|
+
* Seconds to fade the clip in, and to fade out the clips it replaces, for a
|
|
852
|
+
* smooth blend between them. Default `0`.
|
|
853
|
+
*/
|
|
854
|
+
fade?: number;
|
|
855
|
+
/**
|
|
856
|
+
* Play backwards, from wherever the clip is, or from its end. Plays a
|
|
857
|
+
* "door opens" clip as the door closing. Default `false`.
|
|
858
|
+
*/
|
|
859
|
+
reverse?: boolean;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* `"finished"`: a play-once clip that reached its end and holds its last pose
|
|
863
|
+
* until it's stopped or played again.
|
|
864
|
+
*/
|
|
865
|
+
type AnimationClipStatus = "playing" | "paused" | "finished";
|
|
866
|
+
/** One clip that is playing, paused, or holding its finished pose. */
|
|
867
|
+
type AnimationClipState = {
|
|
868
|
+
clip: string;
|
|
869
|
+
status: AnimationClipStatus;
|
|
870
|
+
/** Position in the clip, in seconds. */
|
|
871
|
+
time: number;
|
|
872
|
+
/** Length of the clip, in seconds. */
|
|
873
|
+
duration: number;
|
|
874
|
+
speed: number;
|
|
875
|
+
reverse: boolean;
|
|
876
|
+
};
|
|
877
|
+
type AnimationPlaybackState = {
|
|
878
|
+
/** Playback intent is preserved while offscreen rendering is suspended. */
|
|
879
|
+
isRenderPaused?: boolean;
|
|
880
|
+
/** The clip played most recently, while it's active. */
|
|
881
|
+
currentClip: string | null;
|
|
882
|
+
/** Whether any clip is playing. */
|
|
883
|
+
isPlaying: boolean;
|
|
884
|
+
speed: number;
|
|
885
|
+
time: number;
|
|
886
|
+
duration: number;
|
|
887
|
+
/** Every active clip, most recently played last. */
|
|
888
|
+
active: AnimationClipState[];
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* Leave out `clip` to act on every active clip; pass one to act on that clip
|
|
892
|
+
* alone.
|
|
893
|
+
*/
|
|
894
|
+
type AnimationControls = {
|
|
895
|
+
clips: string[];
|
|
896
|
+
clipDetails?: AnimationClipInfo[];
|
|
897
|
+
play: (clipName: string, options?: AnimationPlayOptions) => void;
|
|
898
|
+
pause: (clipName?: string) => void;
|
|
899
|
+
/** Stops and resets the pose. */
|
|
900
|
+
stop: (clipName?: string) => void;
|
|
901
|
+
/** Without a clip, also the speed of clips played later without their own. */
|
|
902
|
+
setSpeed: (speed: number, clipName?: string) => void;
|
|
903
|
+
seek?: (time: number, clipName?: string) => void;
|
|
904
|
+
getState?: () => AnimationPlaybackState;
|
|
905
|
+
subscribe?: (listener: (state: AnimationPlaybackState) => void) => () => void;
|
|
906
|
+
};
|
|
907
|
+
type ViewerAnimationsProps = {
|
|
908
|
+
isRenderPaused: boolean;
|
|
909
|
+
clips: string[];
|
|
910
|
+
clipDetails: AnimationClipInfo[];
|
|
911
|
+
currentClip: string | null;
|
|
912
|
+
isPlaying: boolean;
|
|
913
|
+
speed: number;
|
|
914
|
+
time: number;
|
|
915
|
+
duration: number;
|
|
916
|
+
/** Every active clip, most recently played last. */
|
|
917
|
+
active: AnimationClipState[];
|
|
918
|
+
play: (clipName: string, options?: AnimationPlayOptions) => void;
|
|
919
|
+
pause: (clipName?: string) => void;
|
|
920
|
+
stop: (clipName?: string) => void;
|
|
921
|
+
setSpeed: (speed: number, clipName?: string) => void;
|
|
922
|
+
seek: (time: number, clipName?: string) => void;
|
|
923
|
+
handleAnimationsReady: (controls: AnimationControls) => void;
|
|
924
|
+
/** Disconnect the previous model while the next one is loading. */
|
|
925
|
+
clearAnimations: () => void;
|
|
926
|
+
};
|
|
927
|
+
declare function useViewerAnimations(): ViewerAnimationsProps;
|
|
928
|
+
|
|
929
|
+
/** A glow cycling on one object, from its style rules. */
|
|
930
|
+
type StyledObjectPulse = {
|
|
931
|
+
color: string;
|
|
932
|
+
/** Pulses per second. */
|
|
933
|
+
speed: number;
|
|
934
|
+
};
|
|
935
|
+
type StyledObjectBindings = {
|
|
936
|
+
/**
|
|
937
|
+
* The bindings as the rules style them. A binding no rule changed is the
|
|
938
|
+
* same object as the one passed in.
|
|
939
|
+
*/
|
|
940
|
+
bindings: Record<string, ObjectBinding>;
|
|
941
|
+
/** Pulsing objects, by binding key. */
|
|
942
|
+
pulses: Record<string, StyledObjectPulse>;
|
|
943
|
+
/** The binding a styled one came from (itself when no rule changed it). */
|
|
944
|
+
sourceOf: (binding: ObjectBinding) => ObjectBinding;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
* The colour a colour scale gives a value: a blend of the two stops around it,
|
|
948
|
+
* or the nearest stop outside them. Null when there's no usable stop.
|
|
949
|
+
*/
|
|
950
|
+
declare function colorScaleValue(stops: SceneStyleColorScale["stops"], value: number): string | null;
|
|
951
|
+
/**
|
|
952
|
+
* Styles bindings with scene style rules, for rendering. Rules apply in order
|
|
953
|
+
* over each object's own `style.material`, so a later rule wins where two set
|
|
954
|
+
* the same thing. The bindings passed in are never changed.
|
|
955
|
+
*/
|
|
956
|
+
declare function applyStyleRules(bindings: Record<string, ObjectBinding>, rules: readonly SceneStyleRule[] | undefined): StyledObjectBindings;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Objects to focus on. Everything else is ghosted (drawn faintly) or hidden
|
|
960
|
+
* until the isolation is cleared, without changing any binding.
|
|
961
|
+
*/
|
|
962
|
+
type ViewerIsolation = {
|
|
963
|
+
/** The objects that stay: an id, a list of ids, `{ group }`, `{ tag }`, or `{ type }`. */
|
|
964
|
+
target: ObjectBindingTarget;
|
|
965
|
+
/** What happens to everything else. Default `"ghost"`. */
|
|
966
|
+
mode?: "ghost" | "hide";
|
|
967
|
+
/** How visible ghosted objects are, 0–1. Default `0.12`. */
|
|
968
|
+
ghostOpacity?: number;
|
|
969
|
+
};
|
|
970
|
+
type IsolatedObjectBindings = StyledObjectBindings & {
|
|
971
|
+
/** Binding keys that are ghosted or hidden. Pointer picking ignores them. */
|
|
972
|
+
setAside: Set<string>;
|
|
973
|
+
};
|
|
974
|
+
/** The binding keys an isolation keeps; empty when it keeps nothing. */
|
|
975
|
+
declare function isolatedBindingKeys(bindings: Record<string, ObjectBinding>, isolation: ViewerIsolation | null | undefined): Set<string>;
|
|
976
|
+
/**
|
|
977
|
+
* Ghosts or hides every object an isolation doesn't keep, for rendering. The
|
|
978
|
+
* bindings passed in are never changed. An isolation that keeps nothing (a
|
|
979
|
+
* target matching no object) changes nothing either, rather than fading out
|
|
980
|
+
* the whole model.
|
|
981
|
+
*/
|
|
982
|
+
declare function applyIsolation(styled: StyledObjectBindings, isolation: ViewerIsolation | null | undefined): IsolatedObjectBindings;
|
|
983
|
+
|
|
984
|
+
type ObjectBindingsActionEffect = {
|
|
985
|
+
target: ObjectBindingTarget;
|
|
986
|
+
objectBindings: ObjectBindingPatch;
|
|
987
|
+
};
|
|
988
|
+
type SceneConfigActionEffect = {
|
|
989
|
+
sceneConfig: SceneConfigPatch;
|
|
990
|
+
};
|
|
991
|
+
type VisibilityActionEffect = {
|
|
992
|
+
target: ObjectBindingTarget;
|
|
993
|
+
visibility: "show" | "hide" | "toggle";
|
|
994
|
+
};
|
|
995
|
+
type CameraAction = {
|
|
996
|
+
type: "focus-object";
|
|
997
|
+
objectId?: string;
|
|
998
|
+
} | {
|
|
999
|
+
type: "fit-scene";
|
|
1000
|
+
} | {
|
|
1001
|
+
type: "reset";
|
|
1002
|
+
} | {
|
|
1003
|
+
type: "set-target";
|
|
1004
|
+
target: [number, number, number];
|
|
1005
|
+
transition?: boolean;
|
|
1006
|
+
} | {
|
|
1007
|
+
type: "set-state";
|
|
1008
|
+
state: ViewerCameraState;
|
|
1009
|
+
transition?: boolean;
|
|
1010
|
+
};
|
|
1011
|
+
type CameraActionEffect = {
|
|
1012
|
+
camera: CameraAction;
|
|
1013
|
+
};
|
|
1014
|
+
/**
|
|
1015
|
+
* `play` replaces the clips already playing unless `alongside` is set. The
|
|
1016
|
+
* others act on `clip`, or on every active clip when it's left out.
|
|
1017
|
+
*/
|
|
1018
|
+
type AnimationAction = ({
|
|
1019
|
+
type: "play";
|
|
1020
|
+
clip: string;
|
|
1021
|
+
} & AnimationPlayOptions) | {
|
|
1022
|
+
type: "pause";
|
|
1023
|
+
clip?: string;
|
|
1024
|
+
} | {
|
|
1025
|
+
type: "stop";
|
|
1026
|
+
clip?: string;
|
|
1027
|
+
} | {
|
|
1028
|
+
type: "set-speed";
|
|
1029
|
+
speed: number;
|
|
1030
|
+
clip?: string;
|
|
1031
|
+
} | {
|
|
1032
|
+
type: "seek";
|
|
1033
|
+
time: number;
|
|
1034
|
+
clip?: string;
|
|
1035
|
+
};
|
|
1036
|
+
type AnimationActionEffect = {
|
|
1037
|
+
animation: AnimationAction;
|
|
1038
|
+
};
|
|
1039
|
+
/** Isolates objects, or with `null` shows everything again. */
|
|
1040
|
+
type IsolationActionEffect = {
|
|
1041
|
+
isolation: ViewerIsolation | null;
|
|
1042
|
+
};
|
|
1043
|
+
type ObjectActionEffect = IsolationActionEffect | ObjectBindingsActionEffect | SceneConfigActionEffect | VisibilityActionEffect | CameraActionEffect | AnimationActionEffect;
|
|
1044
|
+
|
|
1045
|
+
type ObjectBindingAction = {
|
|
1046
|
+
id: "change-color" | "change-material" | "toggle-visibility" | string;
|
|
1047
|
+
label: string;
|
|
1048
|
+
type: "command";
|
|
1049
|
+
effects?: ObjectActionEffect[];
|
|
1050
|
+
};
|
|
1051
|
+
/**
|
|
1052
|
+
* What kind of object a binding is, for grouping and filtering. The listed
|
|
1053
|
+
* values are suggestions; any string works.
|
|
1054
|
+
*/
|
|
1055
|
+
type ObjectBindingType = "body" | "other" | "glass" | "windshield" | "rear-windshield" | "window" | "sunroof" | "wheel" | "rim" | "tire" | "brake-caliper" | "brake-disc" | "suspension" | "spring" | "shock-absorber" | "axle" | "control-arm" | "interior" | "seat" | "headrest" | "seatbelt" | "dashboard" | "steering-wheel" | "gear-shift" | "center-console" | "armrest" | "door-panel" | "carpet" | "headliner" | "sun-visor" | "pedal" | "instrument-cluster" | "infotainment" | "glove-box" | "engine" | "gearbox" | "radiator" | "battery" | "fuel-tank" | "air-filter" | "intercooler" | "alternator" | "turbo" | "light" | "headlight" | "taillight" | "fog-light" | "indicator" | "daytime-running-light" | "interior-light" | "ambient-light" | "floor" | "floor-tile" | "floor-board" | "floor-mat" | "ceiling" | "ceiling-tile" | "wall" | "wall-tile" | "wall-panel" | "wall-trim" | "baseboard" | "crown-molding" | "column" | "pillar" | "beam" | "arch" | "stairs" | "step" | "railing" | "balustrade" | "window-frame" | "window-sill" | "blind" | "curtain" | "shutter" | "door" | "door-frame" | "door-knob" | "furniture" | "sofa" | "armchair" | "ottoman" | "bed" | "headboard" | "mattress" | "nightstand" | "dresser" | "wardrobe" | "closet" | "shelf" | "bookcase" | "desk" | "office-chair" | "dining-table" | "dining-chair" | "bar-stool" | "bench" | "cabinet" | "sideboard" | "coffee-table" | "side-table" | "tv-stand" | "kitchen-island" | "countertop" | "sink" | "bathtub" | "shower" | "toilet" | "vanity" | "decor" | "rug" | "cushion" | "throw" | "curtain-rod" | "artwork" | "mirror" | "vase" | "plant" | "pot" | "candle" | "frame" | "sculpture" | "clock" | "lamp" | "floor-lamp" | "table-lamp" | "pendant-light" | "chandelier" | "sconce" | "ceiling-fan" | "electronics" | "tv" | "monitor" | "speaker" | "soundbar" | "projector" | "remote" | "console" | "router" | "smart-hub" | "thermostat" | "appliance" | "refrigerator" | "oven" | "microwave" | "dishwasher" | "washing-machine" | "dryer" | "air-conditioner" | "heater" | "ventilation" | "root" | "bone" | "joint" | "socket" | "pivot" | "head" | "face" | "eye" | "eyelid" | "eyebrow" | "mouth" | "teeth" | "tongue" | "ear" | "nose" | "hair" | "beard" | "neck" | "torso" | "chest" | "abdomen" | "back" | "shoulder" | "upper-arm" | "forearm" | "hand" | "finger" | "thumb" | "hip" | "thigh" | "shin" | "foot" | "toe" | "tail" | "wing" | "tentacle" | "clothing" | "hat" | "helmet" | "visor" | "mask" | "goggles" | "glasses" | "jacket" | "shirt" | "pants" | "skirt" | "shoes" | "boots" | "gloves" | "belt" | "watch" | "bag" | "backpack" | "jewelry" | "necklace" | "ring" | "armor" | "chest-plate" | "pauldron" | "gauntlet" | "greave" | "shield" | "weapon" | "blade" | "edge" | "tip" | "guard" | "grip" | "pommel" | "barrel" | "stock" | "scope" | "trigger" | "magazine" | "muzzle" | "gear" | "piston" | "lever" | "valve" | "pump" | "motor" | "rotor" | "blade-prop" | "nozzle" | "pipe" | "tube" | "cable" | "wire" | "connector" | "panel" | "hatch" | "vent" | "antenna" | "sensor" | "camera" | "screen" | "dial" | "button" | "knob" | "switch" | "gauge" | "terrain" | "ground" | "rock" | "cliff" | "water" | "ocean" | "river" | "lake" | "wave" | "foam" | "sky" | "cloud" | "sun" | "moon" | "star" | "fog" | "foliage" | "tree" | "branch" | "leaf" | "grass" | "bush" | "flower" | "soil" | "sand" | "snow" | "ice" | "facade" | "foundation" | "roof-structure" | "chimney" | "balcony" | "porch" | "pathway" | "fence" | "gate" | "wall-exterior" | (string & {});
|
|
1056
|
+
type ObjectBindingStatus = "normal" | "hidden" | "selected" | "disabled";
|
|
1057
|
+
type ObjectBindingTextureSlot = {
|
|
1058
|
+
path: string;
|
|
1059
|
+
/** UV position offset [u, v]. */
|
|
1060
|
+
offset?: [number, number];
|
|
1061
|
+
/** UV zoom scale. 1 = default, >1 = zoom in, <1 = zoom out. */
|
|
1062
|
+
scale?: number;
|
|
1063
|
+
rotation?: number;
|
|
1064
|
+
};
|
|
1065
|
+
type ObjectBindingTextureChannel = "baseColor" | "metalness" | "roughness" | "emissive" | "alpha" | "normal" | "bump" | "ao" | "displacement" | "clearcoat" | "clearcoatRoughness" | "clearcoatNormal" | "anisotropy" | "transmission" | "thickness" | "sheenColor" | "sheenRoughness" | "specularIntensity" | "specularColor";
|
|
1066
|
+
type ObjectBindingTransform = {
|
|
1067
|
+
/** Local xy/xz/yz shear, applied between rotation and scale. Preserves rigid world edits under non-uniform parents. */
|
|
1068
|
+
shear?: [number, number, number];
|
|
1069
|
+
/** Local-space node-origin position, or the reference-pose position when pivot is set. */
|
|
1070
|
+
position?: [number, number, number];
|
|
1071
|
+
/** Local-space Euler rotation in radians. */
|
|
1072
|
+
rotation?: [number, number, number];
|
|
1073
|
+
/** Local-space scale. */
|
|
1074
|
+
scale?: [number, number, number];
|
|
1075
|
+
/**
|
|
1076
|
+
* Opt-in centered editing. Legacy transforms without this field remain direct
|
|
1077
|
+
* local P/R/S. The reference offset keeps position independent of later
|
|
1078
|
+
* rotation/scale edits: rendered origin = position + offset - R * H * S * point (H is shear).
|
|
1079
|
+
*/
|
|
1080
|
+
pivot?: {
|
|
1081
|
+
point: [number, number, number];
|
|
1082
|
+
offset: [number, number, number];
|
|
1083
|
+
};
|
|
1084
|
+
};
|
|
1085
|
+
declare const MATERIAL_SIDES: readonly ["front", "back", "double"];
|
|
1086
|
+
type ObjectBindingMaterialSide = (typeof MATERIAL_SIDES)[number];
|
|
1087
|
+
declare const MATERIAL_BLENDING_MODES: readonly ["normal", "additive"];
|
|
1088
|
+
type ObjectBindingMaterialBlendingMode = (typeof MATERIAL_BLENDING_MODES)[number];
|
|
1089
|
+
type ObjectBindingMaterial = {
|
|
1090
|
+
texture?: ObjectBindingTextureSlot;
|
|
1091
|
+
baseColor?: string;
|
|
1092
|
+
metalness?: number;
|
|
1093
|
+
metalnessMap?: ObjectBindingTextureSlot;
|
|
1094
|
+
roughness?: number;
|
|
1095
|
+
roughnessMap?: ObjectBindingTextureSlot;
|
|
1096
|
+
emissive?: string;
|
|
1097
|
+
emissiveIntensity?: number;
|
|
1098
|
+
emissiveMap?: ObjectBindingTextureSlot;
|
|
1099
|
+
opacity?: number;
|
|
1100
|
+
alphaMap?: ObjectBindingTextureSlot;
|
|
1101
|
+
alphaTest?: number;
|
|
1102
|
+
alphaHash?: boolean;
|
|
1103
|
+
dithering?: boolean;
|
|
1104
|
+
blendingMode?: ObjectBindingMaterialBlendingMode;
|
|
1105
|
+
side?: ObjectBindingMaterialSide;
|
|
1106
|
+
normalMap?: ObjectBindingTextureSlot;
|
|
1107
|
+
normalScale?: number;
|
|
1108
|
+
flipNormalY?: boolean;
|
|
1109
|
+
bumpMap?: ObjectBindingTextureSlot;
|
|
1110
|
+
bumpScale?: number;
|
|
1111
|
+
aoMap?: ObjectBindingTextureSlot;
|
|
1112
|
+
aoMapIntensity?: number;
|
|
1113
|
+
displacementMap?: ObjectBindingTextureSlot;
|
|
1114
|
+
displacementScale?: number;
|
|
1115
|
+
displacementBias?: number;
|
|
1116
|
+
clearcoat?: number;
|
|
1117
|
+
clearcoatMap?: ObjectBindingTextureSlot;
|
|
1118
|
+
clearcoatRoughness?: number;
|
|
1119
|
+
clearcoatRoughnessMap?: ObjectBindingTextureSlot;
|
|
1120
|
+
clearcoatNormalMap?: ObjectBindingTextureSlot;
|
|
1121
|
+
clearcoatNormalScale?: number;
|
|
1122
|
+
flipClearcoatNormalY?: boolean;
|
|
1123
|
+
sheen?: number;
|
|
1124
|
+
sheenColor?: string;
|
|
1125
|
+
sheenColorMap?: ObjectBindingTextureSlot;
|
|
1126
|
+
sheenRoughness?: number;
|
|
1127
|
+
sheenRoughnessMap?: ObjectBindingTextureSlot;
|
|
1128
|
+
anisotropy?: number;
|
|
1129
|
+
anisotropyRotation?: number;
|
|
1130
|
+
anisotropyMap?: ObjectBindingTextureSlot;
|
|
1131
|
+
transmission?: number;
|
|
1132
|
+
transmissionMap?: ObjectBindingTextureSlot;
|
|
1133
|
+
thickness?: number;
|
|
1134
|
+
thicknessMap?: ObjectBindingTextureSlot;
|
|
1135
|
+
attenuationColor?: string;
|
|
1136
|
+
attenuationDistance?: number;
|
|
1137
|
+
reflectivity?: number;
|
|
1138
|
+
specularIntensity?: number;
|
|
1139
|
+
specularIntensityMap?: ObjectBindingTextureSlot;
|
|
1140
|
+
specularColor?: string;
|
|
1141
|
+
specularColorMap?: ObjectBindingTextureSlot;
|
|
1142
|
+
};
|
|
1143
|
+
type ObjectBindingCameraState = {
|
|
1144
|
+
position?: [number, number, number];
|
|
1145
|
+
target?: [number, number, number];
|
|
1146
|
+
fov?: number;
|
|
1147
|
+
zoom?: number;
|
|
1148
|
+
};
|
|
1149
|
+
/**
|
|
1150
|
+
* An image or a line of text printed onto the object's surface: a logo, a
|
|
1151
|
+
* label, a personalisation.
|
|
1152
|
+
*/
|
|
1153
|
+
type ObjectBindingDecal = {
|
|
1154
|
+
id: string;
|
|
1155
|
+
/** The image to show: a URL or public path. */
|
|
1156
|
+
image?: string;
|
|
1157
|
+
/** Text to show, when there's no image. */
|
|
1158
|
+
text?: string;
|
|
1159
|
+
/** Text colour. Default `"#ffffff"`. */
|
|
1160
|
+
color?: string;
|
|
1161
|
+
/** CSS font family for the text. Default `"sans-serif"`. */
|
|
1162
|
+
fontFamily?: string;
|
|
1163
|
+
/** Default `"bold"`. */
|
|
1164
|
+
fontWeight?: "normal" | "bold";
|
|
1165
|
+
/** Where it sits on the object, in the object's own (local) space. */
|
|
1166
|
+
position: [number, number, number];
|
|
1167
|
+
/** The way the surface faces there, in the object's own space. */
|
|
1168
|
+
normal: [number, number, number];
|
|
1169
|
+
/** Width, in model units; the height follows the image or text's shape. */
|
|
1170
|
+
size: number;
|
|
1171
|
+
/** A turn around the surface normal, in radians. Default `0`. */
|
|
1172
|
+
rotation?: number;
|
|
1173
|
+
/** 0–1. Default `1`. */
|
|
1174
|
+
opacity?: number;
|
|
1175
|
+
};
|
|
1176
|
+
type ObjectBindingStyle = {
|
|
1177
|
+
material?: ObjectBindingMaterial;
|
|
1178
|
+
};
|
|
1179
|
+
type ObjectBinding = {
|
|
1180
|
+
id: string;
|
|
1181
|
+
/** Defaults to `"other"`. */
|
|
1182
|
+
type?: ObjectBindingType;
|
|
1183
|
+
modelObjectId: string;
|
|
1184
|
+
label?: string;
|
|
1185
|
+
group?: string;
|
|
1186
|
+
tags?: string[];
|
|
1187
|
+
status?: ObjectBindingStatus;
|
|
1188
|
+
removed?: boolean;
|
|
1189
|
+
visible?: boolean;
|
|
1190
|
+
selectable?: boolean;
|
|
1191
|
+
hoverable?: boolean;
|
|
1192
|
+
transform?: ObjectBindingTransform;
|
|
1193
|
+
style?: ObjectBindingStyle;
|
|
1194
|
+
/** Images and text printed on the object's surface. */
|
|
1195
|
+
decals?: ObjectBindingDecal[];
|
|
1196
|
+
actions?: ObjectBindingAction[];
|
|
1197
|
+
metrics?: Record<string, number>;
|
|
1198
|
+
metadata?: Record<string, unknown>;
|
|
1199
|
+
cameraState?: ObjectBindingCameraState;
|
|
1200
|
+
};
|
|
1201
|
+
type ObjectActionEvent = {
|
|
1202
|
+
objectId: string;
|
|
1203
|
+
action: ObjectBindingAction;
|
|
1204
|
+
binding?: ObjectBinding;
|
|
1205
|
+
screenX?: number;
|
|
1206
|
+
screenY?: number;
|
|
1207
|
+
};
|
|
1208
|
+
/** A point on an object's surface, in the object's own (local) space. */
|
|
1209
|
+
type ObjectSurfacePoint = {
|
|
1210
|
+
position: [number, number, number];
|
|
1211
|
+
/** The way the surface faces at that point. */
|
|
1212
|
+
normal: [number, number, number];
|
|
1213
|
+
};
|
|
1214
|
+
/** A double-click, right-click, or long-press on a model object. */
|
|
1215
|
+
type ObjectPointerEvent = {
|
|
1216
|
+
binding: ObjectBinding;
|
|
1217
|
+
/** Viewport coordinates, e.g. to place a menu with `position: fixed`. */
|
|
1218
|
+
clientX: number;
|
|
1219
|
+
clientY: number;
|
|
1220
|
+
/** `"mouse"`, `"pen"`, or `"touch"`. */
|
|
1221
|
+
pointerType: string;
|
|
1222
|
+
/**
|
|
1223
|
+
* Where on the object the pointer was, e.g. to place a decal there. Not
|
|
1224
|
+
* reported for streamed (3D Tiles) models.
|
|
1225
|
+
*/
|
|
1226
|
+
surface?: ObjectSurfacePoint;
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
/** One choice in a row of material variants. */
|
|
1230
|
+
type MaterialVariantOption = {
|
|
1231
|
+
/** The variant's name, as `sceneConfig.model.activeVariants` lists it. */
|
|
1232
|
+
name: string;
|
|
1233
|
+
/** The name without its group, for display: "Red" for "Paint: Red". */
|
|
1234
|
+
label: string;
|
|
1235
|
+
/**
|
|
1236
|
+
* The colour of the variant's main material, as a CSS colour, when that
|
|
1237
|
+
* material is a plain colour rather than a texture.
|
|
1238
|
+
*/
|
|
1239
|
+
swatch?: string;
|
|
1240
|
+
};
|
|
1241
|
+
/**
|
|
1242
|
+
* Variants that take turns: choosing one replaces the group's other choice.
|
|
1243
|
+
* Variants in different groups combine, like a paint colour and a wheel style.
|
|
1244
|
+
*/
|
|
1245
|
+
type MaterialVariantGroup = {
|
|
1246
|
+
/** "Paint" for variants named "Paint: Red" or "Paint / Red"; null otherwise. */
|
|
1247
|
+
name: string | null;
|
|
1248
|
+
variants: MaterialVariantOption[];
|
|
1249
|
+
};
|
|
1250
|
+
/**
|
|
1251
|
+
* The active variants after choosing `name`: it replaces any other variant of
|
|
1252
|
+
* its group, so a paint colour swaps for another while the wheels stay.
|
|
1253
|
+
*/
|
|
1254
|
+
declare function chooseMaterialVariant(activeVariants: readonly string[], name: string, groups: readonly MaterialVariantGroup[]): string[];
|
|
1255
|
+
|
|
1256
|
+
type ViewerModelBounds = {
|
|
1257
|
+
min: [number, number, number];
|
|
1258
|
+
max: [number, number, number];
|
|
1259
|
+
center: [number, number, number];
|
|
1260
|
+
size: [number, number, number];
|
|
1261
|
+
};
|
|
1262
|
+
/** What `onModelLoaded` reports about a model that finished loading. */
|
|
1263
|
+
type ViewerModelInfo = {
|
|
1264
|
+
/** Bounds in world space, where the viewer placed the model. */
|
|
1265
|
+
bounds: ViewerModelBounds;
|
|
1266
|
+
/** Number of meshes in the loaded scene. */
|
|
1267
|
+
objectCount: number;
|
|
1268
|
+
/**
|
|
1269
|
+
* Names of the glTF material variants (KHR_materials_variants) the model
|
|
1270
|
+
* offers, in file order; empty when it has none. Show them by setting
|
|
1271
|
+
* `sceneConfig.model.activeVariants`.
|
|
1272
|
+
*/
|
|
1273
|
+
materialVariants: string[];
|
|
1274
|
+
/**
|
|
1275
|
+
* The same variants as option groups, with their display labels and
|
|
1276
|
+
* swatches. One variant from each group can show at once.
|
|
1277
|
+
*/
|
|
1278
|
+
materialVariantGroups: MaterialVariantGroup[];
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
/** Built-in viewer text. Override only the keys your application needs. */
|
|
1282
|
+
declare const DEFAULT_MODEL_VIEWER_LABELS: {
|
|
1283
|
+
readonly verifyingLicense: "Verifying License";
|
|
1284
|
+
readonly checkingYourLicenseKey: "Checking your license key...";
|
|
1285
|
+
readonly createDevelopmentKey: "Create a free development key";
|
|
1286
|
+
readonly invalidLicense: "Invalid License";
|
|
1287
|
+
readonly licenseHasBeenRevokedOrHasExpired: "License has been revoked or has expired";
|
|
1288
|
+
readonly failedToLoadPleaseContactTheSiteAdministrator: "Failed to load. Please contact the site administrator.";
|
|
1289
|
+
readonly contextRestoringTitle: "Reloading viewer…";
|
|
1290
|
+
readonly contextLostTitle: "3D view interrupted";
|
|
1291
|
+
readonly contextRestoringMessage: "Rebuilding the 3D view. Please wait…";
|
|
1292
|
+
readonly contextLostMessage: "The graphics connection was interrupted. The viewer will rebuild when it returns, or you can reload it now.";
|
|
1293
|
+
readonly reloadViewer: "Reload viewer";
|
|
1294
|
+
readonly texturePositioningHint: "Drag to move · Scroll to zoom · Click elsewhere to finish";
|
|
1295
|
+
readonly texturePositioningStartHint: "Double-click to move or zoom";
|
|
1296
|
+
readonly dismiss: "Dismiss";
|
|
1297
|
+
readonly missingUVsAreShownInMagenta: "Missing UVs are shown in magenta.";
|
|
1298
|
+
readonly viewThisModelInARWithAppleQuickLook: "View this model in AR with Apple Quick Look";
|
|
1299
|
+
readonly sequencePlayer: "Sequence player";
|
|
1300
|
+
readonly sequenceSelect: "Sequence";
|
|
1301
|
+
readonly sequencePlay: "Play sequence";
|
|
1302
|
+
readonly sequencePause: "Pause sequence";
|
|
1303
|
+
readonly sequenceStop: "Stop and restore scene";
|
|
1304
|
+
readonly sequencePlayhead: "Sequence playhead";
|
|
1305
|
+
readonly sequenceTime: "Sequence time";
|
|
1306
|
+
readonly sequenceIssues: "Unavailable sequence targets";
|
|
1307
|
+
readonly arConfiguredButton: "AR handoff";
|
|
1308
|
+
readonly arConfiguredTitle: "Take this configuration to AR";
|
|
1309
|
+
readonly arConfiguredDescription: "Your current materials, visible models and placements are included.";
|
|
1310
|
+
readonly arSnapshotStale: "Updating AR to include your latest changes…";
|
|
1311
|
+
readonly arPreparing: "Preparing your scene…";
|
|
1312
|
+
readonly arStart: "Start AR";
|
|
1313
|
+
readonly arStarting: "Starting AR…";
|
|
1314
|
+
readonly arCheckingSupport: "Checking AR support…";
|
|
1315
|
+
readonly arUnavailable: "AR is unavailable in this browser. Open this link in an AR-capable browser on your phone.";
|
|
1316
|
+
readonly arStartFailed: "Could not start AR. Check camera permissions and try again.";
|
|
1317
|
+
readonly arAnimations: "AR animations";
|
|
1318
|
+
readonly arAnimationSelect: "Animation";
|
|
1319
|
+
readonly arAnimationSaved: "Default";
|
|
1320
|
+
readonly arAnimationNone: "No animation";
|
|
1321
|
+
readonly arAnimationClips: "Model clips";
|
|
1322
|
+
readonly arAnimationSequences: "Sequences";
|
|
1323
|
+
readonly arAnimationPlay: "Play animation";
|
|
1324
|
+
readonly arAnimationPause: "Pause animation";
|
|
1325
|
+
readonly arRefresh: "Refresh AR";
|
|
1326
|
+
readonly arRetry: "Try again";
|
|
1327
|
+
readonly arExportDetails: "Export details";
|
|
1328
|
+
readonly arPrepare: "Prepare AR";
|
|
1329
|
+
readonly arPrepareAgain: "Prepare again";
|
|
1330
|
+
readonly arDownloadUSDZ: "Download USDZ for iPhone/iPad";
|
|
1331
|
+
readonly arScanConfigured: "Scan to open this configuration on your phone.";
|
|
1332
|
+
readonly arOpenConfiguredLink: "Open configuration link";
|
|
1333
|
+
readonly viewInAR: "View in AR";
|
|
1334
|
+
readonly openThisExperienceOnAPhoneForAR: "Open this experience on a phone for AR";
|
|
1335
|
+
readonly openOnPhone: "Open on phone";
|
|
1336
|
+
readonly viewThisModelInYourSpace: "View this model in your space";
|
|
1337
|
+
readonly viewThisModelInVR: "View this model in VR";
|
|
1338
|
+
readonly closePhoneHandoff: "Close phone handoff";
|
|
1339
|
+
readonly arScanCode: "Scan the code and choose AR.";
|
|
1340
|
+
readonly qrCodeToOpenThisModelOnAPhone: "QR code to open this model on a phone";
|
|
1341
|
+
readonly disableUVChecker: "Disable UV checker";
|
|
1342
|
+
readonly enableUVChecker: "Enable UV checker";
|
|
1343
|
+
readonly explodedView: "Exploded view";
|
|
1344
|
+
readonly explodeAmount: "Explode amount";
|
|
1345
|
+
readonly removeSectionCut: "Remove section cut";
|
|
1346
|
+
readonly sectionCut: "Section cut";
|
|
1347
|
+
readonly sectionAxis: "Section axis";
|
|
1348
|
+
readonly sectionPosition: "Section position";
|
|
1349
|
+
readonly keepTheOtherSide: "Keep the other side";
|
|
1350
|
+
readonly pauseCinematic: "Pause cinematic";
|
|
1351
|
+
readonly playCinematic: "Play cinematic";
|
|
1352
|
+
readonly stopCinematicAndResetCamera: "Stop cinematic and reset camera";
|
|
1353
|
+
readonly cancel: "Cancel";
|
|
1354
|
+
readonly annotationCategories: "Annotation categories";
|
|
1355
|
+
readonly annotations: "Annotations";
|
|
1356
|
+
readonly all: "All";
|
|
1357
|
+
readonly uncategorized: "Uncategorized";
|
|
1358
|
+
readonly decalDragHint: "Drag the decal on the object. Release to save; Escape to cancel.";
|
|
1359
|
+
readonly showAll: "Show all";
|
|
1360
|
+
readonly materialVariants: "Material variants";
|
|
1361
|
+
readonly startGuidedTour: "Start guided tour";
|
|
1362
|
+
readonly guidedTour: "Guided Tour";
|
|
1363
|
+
readonly previousAnnotation: "Previous annotation";
|
|
1364
|
+
readonly previous: "Prev";
|
|
1365
|
+
readonly stopGuidedTour: "Stop guided tour";
|
|
1366
|
+
readonly nextAnnotation: "Next annotation";
|
|
1367
|
+
readonly next: "Next";
|
|
1368
|
+
readonly exitFullscreen: "Exit fullscreen";
|
|
1369
|
+
readonly enterFullscreen: "Enter fullscreen";
|
|
1370
|
+
readonly resetCameraView: "Reset camera view";
|
|
1371
|
+
readonly orbitControl: "Orbit Control";
|
|
1372
|
+
readonly pointLock: "Pointer lock";
|
|
1373
|
+
readonly cameraController: "Camera controller";
|
|
1374
|
+
readonly cameraControllerSettings: "Camera controller settings";
|
|
1375
|
+
readonly downloadGLB: "Download GLB";
|
|
1376
|
+
readonly downloadGLBDescription: "All visible models, material edits and animations in one file. No annotations or separate editor model slots. Duplicate mesh names may change on reimport.";
|
|
1377
|
+
readonly downloadCombinedGLB: "Download as one GLB";
|
|
1378
|
+
readonly downloadSeparateGLBs: "Download separate GLBs";
|
|
1379
|
+
readonly downloadSeparateGLBsDescription: "One GLB file per model";
|
|
1380
|
+
readonly downloadPNG: "Download PNG";
|
|
1381
|
+
readonly downloadUVLayout: "Download UV Layout";
|
|
1382
|
+
readonly videoFormat: "Video format";
|
|
1383
|
+
readonly auto: "Auto";
|
|
1384
|
+
readonly recordTurntableVideo: "Record turntable video";
|
|
1385
|
+
readonly recordCinematicVideo: "Record cinematic video";
|
|
1386
|
+
readonly videoUnsupported: "Video recording is not supported in this browser.";
|
|
1387
|
+
readonly downloadOptions: "Download options";
|
|
1388
|
+
readonly exporting: "Exporting…";
|
|
1389
|
+
readonly download: "Download";
|
|
1390
|
+
readonly annotationTitlePlaceholder: "Title *";
|
|
1391
|
+
readonly description: "Description";
|
|
1392
|
+
readonly ok: "OK";
|
|
1393
|
+
readonly arRelocate: "Relocate";
|
|
1394
|
+
readonly tapToPlace: "Tap to place";
|
|
1395
|
+
readonly closeAnnotation: "Close annotation";
|
|
1396
|
+
readonly learnMore: "Learn more";
|
|
1397
|
+
readonly stopMeasuring: "Stop measuring";
|
|
1398
|
+
readonly startMeasuring: "Start measuring";
|
|
1399
|
+
readonly toggleBoundingDimensions: "Toggle bounding dimensions";
|
|
1400
|
+
readonly measurementTool: "Measurement tool";
|
|
1401
|
+
readonly distance: "Distance";
|
|
1402
|
+
readonly angle: "Angle";
|
|
1403
|
+
readonly area: "Area";
|
|
1404
|
+
readonly pointToPlane: "Point to plane";
|
|
1405
|
+
readonly wrap: "Circumference (Edge)";
|
|
1406
|
+
readonly wrapHorizontal: "Circumference (Horizontal)";
|
|
1407
|
+
readonly measurementSnapping: "Measurement snapping";
|
|
1408
|
+
readonly noSnapping: "No snapping";
|
|
1409
|
+
readonly snapAuto: "Snap: auto";
|
|
1410
|
+
readonly snapVertex: "Snap: vertex";
|
|
1411
|
+
readonly snapEdge: "Snap: edge";
|
|
1412
|
+
readonly undoMeasurementPoint: "Undo measurement point";
|
|
1413
|
+
readonly clearMeasurements: "Clear measurements";
|
|
1414
|
+
readonly finishArea: "Finish area";
|
|
1415
|
+
readonly savedMeasurements: "Saved measurements ({count})";
|
|
1416
|
+
readonly noSavedMeasurements: "No saved measurements yet. Pick points in the preview, then save a measurement here.";
|
|
1417
|
+
readonly measurementFiles: "Import / export";
|
|
1418
|
+
readonly measurementSourceUnit: "Model units";
|
|
1419
|
+
readonly measurementDisplayUnit: "Display units";
|
|
1420
|
+
readonly measurementName: "Name";
|
|
1421
|
+
readonly measurementNamePlaceholder: "e.g. Door width";
|
|
1422
|
+
readonly saveMeasurement: "Save";
|
|
1423
|
+
readonly knownMeasurementDistance: "Known length";
|
|
1424
|
+
readonly calibrationUnit: "Calibration unit";
|
|
1425
|
+
readonly calibrateMeasurement: "Calibrate";
|
|
1426
|
+
readonly measurementCalibrationHint: "Pick two distance points, enter their known length, then calibrate.";
|
|
1427
|
+
readonly measurementCalibratedScale: "Calibrated: 1 model unit = {scale} m";
|
|
1428
|
+
readonly resetMeasurementCalibration: "Reset calibration";
|
|
1429
|
+
readonly showSavedMeasurement: "Show {name}";
|
|
1430
|
+
readonly renameSavedMeasurement: "Rename {name}";
|
|
1431
|
+
readonly deleteSavedMeasurement: "Delete {name}";
|
|
1432
|
+
readonly exportMeasurementJson: "Export JSON";
|
|
1433
|
+
readonly exportMeasurementCsv: "Export CSV";
|
|
1434
|
+
readonly importMeasurementJson: "Import JSON";
|
|
1435
|
+
readonly measurementReady: "Ready";
|
|
1436
|
+
readonly measurementApproximate: "Approximate LOD";
|
|
1437
|
+
readonly measurementModelChanged: "Different model";
|
|
1438
|
+
readonly measurementObjectMissing: "Object unavailable";
|
|
1439
|
+
readonly measurementGeometryChanged: "Geometry changed — measure again";
|
|
1440
|
+
readonly measurementPoseChanged: "Pose changed — measure again";
|
|
1441
|
+
readonly measurementObjectHidden: "Object hidden";
|
|
1442
|
+
readonly measurementInvalid: "Invalid measurement";
|
|
1443
|
+
readonly measurementWaiting: "Waiting for model";
|
|
1444
|
+
readonly openSceneObjectsPanel: "Open scene objects panel";
|
|
1445
|
+
readonly sceneObjects: "Scene Objects";
|
|
1446
|
+
readonly searchNodesLabels: "Search nodes, labels";
|
|
1447
|
+
readonly closeSceneObjectsPanel: "Close scene objects panel";
|
|
1448
|
+
readonly objectNavigator: "Objects in the 3D view";
|
|
1449
|
+
readonly compareBefore: "Before";
|
|
1450
|
+
readonly compareAfter: "After";
|
|
1451
|
+
readonly compareDivider: "Comparison divider";
|
|
1452
|
+
readonly viewIn3D: "View in 3D";
|
|
1453
|
+
readonly objectNavigatorHint: "Arrow keys browse · Enter selects · Esc clears";
|
|
1454
|
+
readonly selectionCleared: "Selection cleared";
|
|
1455
|
+
readonly cameraKeyboardHelp: "3D view. Arrow keys orbit, Shift with Up or Down zooms, and W, A, S, D, Space and C move the camera.";
|
|
1456
|
+
readonly isolate: "Isolate";
|
|
1457
|
+
readonly hide: "Hide";
|
|
1458
|
+
readonly show: "Show";
|
|
1459
|
+
readonly closePanel: "Close panel";
|
|
1460
|
+
readonly actions: "Actions";
|
|
1461
|
+
readonly openPanel: "Open panel";
|
|
1462
|
+
readonly close: "Close";
|
|
1463
|
+
readonly position: "Position";
|
|
1464
|
+
readonly decalNudgeHint: "Click to fine-tune · Hold to move";
|
|
1465
|
+
readonly decalNudgeControls: "Move decal in small steps";
|
|
1466
|
+
readonly text: "Text";
|
|
1467
|
+
readonly yourText: "Your text";
|
|
1468
|
+
readonly textToAdd: "Text to add";
|
|
1469
|
+
readonly textColour: "Text color";
|
|
1470
|
+
readonly addText: "Add text";
|
|
1471
|
+
readonly image: "Image";
|
|
1472
|
+
readonly chooseImage: "Choose image";
|
|
1473
|
+
readonly imageToAdd: "Image to add";
|
|
1474
|
+
readonly added: "Added";
|
|
1475
|
+
readonly colour: "Color";
|
|
1476
|
+
readonly size: "Size";
|
|
1477
|
+
readonly turn: "Turn";
|
|
1478
|
+
readonly rotation: "Rotation";
|
|
1479
|
+
readonly dragTheDecalAcrossTheObjectsSurface: "Drag the decal across the object's surface";
|
|
1480
|
+
readonly move: "Move";
|
|
1481
|
+
readonly remove: "Remove";
|
|
1482
|
+
readonly noneAddedYet: "None added yet";
|
|
1483
|
+
readonly done: "Done";
|
|
1484
|
+
readonly moveForward: "Move forward";
|
|
1485
|
+
readonly moveLeft: "Move left";
|
|
1486
|
+
readonly moveRight: "Move right";
|
|
1487
|
+
readonly moveBackward: "Move backward";
|
|
1488
|
+
readonly productOptions: "Options";
|
|
1489
|
+
readonly productOptionsFor: "{product} options";
|
|
1490
|
+
readonly productReset: "Reset";
|
|
1491
|
+
readonly productOptional: "optional";
|
|
1492
|
+
readonly productNone: "None";
|
|
1493
|
+
readonly productAlsoChanges: "Also changes: {changes}";
|
|
1494
|
+
readonly productUnavailable: "Currently unavailable.";
|
|
1495
|
+
readonly productQuantity: "Quantity";
|
|
1496
|
+
readonly productCheckingPrice: "Checking price and availability…";
|
|
1497
|
+
readonly productTotal: "Total";
|
|
1498
|
+
readonly productAddToCart: "Add to cart";
|
|
1499
|
+
readonly productAddingToCart: "Adding…";
|
|
1500
|
+
readonly productRequestQuote: "Request quote";
|
|
1501
|
+
readonly productRequestingQuote: "Requesting…";
|
|
1502
|
+
readonly productRefresh: "Refresh";
|
|
1503
|
+
readonly productBuy: "Buy now";
|
|
1504
|
+
readonly productCopyLink: "Copy link";
|
|
1505
|
+
readonly productLinkCopied: "Link copied";
|
|
1506
|
+
readonly productShowOptions: "Show options";
|
|
1507
|
+
readonly productHideOptions: "Hide options";
|
|
1508
|
+
readonly productIssues: "Configuration issues";
|
|
1509
|
+
readonly productRequestDone: "Request completed.";
|
|
1510
|
+
readonly productSaved: "Saved: {id}";
|
|
1511
|
+
readonly sceneSettings: "Scene Settings";
|
|
1512
|
+
readonly background: "Background";
|
|
1513
|
+
readonly backgroundColor: "Background Color";
|
|
1514
|
+
readonly showEnvironmentAsBackground: "Show as background";
|
|
1515
|
+
readonly backgroundBlur: "Background Blur";
|
|
1516
|
+
readonly environmentPreset: "Preset";
|
|
1517
|
+
readonly environmentIntensity: "Intensity";
|
|
1518
|
+
readonly toneMapping: "Tone Mapping";
|
|
1519
|
+
readonly toneMappingAces: "ACES Filmic";
|
|
1520
|
+
readonly toneMappingAgx: "AgX";
|
|
1521
|
+
readonly toneMappingNeutral: "Neutral";
|
|
1522
|
+
readonly toneMappingNone: "None";
|
|
1523
|
+
readonly ground: "Ground";
|
|
1524
|
+
readonly groundShadow: "Ground Shadow";
|
|
1525
|
+
readonly groundShadowOpacity: "Shadow Opacity";
|
|
1526
|
+
readonly floorGrid: "Floor Grid";
|
|
1527
|
+
readonly display: "Display";
|
|
1528
|
+
readonly wireframe: "Wireframe";
|
|
1529
|
+
readonly autoRotateSpeed: "Rotation Speed";
|
|
1530
|
+
readonly fieldOfView: "Field of View";
|
|
1531
|
+
readonly modelInfo: "Model";
|
|
1532
|
+
readonly modelInfoObjects: "Objects";
|
|
1533
|
+
readonly modelInfoTriangles: "Triangles";
|
|
1534
|
+
readonly modelInfoMaterials: "Materials";
|
|
1535
|
+
readonly resetSettings: "Reset Settings";
|
|
1536
|
+
readonly environment: "Environment";
|
|
1537
|
+
readonly autoRotate: "Auto Rotate";
|
|
1538
|
+
readonly lighting: "Lighting";
|
|
1539
|
+
readonly exposure: "Exposure";
|
|
1540
|
+
readonly ambientLightIntensity: "Ambient Light Intensity";
|
|
1541
|
+
readonly ambientLightColor: "Ambient Light Color";
|
|
1542
|
+
readonly directLightIntensity: "Direct Light Intensity";
|
|
1543
|
+
readonly directLightColor: "Direct Light Color";
|
|
1544
|
+
readonly searchObjects: "Search objects";
|
|
1545
|
+
readonly uploadedModel: "Uploaded model";
|
|
1546
|
+
readonly clear: "Clear";
|
|
1547
|
+
readonly chooseModel: "Choose model";
|
|
1548
|
+
readonly loadingModel: "Loading model...";
|
|
1549
|
+
readonly releaseToLoadYourModel: "Release to load your model";
|
|
1550
|
+
readonly arFindSurface: "Move your device over a flat surface";
|
|
1551
|
+
readonly arReleaseToPlace: "Release to place";
|
|
1552
|
+
readonly arGestureHint: "Pinch to resize · Twist to rotate";
|
|
1553
|
+
readonly angleFirstArmHint: "Pick the first arm";
|
|
1554
|
+
readonly angleVertexHint: "Pick the angle's vertex";
|
|
1555
|
+
readonly angleSecondArmHint: "Pick the second arm";
|
|
1556
|
+
readonly angleNewHint: "Pick a point to start a new angle";
|
|
1557
|
+
readonly areaNewHint: "Pick a point to start a new area";
|
|
1558
|
+
readonly areaCornersHint: "Pick polygon corners in order, then Finish area";
|
|
1559
|
+
readonly pointToPlaneFaceHint: "Pick the reference face";
|
|
1560
|
+
readonly pointToPlanePointHint: "Pick a point to measure its perpendicular distance";
|
|
1561
|
+
readonly pointToPlaneNewHint: "Pick a face to start a new measurement";
|
|
1562
|
+
readonly distanceHint: "Pick points on the model to measure distances";
|
|
1563
|
+
readonly wrapHint: "Click a point on the surface to measure its circumference, following the surface (best for limbs)";
|
|
1564
|
+
readonly wrapHorizontalHint: "Click a point to measure a level circumference around it (best for the torso/waist)";
|
|
1565
|
+
readonly visibleEntries: "{count} visible entries";
|
|
1566
|
+
readonly objectCount: "{count} objects";
|
|
1567
|
+
readonly annotationMarker: "Annotation {id}: {title}";
|
|
1568
|
+
readonly recordingVideo: "Recording video · {progress}%";
|
|
1569
|
+
readonly isolatedObjects: "Isolated: {count} objects";
|
|
1570
|
+
readonly largeModelWarning: "Very large model ({millions}M triangles) — it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the objects panel to select parts.";
|
|
1571
|
+
readonly preparingLargeModel: "Preparing large model ({millions}M triangles) — the first display can take a while on this device...";
|
|
1572
|
+
readonly enterAR: "Enter AR";
|
|
1573
|
+
readonly enterVR: "Enter VR";
|
|
1574
|
+
readonly decalImage: "Image {index}";
|
|
1575
|
+
readonly decalText: "Text {index}";
|
|
1576
|
+
readonly decalAdded: "{count} added";
|
|
1577
|
+
readonly up: "up";
|
|
1578
|
+
readonly down: "down";
|
|
1579
|
+
readonly left: "left";
|
|
1580
|
+
readonly right: "right";
|
|
1581
|
+
readonly moveDecal: "Move decal {direction}";
|
|
1582
|
+
readonly moveDecalOnSurface: "Move {direction} on the visible surface";
|
|
1583
|
+
readonly showAllObject: "Show all {name}";
|
|
1584
|
+
readonly isolateObject: "Isolate {name}";
|
|
1585
|
+
readonly isolatedObject: "Isolated: {name}";
|
|
1586
|
+
readonly hideObject: "Hide {name}";
|
|
1587
|
+
readonly showObject: "Show {name}";
|
|
1588
|
+
readonly objectSelected: "{name} selected";
|
|
1589
|
+
readonly objectNavigatorPosition: "{position} of {count}";
|
|
1590
|
+
readonly compareDividerValue: "{before} {percent}%, {after} {rest}%";
|
|
1591
|
+
readonly bindingMismatchOne: "1 object binding doesn't match this model";
|
|
1592
|
+
readonly bindingMismatchMany: "{count} object bindings don't match this model";
|
|
1593
|
+
readonly simpleLargeModelWarning: "Very large model detected ({millions}M triangles) — it may render and move slowly on this device, and click/hover selection on the model is disabled. Use the scene objects panel to select parts.";
|
|
1594
|
+
readonly dropModelHint: "Drag and drop {formats} here";
|
|
1595
|
+
readonly retryModelLoad: "Retry loading model";
|
|
1596
|
+
readonly loadErrorTitle: "This model couldn't be loaded";
|
|
1597
|
+
readonly loadErrorNotFound: "Nothing was found at this address ({status}). Check that modelUrl points to the file.";
|
|
1598
|
+
readonly loadErrorDenied: "The server refused access to the file ({status}). Check that the file is public, or that a signed URL hasn't expired.";
|
|
1599
|
+
readonly loadErrorStatus: "The server responded with {status} when the file was requested.";
|
|
1600
|
+
readonly loadErrorNetwork: "The download was blocked or failed. Check that the URL is correct and, if the file is on another domain, that its server allows cross-origin requests (CORS) from this site.";
|
|
1601
|
+
readonly loadErrorHtml: "The server sent back a web page instead of a model. There's probably no file at this path: many servers answer a missing file with their index.html.";
|
|
1602
|
+
readonly loadErrorInvalidFile: "The file couldn't be read as {format}. Check that it's a valid {format} file.";
|
|
1603
|
+
readonly loadErrorInvalidExplicitFormat: "The file couldn't be read as {format}. Check that it's a valid {format} file and that modelFormat matches it.";
|
|
1604
|
+
readonly loadErrorMissingFormat: "The file couldn't be read as {format}. The URL has no file extension, so set modelFormat to the file's format.";
|
|
1605
|
+
readonly loadErrorPointCloud: "This PLY file is a point cloud: it has points but no faces, and the viewer shows meshes. Turn it into a mesh first, for example with MeshLab or Blender.";
|
|
1606
|
+
readonly measurementReferenceFaceRequired: "Pick a triangle face to define the reference plane.";
|
|
1607
|
+
readonly measurementTooManyPoints: "Finish or clear this measurement before adding more points.";
|
|
1608
|
+
readonly measurementAngleDistinct: "Pick a point away from the angle's vertex.";
|
|
1609
|
+
readonly areaMinimumPoints: "Pick at least three points to finish the area.";
|
|
1610
|
+
readonly areaDistinctPoints: "Area points must be distinct.";
|
|
1611
|
+
readonly areaStraightLine: "Area points must not lie on one straight line.";
|
|
1612
|
+
readonly areaNotPlanar: "Area points must lie on one plane.";
|
|
1613
|
+
readonly areaEdgesCross: "Area edges must not cross or touch each other.";
|
|
1614
|
+
readonly areaZero: "The polygon has no measurable area.";
|
|
1615
|
+
readonly decalSurfaceMissing: "Could not find a surface on this object for the decal.";
|
|
1616
|
+
readonly decalDirectionMissing: "No visible surface in that direction. Try another arrow or rotate the view.";
|
|
1617
|
+
readonly fullscreenExitFailed: "Could not exit fullscreen. Press Escape to exit.";
|
|
1618
|
+
readonly fullscreenEnterFailed: "Could not enter fullscreen. Check your browser or iframe fullscreen permissions and try again.";
|
|
1619
|
+
readonly uvCoordinatesMissing: "This model does not contain UV coordinates.";
|
|
1620
|
+
readonly uvExportFailed: "Could not create the UV layout archive.";
|
|
1621
|
+
readonly videoExportFailed: "Could not export the video.";
|
|
1622
|
+
readonly videoNotReady: "Viewer not ready for video export.";
|
|
1623
|
+
readonly videoExitXR: "Exit the XR session before recording a video.";
|
|
1624
|
+
readonly videoAlreadyRecording: "A video export is already in progress.";
|
|
1625
|
+
readonly videoPathRequired: "Enable a cinematic camera path before recording it.";
|
|
1626
|
+
readonly videoDurationInvalid: "Video duration must be greater than 0 and at most 300 seconds.";
|
|
1627
|
+
readonly videoFrameRateInvalid: "Video frame rate must be between 1 and 60.";
|
|
1628
|
+
readonly videoBitrateInvalid: "Video bitrate must be a positive number.";
|
|
1629
|
+
readonly videoContextLost: "Video export stopped because the WebGL context was lost.";
|
|
1630
|
+
readonly videoTimedOut: "Video export timed out. Keep the viewer tab visible while recording.";
|
|
1631
|
+
readonly videoEncodingFailed: "The browser could not encode the video.";
|
|
1632
|
+
readonly videoEmpty: "The browser produced an empty video.";
|
|
1633
|
+
readonly videoDidNotStart: "Video recording did not start.";
|
|
1634
|
+
readonly videoWebMUnsupported: "Video recording as WEBM is not supported in this browser.";
|
|
1635
|
+
readonly videoMP4Unsupported: "Video recording as MP4 is not supported in this browser.";
|
|
1636
|
+
readonly videoGIFUnsupported: "Video recording as GIF is not supported in this browser.";
|
|
1637
|
+
readonly videoGifWidthInvalid: "GIF width must be a whole number of pixels from 16 to 4096.";
|
|
1638
|
+
readonly environmentNeutral: "neutral";
|
|
1639
|
+
readonly environmentApartment: "apartment";
|
|
1640
|
+
readonly environmentCity: "city";
|
|
1641
|
+
readonly environmentDawn: "dawn";
|
|
1642
|
+
readonly environmentForest: "forest";
|
|
1643
|
+
readonly environmentLobby: "lobby";
|
|
1644
|
+
readonly environmentNight: "night";
|
|
1645
|
+
readonly environmentPark: "park";
|
|
1646
|
+
readonly environmentStudio: "studio";
|
|
1647
|
+
readonly environmentSunset: "sunset";
|
|
1648
|
+
readonly environmentWarehouse: "warehouse";
|
|
1649
|
+
readonly color: "Color";
|
|
1650
|
+
readonly material: "Material";
|
|
1651
|
+
readonly texturePreview: "texture preview";
|
|
1652
|
+
readonly noTextureApplied: "No texture applied";
|
|
1653
|
+
readonly noTextureCoordinates: "This part has no texture coordinates, so an image can't be placed on it.";
|
|
1654
|
+
readonly replaceImage: "Replace image";
|
|
1655
|
+
readonly uploadImage: "Upload image";
|
|
1656
|
+
readonly removeTexture: "Remove texture";
|
|
1657
|
+
readonly texturePosition: "Texture position";
|
|
1658
|
+
readonly offsetX: "Offset X";
|
|
1659
|
+
readonly offsetY: "Offset Y";
|
|
1660
|
+
readonly confirmTexturePosition: "Confirm this texture position and exit positioning mode";
|
|
1661
|
+
readonly donePositioning: "Done positioning";
|
|
1662
|
+
readonly textureOffsetHint: "Double-click the object in the preview to drag its texture directly (scroll to zoom), or edit its offset numerically.";
|
|
1663
|
+
readonly actionToggleLight: "Toggle Light";
|
|
1664
|
+
readonly actionChangeLightColor: "Change Light Color";
|
|
1665
|
+
readonly actionSetBrightness: "Set Brightness";
|
|
1666
|
+
readonly actionChangeColor: "Change Color";
|
|
1667
|
+
readonly actionChangeMaterial: "Change Material";
|
|
1668
|
+
readonly actionToggleVisibility: "Toggle Visibility";
|
|
1669
|
+
};
|
|
1670
|
+
type ModelViewerLabelKey = keyof typeof DEFAULT_MODEL_VIEWER_LABELS;
|
|
1671
|
+
/** Plain-text overrides; dynamic labels use named {placeholders}. */
|
|
1672
|
+
type ModelViewerLabels = Partial<Record<ModelViewerLabelKey, string>>;
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* When a viewer starts its 3D view on its own. `"lazy"` waits until it's on
|
|
1676
|
+
* or near the screen and shares the page's live 3D views with the other lazy
|
|
1677
|
+
* viewers, so a page of viewers stays within the browser's limit. `"eager"`
|
|
1678
|
+
* starts at once and keeps its view.
|
|
1679
|
+
*/
|
|
1680
|
+
type ViewerLoading = "lazy" | "eager";
|
|
1681
|
+
/**
|
|
1682
|
+
* Whether the 3D view starts on its own (`"auto"`) or waits on the poster
|
|
1683
|
+
* until the visitor asks for it with a "View in 3D" button (`"interaction"`).
|
|
1684
|
+
*/
|
|
1685
|
+
type ViewerReveal = "auto" | "interaction";
|
|
1686
|
+
|
|
1687
|
+
type CameraLimits = {
|
|
1688
|
+
/** Closest the camera can get to its target, in scene units. Default 0. */
|
|
1689
|
+
minDistance?: number;
|
|
1690
|
+
/** Farthest the camera can get from its target, in scene units. Default Infinity. */
|
|
1691
|
+
maxDistance?: number;
|
|
1692
|
+
/**
|
|
1693
|
+
* Lowest vertical angle, in degrees: 0 looks straight down from above, 90 is
|
|
1694
|
+
* level with the target, 180 looks straight up from below. Default 0.
|
|
1695
|
+
*/
|
|
1696
|
+
minPolarAngle?: number;
|
|
1697
|
+
/** Highest vertical angle, in degrees (see minPolarAngle). Default 180. */
|
|
1698
|
+
maxPolarAngle?: number;
|
|
1699
|
+
/**
|
|
1700
|
+
* Leftmost horizontal angle, in degrees around the vertical axis: 0 views
|
|
1701
|
+
* the target from the front (+Z), 90 from its right (+X), -90 from its
|
|
1702
|
+
* left. Default -Infinity (no limit).
|
|
1703
|
+
*/
|
|
1704
|
+
minAzimuthAngle?: number;
|
|
1705
|
+
/** Rightmost horizontal angle, in degrees (see minAzimuthAngle). Default Infinity. */
|
|
1706
|
+
maxAzimuthAngle?: number;
|
|
1707
|
+
/** An axis-aligned world-space box the camera's target can pan within. */
|
|
1708
|
+
panBoundary?: [min: [number, number, number], max: [number, number, number]];
|
|
1709
|
+
/** Keeps the camera itself, not just its target, inside panBoundary. Default false. */
|
|
1710
|
+
boundaryEnclosesCamera?: boolean;
|
|
1711
|
+
/** How strongly panning slows near panBoundary, 0–1. Default 0. */
|
|
1712
|
+
boundaryFriction?: number;
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* Whether the viewer cuts motion that starts on its own: `"user"` follows the
|
|
1717
|
+
* visitor's `prefers-reduced-motion` setting, `"always"` and `"never"` override
|
|
1718
|
+
* it.
|
|
1719
|
+
*/
|
|
1720
|
+
type ReducedMotionSetting = "user" | "always" | "never";
|
|
1721
|
+
|
|
1722
|
+
type ModelFormat = "glb" | "gltf" | "obj" | "fbx" | "usdz" | "stl" | "ply";
|
|
1723
|
+
|
|
1724
|
+
export { type ObjectBindingTextureSlot as $, type AnimationAction as A, type BindingEdit as B, type CameraAction as C, DEFAULT_MODEL_VIEWER_LABELS as D, type EnvironmentPreset as E, type ModelFormat as F, type GlitchModeName as G, type ModelViewerLabelKey as H, type IsolatedObjectBindings as I, type ModelViewerLabels as J, type KernelSizeName as K, type ObjectActionEvent as L, MATERIAL_BLENDING_MODES as M, type ObjectBinding as N, type ObjectActionEffect as O, type ObjectBindingAction as P, type ObjectBindingCameraState as Q, type ObjectBindingDecal as R, type ObjectBindingMaterial as S, type ObjectBindingMaterialBlendingMode as T, type ObjectBindingMaterialSide as U, type ObjectBindingPatch as V, type ObjectBindingSelector as W, type ObjectBindingStatus as X, type ObjectBindingStyle as Y, type ObjectBindingTarget as Z, type ObjectBindingTextureChannel as _, type AnimationActionEffect as a, type SceneStyleRule as a$, type ObjectBindingTransform as a0, type ObjectBindingType as a1, type ObjectBindingsActionEffect as a2, type ObjectPointerEvent as a3, type ObjectSurfacePoint as a4, type ProductAppearance as a5, type ProductAvailability as a6, type ProductCheckoutContext as a7, type ProductCheckoutLink as a8, type ProductCommerceAdapter as a9, type SceneCameraConfig as aA, type SceneCinematicConfig as aB, type SceneCinematicWaypoint as aC, type SceneConfig as aD, type SceneConfigActionEffect as aE, type SceneConfigPatch as aF, type SceneEnvironmentConfig as aG, type SceneGroundShadowConfig as aH, type SceneLight as aI, type SceneLightAttachment as aJ, type SceneLightType as aK, type SceneLightingConfig as aL, type SceneModelConfig as aM, type SceneModelRenderer as aN, type ScenePostProcessingConfig as aO, type SceneProductConfig as aP, type SceneSectionAxis as aQ, type SceneSectionConfig as aR, type SceneSectionPlane as aS, type SceneSectionPreset as aT, type SceneSectionSettings as aU, type SceneSelectionSet as aV, type SceneSequence as aW, type SceneShadowConfig as aX, type SceneStyleColorScale as aY, type SceneStyleCondition as aZ, type SceneStylePulse as a_, type ProductCommerceContext as aa, type ProductCommerceResult as ab, type ProductConfiguration as ac, type ProductConfigurationIssue as ad, type ProductDefinition as ae, type ProductDefinitionWarning as af, type ProductGroupDisplay as ag, type ProductOption as ah, type ProductOptionGroup as ai, type ProductOptionRef as aj, type ProductOptionRule as ak, type ProductOptionState as al, type ProductPrice as am, type ProductPricing as an, type ProductSelections as ao, type ProductSku as ap, type RampTypeName as aq, type ReducedMotionSetting as ar, type SavedMeasurement as as, type SceneAnimationClipConfig as at, type SceneAnimationConfig as au, type SceneAnnotationCameraView as av, type SceneAnnotationImage as aw, type SceneAnnotationLink as ax, type SceneAnnotationMarker as ay, type SceneBackgroundConfig as az, type AnimationClipInfo as b, type SceneWireframeConfig as b0, type SequenceCameraView as b1, type SequenceControls as b2, type SequenceEasing as b3, type SequenceKeyframe as b4, type SequenceObjectProperty as b5, type SequencePlaybackState as b6, type SequenceTarget as b7, type SequenceTrack as b8, type SequenceValue as b9, type SequenceVector3 as ba, type StyledObjectBindings as bb, type StyledObjectPulse as bc, type ViewerAnimationsProps as bd, type ViewerCameraConfig as be, type ViewerCameraState as bf, type ViewerIsolation as bg, type ViewerLoading as bh, type ViewerModelBounds as bi, type ViewerModelInfo as bj, type ViewerReveal as bk, type VisibilityActionEffect as bl, applyIsolation as bm, applyStyleRules as bn, chooseMaterialVariant as bo, colorScaleValue as bp, isolatedBindingKeys as bq, material as br, parseSelectionSets as bs, patchBindings as bt, patchSceneConfig as bu, selectBindingKeys as bv, selectBindings as bw, useViewerAnimations as bx, type AnimationClipState as c, type AnimationClipStatus as d, type AnimationControls as e, type AnimationLoopMode as f, type AnimationPlayOptions as g, type AnimationPlaybackState as h, type CameraActionEffect as i, type CameraLimits as j, DEFAULT_SCENE_CONFIG as k, DEFAULT_SECTION_CONFIG as l, type DeepPartial as m, type IsolationActionEffect as n, MATERIAL_SIDES as o, type MaterialVariantGroup as p, type MaterialVariantOption as q, type MeasurementAnchor as r, type MeasurementCollection as s, type MeasurementPoint as t, type MeasurementPosition as u, type MeasurementResult as v, type MeasurementSettings as w, type MeasurementStatus as x, type MeasurementTool as y, type MeasurementUnit as z };
|