@volter/editor-threejs 0.5.147 → 0.5.149
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/editor-threejs",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.149",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
"serving": "./dist-node/serving.mjs"
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
|
-
"@volter/editor-project": "0.5.
|
|
138
|
+
"@volter/editor-project": "0.5.149",
|
|
139
139
|
"@sparkjsdev/spark": "^2.1.0",
|
|
140
140
|
"three.quarks": "^0.16.0",
|
|
141
141
|
"zod": "^4.3.6",
|
|
142
142
|
"typescript": "5.9.3",
|
|
143
|
-
"@volter/editor-sdk": "0.5.
|
|
143
|
+
"@volter/editor-sdk": "0.5.149",
|
|
144
144
|
"postprocessing": "6.38.3",
|
|
145
145
|
"quarks.core": "0.16.0",
|
|
146
146
|
"@fortawesome/free-solid-svg-icons": "^7.2.0"
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
useSyncExternalStore,
|
|
25
25
|
} from 'react';
|
|
26
26
|
import * as THREE from 'three';
|
|
27
|
+
import { DocumentScene } from '../../render/document-scene';
|
|
27
28
|
import { registerStageTransport, StageTransport } from '@volter/editor-sdk/kit/animation/stage-transport';
|
|
28
29
|
import { scanClipSubjects } from '../animation/three-clips-subject';
|
|
29
30
|
import { liveGestureActive, whenLiveGestureIdle } from '@volter/editor-sdk/kit/live-gesture-lock';
|
|
@@ -410,7 +411,7 @@ interface DocumentContentBinding {
|
|
|
410
411
|
|
|
411
412
|
/** Persistent editor state. Source revisions own only their content binding. */
|
|
412
413
|
class Object3DDocumentHost {
|
|
413
|
-
readonly scene = new
|
|
414
|
+
readonly scene = new DocumentScene();
|
|
414
415
|
/** This document's store, optionally supplied by its owner. */
|
|
415
416
|
readonly store: EditorShellStore;
|
|
416
417
|
readonly cleanups: Array<() => void> = [];
|
|
@@ -1021,7 +1022,7 @@ export function Object3DDocumentViewport({
|
|
|
1021
1022
|
const studioStage = studioStageRef.current;
|
|
1022
1023
|
const hasShell = hasShellRef.current;
|
|
1023
1024
|
const assetSubject = assetSubjectRef.current;
|
|
1024
|
-
const scene = new
|
|
1025
|
+
const scene = new DocumentScene();
|
|
1025
1026
|
// The image-based light's strength is the view presentation's (its studio preset's), set
|
|
1026
1027
|
// on the rendered scene before every draw (`syncHostScene`). The content scene keeps
|
|
1027
1028
|
// three's default, so a document that authors its own strength still states it here.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
/** The document's holder has no animated pose of its own. Three recomposes a
|
|
4
|
+
* Scene on every render pass and marks it dirty even when its matrix is exactly
|
|
5
|
+
* unchanged, which forces every static descendant's world matrix to be rebuilt.
|
|
6
|
+
* Preserve genuine dirty/forced updates and Three's normal child traversal;
|
|
7
|
+
* avoid creating a new dirty state solely from an unchanged holder pose. */
|
|
8
|
+
export class DocumentScene extends THREE.Scene {
|
|
9
|
+
private readonly previousMatrix = new THREE.Matrix4();
|
|
10
|
+
|
|
11
|
+
override updateMatrix(): void {
|
|
12
|
+
const dirty = this.matrixWorldNeedsUpdate;
|
|
13
|
+
this.previousMatrix.copy(this.matrix);
|
|
14
|
+
super.updateMatrix();
|
|
15
|
+
if (!dirty && this.previousMatrix.equals(this.matrix)) this.matrixWorldNeedsUpdate = false;
|
|
16
|
+
}
|
|
17
|
+
}
|