@volter/editor-blender 0.1.24 → 0.1.25
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.
|
@@ -54,6 +54,8 @@ import {
|
|
|
54
54
|
type BlenderOutlinerHandle,
|
|
55
55
|
blenderCreatableKinds,
|
|
56
56
|
blenderOutlinerHandle,
|
|
57
|
+
blenderOutlinerHandlesVersion,
|
|
58
|
+
subscribeBlenderOutlinerHandles,
|
|
57
59
|
runBlenderObjectOperator,
|
|
58
60
|
} from './blender-outliner-authoring';
|
|
59
61
|
import { blenderOutlinerVersion, subscribeBlenderOutliner } from './blender-outliner-model';
|
|
@@ -258,6 +260,8 @@ export function BlenderObjectModeHeader({
|
|
|
258
260
|
// The tree is what says which objects exist and which are selected, and both
|
|
259
261
|
// menus read it, so the bar re-renders on the Outliner's own version.
|
|
260
262
|
useSyncExternalStore(subscribeBlenderOutliner, blenderOutlinerVersion, blenderOutlinerVersion);
|
|
263
|
+
// And on the set of live Outliners: the handle this bar acts through may arrive after its first render.
|
|
264
|
+
useSyncExternalStore(subscribeBlenderOutlinerHandles, blenderOutlinerHandlesVersion, blenderOutlinerHandlesVersion);
|
|
261
265
|
const [open, setOpen] = useState<MenuId | null>(null);
|
|
262
266
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
263
267
|
const viewRef = useRef<HTMLDivElement>(null);
|
|
@@ -219,6 +219,31 @@ export interface BlenderOutlinerHandle {
|
|
|
219
219
|
*/
|
|
220
220
|
const liveOutliners = new Set<BlenderOutlinerHandle>();
|
|
221
221
|
|
|
222
|
+
/**
|
|
223
|
+
* A HANDLE ARRIVING IS NEWS. A header drawn before its document's stage made an Outliner has no
|
|
224
|
+
* subject and draws nothing; the tree's own version does not move when a handle registers, so
|
|
225
|
+
* without this it stayed empty until the next edit (measured: a cold load showed no View, Select,
|
|
226
|
+
* Add or Object until a script changed the tree). Notified on the next turn, never inside the
|
|
227
|
+
* render that made the handle.
|
|
228
|
+
*/
|
|
229
|
+
let liveOutlinersVersion = 0;
|
|
230
|
+
const liveOutlinerListeners = new Set<() => void>();
|
|
231
|
+
function liveOutlinersChanged(): void {
|
|
232
|
+
queueMicrotask(() => {
|
|
233
|
+
liveOutlinersVersion++;
|
|
234
|
+
for (const listener of liveOutlinerListeners) listener();
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
export function subscribeBlenderOutlinerHandles(listener: () => void): () => void {
|
|
238
|
+
liveOutlinerListeners.add(listener);
|
|
239
|
+
return () => {
|
|
240
|
+
liveOutlinerListeners.delete(listener);
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
export function blenderOutlinerHandlesVersion(): number {
|
|
244
|
+
return liveOutlinersVersion;
|
|
245
|
+
}
|
|
246
|
+
|
|
222
247
|
/**
|
|
223
248
|
* The Outliner handle for a document, for the header that draws over it: the one its own stage
|
|
224
249
|
* made (a stage's adapter names its document `object3d-document:<id>`).
|
|
@@ -1754,6 +1779,7 @@ export function blenderOutlinerAuthoringFor(
|
|
|
1754
1779
|
},
|
|
1755
1780
|
};
|
|
1756
1781
|
liveOutliners.add(handle);
|
|
1782
|
+
liveOutlinersChanged();
|
|
1757
1783
|
|
|
1758
1784
|
// THE ENGINE'S SELECTION ARRIVES ON ITS OWN, and this is what listens for
|
|
1759
1785
|
// it: a frame (every present carries `selected`/`active`) and a tree read
|
|
@@ -1773,6 +1799,7 @@ export function blenderOutlinerAuthoringFor(
|
|
|
1773
1799
|
stopEngineFrames();
|
|
1774
1800
|
stopEngineTree();
|
|
1775
1801
|
liveOutliners.delete(handle);
|
|
1802
|
+
liveOutlinersChanged();
|
|
1776
1803
|
listeners.clear();
|
|
1777
1804
|
},
|
|
1778
1805
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@volter/editor-blender",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
4
|
"license": "AGPL-3.0-only AND GPL-3.0-or-later",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.25",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
73
|
-
"@volter/blender-engine": "0.1.
|
|
74
|
-
"@volter/editor-threejs": "0.5.
|
|
73
|
+
"@volter/blender-engine": "0.1.23",
|
|
74
|
+
"@volter/editor-threejs": "0.5.85",
|
|
75
75
|
"zod": "^4.3.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@volter/editor-live": "0.5.
|
|
79
|
-
"@volter/editor-project": "0.5.
|
|
80
|
-
"@volter/editor-sdk": "0.5.
|
|
78
|
+
"@volter/editor-live": "0.5.85",
|
|
79
|
+
"@volter/editor-project": "0.5.85",
|
|
80
|
+
"@volter/editor-sdk": "0.5.85",
|
|
81
81
|
"react": "^19.0.0",
|
|
82
82
|
"react-dom": "^19.0.0",
|
|
83
83
|
"three": "^0.180.0",
|