@volter/editor-threejs 0.5.211 → 0.5.212
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/NOTICE +7 -2
- package/README.md +8 -13
- package/contributions/animation-mixers.service.ts +2 -4
- package/contributions/animation-timeline.utility.tsx +1 -2
- package/contributions/three.page.ts +50 -0
- package/dist-node/serving.mjs +84 -3
- package/dist-node/shared-three.mjs +145 -0
- package/package.json +296 -16
- package/serving/animation-stamp.ts +1 -1
- package/serving/index.ts +22 -5
- package/serving/model-import-conversion.ts +6 -3
- package/serving/shared-three.ts +176 -0
- package/src/adapter/constraint.ts +1 -18
- package/src/adapter/object3d-authoring-subject.ts +1 -12
- package/src/adapter/reflection-probe.ts +1 -9
- package/src/adapter/three-contract.ts +6 -60
- package/src/animation/live-mixers.ts +0 -4
- package/src/api.ts +7 -0
- package/src/asset-loaders.ts +2 -178
- package/src/capture/photograph-sampling.ts +333 -0
- package/src/capture/scene.ts +1 -1
- package/src/ecs/object-marks.ts +6 -14
- package/src/ecs/user-data.ts +3 -138
- package/src/kit/animation/three-clips-subject.ts +19 -42
- package/src/kit/asset-compare-core.ts +161 -0
- package/src/kit/asset-compare.ts +8 -27
- package/src/kit/asset-preview-command.ts +14 -19
- package/src/kit/asset-preview-framing.ts +8 -67
- package/src/kit/asset-preview.ts +109 -342
- package/src/kit/asset-workflow/model-inspection.ts +11 -154
- package/src/kit/asset-workflow/preview-resource-lifetime.ts +25 -0
- package/src/kit/authoring/component-instance-root.ts +3 -39
- package/src/kit/authoring/live-object-transform.ts +1 -30
- package/src/kit/authoring/object3d-document-session-registry.ts +7 -15
- package/src/kit/authoring/object3d-document-session.ts +471 -208
- package/src/kit/authoring/shell-viewport-policy.ts +18 -24
- package/src/kit/authoring/source-object3d-authoring-adapter.ts +6 -48
- package/src/kit/authoring/three-projection-core.ts +11 -40
- package/src/kit/authoring/viewport-pick-context.ts +5 -12
- package/src/kit/authoring/viewport-raycast.ts +15 -93
- package/src/kit/authoring/world-hidden-viewport.ts +8 -61
- package/src/kit/capture-camera-pose.ts +68 -0
- package/src/kit/collaboration-presence.ts +41 -0
- package/src/kit/components/CameraInfo.tsx +4 -6
- package/src/kit/components/InspectorObjectPreview.tsx +3 -30
- package/src/kit/components/Object3DDocumentToolbar.css +75 -0
- package/src/kit/components/Object3DDocumentToolbar.tsx +18 -84
- package/src/kit/components/Object3DDocumentViewport.tsx +5 -8
- package/src/kit/components/StageHost.css +40 -0
- package/src/kit/components/StageHost.tsx +181 -404
- package/src/kit/components/StageOverlays.tsx +1 -2
- package/src/kit/components/StatsOverlay.tsx +5 -17
- package/src/kit/components/ViewportFurniture.tsx +27 -154
- package/src/kit/components/ViewportOverlay.tsx +13 -17
- package/src/kit/components/ViewportOverlaysMenu.tsx +177 -0
- package/src/kit/components/ViewportShadingMenu.tsx +2 -42
- package/src/kit/components/ViewportViewMenu.tsx +7 -18
- package/src/kit/components/asset-viewers/EntityModelDocument.tsx +4 -13
- package/src/kit/components/asset-viewers/EnvironmentAssetDocument.tsx +5 -5
- package/src/kit/components/asset-viewers/LiveModuleDocument.tsx +24 -102
- package/src/kit/components/asset-viewers/LutAssetDocument.tsx +6 -6
- package/src/kit/components/asset-viewers/Object3DPreview.tsx +10 -45
- package/src/kit/components/asset-viewers/QuarksAssetDocument.tsx +2 -2
- package/src/kit/components/asset-viewers/ShaderAssetDocument.tsx +11 -10
- package/src/kit/components/asset-viewers/shader-source.ts +144 -0
- package/src/kit/components/asset-viewers/three-asset-viewers.tsx +2 -14
- package/src/kit/components/object3d-contribution-surfaces.tsx +1 -1
- package/src/kit/components/stage-keyboard.tsx +6 -12
- package/src/kit/components/stage-overlay-set.tsx +11 -20
- package/src/kit/components/stage-presence-markers.ts +9 -32
- package/src/kit/components/stage-transform-chrome.ts +4 -4
- package/src/kit/components/stage-transform-tools.tsx +7 -14
- package/src/kit/components/standard-viewport-dressing.ts +47 -167
- package/src/kit/components/world-root-binding.ts +2 -7
- package/src/kit/constraint-helper.ts +1 -1
- package/src/kit/document-renderer-session.ts +114 -0
- package/src/kit/editor-presentation-activity.ts +58 -0
- package/src/kit/editor-shell-store.ts +31 -403
- package/src/kit/editor-viewport.ts +476 -1762
- package/src/kit/entity-lod.ts +3 -16
- package/src/kit/entity-object.ts +1 -39
- package/src/kit/hierarchy-mark-reader.ts +13 -30
- package/src/kit/instanced-presentation.ts +1 -47
- package/src/kit/live-gesture-lock.ts +35 -0
- package/src/kit/live-module-source.ts +12 -52
- package/src/kit/model-thumbnail.ts +7 -35
- package/src/kit/play-camera-flight.ts +7 -16
- package/src/kit/projection/three.ts +13 -366
- package/src/kit/retained-document-states.ts +91 -0
- package/src/kit/scene-document-viewport.ts +3 -3
- package/src/kit/scene-framing.ts +11 -152
- package/src/kit/scene-view-fog.ts +2 -47
- package/src/kit/spatial-handle-visuals.ts +19 -28
- package/src/kit/stories/three-story-model.ts +5 -33
- package/src/kit/three-canvas-render.ts +3 -4
- package/src/kit/three-hierarchy-row-media.ts +3 -11
- package/src/kit/three-inspection-media.ts +6 -6
- package/src/kit/three-integration.ts +18 -18
- package/src/kit/three-state.ts +2 -19
- package/src/kit/three-viewport/camera-fit.ts +2 -6
- package/src/kit/three-viewport/selection-brackets.ts +5 -20
- package/src/kit/three-viewport/selection-outline.ts +4 -56
- package/src/kit/three-viewport/skeleton-helper.ts +1 -32
- package/src/kit/three-viewport/source-color.ts +1 -33
- package/src/kit/three-viewport/studio-environment.ts +4 -55
- package/src/kit/three-viewport-presentation.ts +23 -0
- package/src/kit/transport-strip.tsx +147 -0
- package/src/kit/viewport-actions.ts +8 -50
- package/src/kit/viewport-authoring-policy.ts +5 -52
- package/src/kit/viewport-commands.ts +28 -57
- package/src/kit/viewport-hotkeys.ts +29 -31
- package/src/kit/viewport-status-facet.ts +4 -5
- package/src/kit/viewport-surface-status.tsx +44 -0
- package/src/loader.ts +8 -71
- package/src/object3d-contributions.ts +18 -34
- package/src/viewport/clip-planes.ts +4 -32
- package/src/viewport/content-bounds.ts +13 -142
- package/src/viewport/editor-layers.ts +4 -26
- package/src/viewport/environment.ts +1 -1
- package/src/viewport/preview-renderer.ts +7 -45
- package/src/viewport/renderer-ownership.ts +14 -62
- package/src/viewport-api.ts +14 -33
- package/src/viewport-door.ts +16 -86
- package/contributions/three-integration.service.ts +0 -13
- package/src/adapter/hierarchy-marks.ts +0 -156
- package/src/adapter/ingest/scene-capture.ts +0 -843
- package/src/adapter/ingest/structural-ids.ts +0 -139
- package/src/adapter/ingest/visible-capture-window.ts +0 -302
- package/src/adapter/renderer-config.ts +0 -115
- package/src/asset-parse-error.ts +0 -29
- package/src/host-hierarchy-objects.ts +0 -31
- package/src/kit/authoring/design-time-settle.ts +0 -343
- package/src/kit/camera-authoring.ts +0 -175
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* aspect, and returns frustum half-extents or a configured
|
|
7
|
-
* `THREE.OrthographicCamera`. Nothing in this module traverses a scene,
|
|
8
|
-
* renders, or allocates GPU resources — the traversal that FEEDS it
|
|
9
|
-
* (`forEachRenderableVertex`) stays in `asset-preview.ts`, because that is
|
|
10
|
-
* scene-graph knowledge rather than geometry.
|
|
11
|
-
*
|
|
12
|
-
* Two facts drove the extraction:
|
|
13
|
-
*
|
|
14
|
-
* 1. A turntable shot must be framed from the subject's ACTUAL projected
|
|
15
|
-
* extent along that shot's own camera axes. The engine used to derive
|
|
16
|
-
* every yaw's frame from ONE world-axis-aligned bounding box, which is a
|
|
17
|
-
* proxy: it is conservative for a compact subject and wasteful for a
|
|
18
|
-
* long one held in a bent pose, and it centres every yaw on the AABB's
|
|
19
|
-
* centre rather than on what that yaw actually sees.
|
|
20
|
-
* 2. A `bone-zoom` crop needs the same freedom of angle the turntable has.
|
|
21
|
-
* Its basis used to be hardcoded to +Z, so a crop anchored on the tail of
|
|
22
|
-
* an 8 m quadruped photographed the hind legs standing in front of it.
|
|
23
|
-
*
|
|
24
|
-
* @see {@link turntableViewBasis} for the yaw convention both shot kinds share.
|
|
2
|
+
* Pure asset-preview framing math: take projected points, a camera basis and output aspect, and
|
|
3
|
+
* return frustum extents or an orthographic camera. Each shot measures the subject in its own view
|
|
4
|
+
* basis, including angled bone crops. Scene traversal and GPU rendering belong to asset-preview.ts.
|
|
5
|
+
* See turntableViewBasis for the shared yaw convention.
|
|
25
6
|
*/
|
|
26
7
|
import * as THREE from 'three';
|
|
27
8
|
|
|
@@ -43,16 +24,7 @@ export interface OrthographicViewBasis {
|
|
|
43
24
|
up: THREE.Vector3;
|
|
44
25
|
}
|
|
45
26
|
|
|
46
|
-
/**
|
|
47
|
-
* The turntable yaw convention, shared by `turntable` shots and — since the
|
|
48
|
-
* `bone-zoom` yaw was added — by bone-anchored crops too, so a definition
|
|
49
|
-
* reads one angle convention rather than two.
|
|
50
|
-
*
|
|
51
|
-
* `yaw = 0` puts the camera on +Z looking at the subject's front (the
|
|
52
|
-
* direction `faceFrontSubject` normalises the model's own forward to face),
|
|
53
|
-
* and yaw increases toward +X: `PI` is the back, `-PI/2` and `+PI/2` the two
|
|
54
|
-
* sides — the angles shot sets already label 'left' and 'right'.
|
|
55
|
-
*/
|
|
27
|
+
/** Shared turntable and bone-crop yaw convention: zero faces +Z and increasing yaw moves toward +X; PI is the back and ±PI/2 are the sides. */
|
|
56
28
|
export function turntableViewBasis(yaw: number): OrthographicViewBasis {
|
|
57
29
|
const direction = new THREE.Vector3(Math.sin(yaw), 0, Math.cos(yaw));
|
|
58
30
|
const worldUp = new THREE.Vector3(0, 1, 0);
|
|
@@ -152,9 +124,8 @@ export function fitOrthographicFrame(
|
|
|
152
124
|
halfRight: number,
|
|
153
125
|
halfUp: number,
|
|
154
126
|
aspect: number,
|
|
155
|
-
padding: number = ASSET_PREVIEW_PADDING,
|
|
156
127
|
): OrthographicFrame {
|
|
157
|
-
const halfHeight = Math.max(halfUp, halfRight / aspect, MIN_HALF_EXTENT) *
|
|
128
|
+
const halfHeight = Math.max(halfUp, halfRight / aspect, MIN_HALF_EXTENT) * ASSET_PREVIEW_PADDING;
|
|
158
129
|
return { halfHeight, halfWidth: halfHeight * aspect };
|
|
159
130
|
}
|
|
160
131
|
|
|
@@ -162,7 +133,6 @@ export function fitOrthographicFrame(
|
|
|
162
133
|
export function fitProjectedSpanFrame(
|
|
163
134
|
span: ProjectedSpan,
|
|
164
135
|
aspect: number,
|
|
165
|
-
padding: number = ASSET_PREVIEW_PADDING,
|
|
166
136
|
): OrthographicFrame {
|
|
167
137
|
if (isProjectedSpanEmpty(span)) {
|
|
168
138
|
throw new Error('Asset preview cannot frame an empty projected span.');
|
|
@@ -171,29 +141,10 @@ export function fitProjectedSpanFrame(
|
|
|
171
141
|
(span.maxRight - span.minRight) / 2,
|
|
172
142
|
(span.maxUp - span.minUp) / 2,
|
|
173
143
|
aspect,
|
|
174
|
-
padding,
|
|
175
144
|
);
|
|
176
145
|
}
|
|
177
146
|
|
|
178
|
-
/**
|
|
179
|
-
* The frame every turntable shot of one staged subject shares: the UNION of
|
|
180
|
-
* what each yaw needs.
|
|
181
|
-
*
|
|
182
|
-
* Why the union rather than a per-shot exact fit. A verify shot set is read
|
|
183
|
-
* as a SET — the reviewer compares the same junction across yaws (and, on a
|
|
184
|
-
* contact sheet, side by side). A per-shot fit silently rescales the subject
|
|
185
|
-
* between frames, so a wing that looks thicker at yaw 0 than at yaw PI/2
|
|
186
|
-
* would be a framing artefact rather than geometry, which is exactly the
|
|
187
|
-
* kind of false signal a verify render exists to eliminate. The union keeps
|
|
188
|
-
* ONE scale for every turntable shot of a staged subject while each shot is
|
|
189
|
-
* still CENTRED on its own projected span — so nothing clips and nothing
|
|
190
|
-
* rescales.
|
|
191
|
-
*
|
|
192
|
-
* The union is per staged subject (the rest scene, and each named pose's
|
|
193
|
-
* disposable snapshot) rather than across poses: poses are separately
|
|
194
|
-
* staged already, and a single extreme pose must not shrink every other
|
|
195
|
-
* frame in the set.
|
|
196
|
-
*/
|
|
147
|
+
/** Use the union of all yaw projections for one staged subject’s scale while centring each shot on its own span. Stage poses independently so one extreme pose does not shrink other subjects. */
|
|
197
148
|
export function unionOrthographicFrames(frames: readonly OrthographicFrame[]): OrthographicFrame {
|
|
198
149
|
if (frames.length === 0) {
|
|
199
150
|
throw new Error('Asset preview cannot union an empty set of frames.');
|
|
@@ -207,17 +158,7 @@ export function unionOrthographicFrames(frames: readonly OrthographicFrame[]): O
|
|
|
207
158
|
return { halfWidth, halfHeight };
|
|
208
159
|
}
|
|
209
160
|
|
|
210
|
-
/**
|
|
211
|
-
* The frame a bone-anchored crop needs: a margin proportional to the WHOLE
|
|
212
|
-
* model's own bounding radius (never a fixed reference-human height, so a
|
|
213
|
-
* goblin's crop stays goblin-scaled), widened until it actually contains
|
|
214
|
-
* every anchor.
|
|
215
|
-
*
|
|
216
|
-
* Offsets are measured along the SHOT's basis, so a crop taken from the side
|
|
217
|
-
* frames the anchors it names from the side. At the default yaw the basis is
|
|
218
|
-
* (+X, +Y, +Z) and this reduces exactly to the world-axis arithmetic it
|
|
219
|
-
* replaced.
|
|
220
|
-
*/
|
|
161
|
+
/** Fit bone crops with a margin proportional to the whole model’s bounding radius. Measure offsets in the shot’s own basis and widen until every anchor fits. */
|
|
221
162
|
export function fitBoneZoomFrame(
|
|
222
163
|
anchors: readonly THREE.Vector3[],
|
|
223
164
|
center: THREE.Vector3,
|