babylon.quarks-editor 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -0
- package/README.md +69 -9
- package/dist/core/assetDragSession.d.ts +1 -1
- package/dist/core/assetTree.d.ts +6 -1
- package/dist/core/assets.d.ts +7 -0
- package/dist/core/assets.js +11 -7
- package/dist/core/binding.d.ts +11 -2
- package/dist/core/binding.js +9 -1
- package/dist/core/collision.d.ts +4 -0
- package/dist/core/collision.js +4 -0
- package/dist/core/colors.d.ts +16 -0
- package/dist/core/colors.js +8 -0
- package/dist/core/defaultEffect.d.ts +5 -4
- package/dist/core/defaultEffect.js +4 -4
- package/dist/core/editorScene.d.ts +1 -1
- package/dist/core/editorSession.d.ts +229 -0
- package/dist/core/editorSession.js +983 -0
- package/dist/core/effectTree.d.ts +6 -1
- package/dist/core/effectTree.js +13 -88
- package/dist/core/emitterShapeWireframe.d.ts +2 -2
- package/dist/core/emitterShapeWireframe.js +45 -13
- package/dist/core/galleryDropMarker.d.ts +2 -2
- package/dist/core/galleryDropMarker.js +6 -6
- package/dist/core/galleryLayout.d.ts +3 -3
- package/dist/core/galleryLayout.js +1 -1
- package/dist/core/galleryPlayback.d.ts +1 -1
- package/dist/core/galleryPlayback.js +2 -1
- package/dist/core/galleryScene.d.ts +4 -4
- package/dist/core/galleryScene.js +3 -3
- package/dist/core/gallerySelectionMarker.d.ts +4 -4
- package/dist/core/gallerySelectionMarker.js +5 -5
- package/dist/core/groups.d.ts +1 -1
- package/dist/core/groups.js +1 -1
- package/dist/core/history.d.ts +7 -1
- package/dist/core/history.js +4 -0
- package/dist/core/indexedDbProjectStore.d.ts +14 -1
- package/dist/core/indexedDbProjectStore.js +13 -0
- package/dist/core/lineShaders.d.ts +2 -2
- package/dist/core/lineShaders.js +2 -2
- package/dist/core/loadEffect.d.ts +2 -2
- package/dist/core/loadEffect.js +1 -1
- package/dist/core/material.d.ts +12 -2
- package/dist/core/pickAssetFiles.js +1 -1
- package/dist/core/playback.d.ts +6 -0
- package/dist/core/projectStore.d.ts +26 -0
- package/dist/core/projectStore.js +1 -0
- package/dist/core/sceneEntries.d.ts +7 -4
- package/dist/core/sceneEntries.js +2 -2
- package/dist/core/scrub.d.ts +2 -2
- package/dist/core/scrub.js +2 -2
- package/dist/core/shapes.d.ts +25 -1
- package/dist/core/shapes.js +5 -0
- package/dist/core/systems.d.ts +4 -2
- package/dist/core/systems.js +3 -1
- package/dist/core/textureExport.d.ts +1 -1
- package/dist/core/timeline.d.ts +25 -5
- package/dist/core/transport.d.ts +3 -3
- package/dist/core/transport.js +2 -2
- package/dist/core/values.d.ts +21 -4
- package/dist/core/values.js +5 -0
- package/dist/core/viewportPicker.d.ts +4 -4
- package/dist/core/viewportPicker.js +8 -7
- package/dist/index.d.ts +25 -21
- package/dist/index.js +12 -12
- package/dist/react/AssetsPanel.d.ts +9 -2
- package/dist/react/AssetsPanel.js +6 -6
- package/dist/react/ChoiceDialog.d.ts +7 -0
- package/dist/react/ChoiceDialog.js +1 -1
- package/dist/react/ContextMenu.d.ts +10 -1
- package/dist/react/ContextMenu.js +1 -1
- package/dist/react/CurveEditor.d.ts +1 -1
- package/dist/react/CurveEditor.js +2 -2
- package/dist/react/EditorWorkspace.d.ts +9 -2
- package/dist/react/EditorWorkspace.js +10 -7
- package/dist/react/EffectEditor.d.ts +11 -5
- package/dist/react/EffectEditor.js +7 -7
- package/dist/react/EffectEditorHost.d.ts +33 -29
- package/dist/react/EffectEditorHost.js +247 -1674
- package/dist/react/EffectTreeView.d.ts +4 -1
- package/dist/react/EffectTreeView.js +3 -3
- package/dist/react/GradientEditor.d.ts +1 -1
- package/dist/react/GradientEditor.js +3 -3
- package/dist/react/InspectorInfoIcon.js +3 -3
- package/dist/react/InspectorLabel.js +3 -3
- package/dist/react/MessageDialog.d.ts +5 -0
- package/dist/react/MessageDialog.js +1 -1
- package/dist/react/ModuleSection.d.ts +10 -0
- package/dist/react/ModuleSection.js +8 -5
- package/dist/react/ObjectModule.d.ts +1 -1
- package/dist/react/ObjectModule.js +4 -4
- package/dist/react/ProjectsPage.d.ts +7 -1
- package/dist/react/ProjectsPage.js +33 -17
- package/dist/react/PromptDialog.d.ts +7 -0
- package/dist/react/PromptDialog.js +1 -1
- package/dist/react/ScenePanel.d.ts +9 -2
- package/dist/react/ScenePanel.js +12 -10
- package/dist/react/SubEmittersModule.d.ts +1 -1
- package/dist/react/SubEmittersModule.js +5 -5
- package/dist/react/TextureSelect.d.ts +24 -0
- package/dist/react/TextureSelect.js +74 -0
- package/dist/react/TextureUVField.d.ts +14 -0
- package/dist/react/TextureUVField.js +23 -0
- package/dist/react/TimelinePanel.d.ts +20 -7
- package/dist/react/TimelinePanel.js +21 -15
- package/dist/react/TimelineTrackRow.d.ts +13 -3
- package/dist/react/TimelineTrackRow.js +6 -6
- package/dist/react/TransportBar.d.ts +13 -4
- package/dist/react/TransportBar.js +3 -3
- package/dist/react/ValueField.d.ts +32 -5
- package/dist/react/ValueField.js +22 -11
- package/dist/react/behaviorModules.d.ts +19 -6
- package/dist/react/behaviorModules.js +68 -17
- package/dist/react/fields.d.ts +9 -0
- package/dist/react/fields.js +6 -3
- package/dist/react/host/BottomDocks.d.ts +36 -0
- package/dist/react/host/BottomDocks.js +63 -0
- package/dist/react/host/HostDialogs.d.ts +50 -0
- package/dist/react/host/HostDialogs.js +113 -0
- package/dist/react/host/InspectorSidebar.d.ts +32 -0
- package/dist/react/host/InspectorSidebar.js +59 -0
- package/dist/react/host/SceneSidebar.d.ts +53 -0
- package/dist/react/host/SceneSidebar.js +62 -0
- package/dist/react/host/ViewportPane.d.ts +56 -0
- package/dist/react/host/ViewportPane.js +91 -0
- package/dist/react/host/hostHooks.d.ts +44 -0
- package/dist/react/host/hostHooks.js +164 -0
- package/dist/react/host/hostStyles.d.ts +21 -0
- package/dist/react/host/hostStyles.js +57 -0
- package/dist/react/index.d.ts +42 -38
- package/dist/react/index.js +25 -23
- package/dist/react/inspectorHints.js +31 -0
- package/dist/react/modules.d.ts +19 -6
- package/dist/react/modules.js +134 -117
- package/dist/react/theme.d.ts +15 -0
- package/dist/react/theme.js +15 -0
- package/dist/session.d.ts +9 -0
- package/dist/session.js +8 -0
- package/package.json +18 -11
- package/src/core/assetDragSession.ts +1 -1
- package/src/core/assetTree.ts +15 -2
- package/src/core/assets.ts +25 -10
- package/src/core/binding.ts +12 -3
- package/src/core/collision.ts +4 -0
- package/src/core/colors.ts +21 -1
- package/src/core/defaultEffect.ts +8 -7
- package/src/core/editorScene.ts +1 -1
- package/src/core/editorSession.ts +1299 -0
- package/src/core/effectTree.ts +18 -101
- package/src/core/emitterShapeWireframe.ts +48 -16
- package/src/core/galleryDropMarker.ts +8 -8
- package/src/core/galleryLayout.ts +4 -4
- package/src/core/galleryPlayback.ts +3 -2
- package/src/core/galleryScene.ts +5 -5
- package/src/core/gallerySelectionMarker.ts +7 -7
- package/src/core/groups.ts +1 -1
- package/src/core/history.ts +7 -1
- package/src/core/indexedDbProjectStore.ts +14 -1
- package/src/core/lineShaders.ts +2 -2
- package/src/core/loadEffect.ts +4 -4
- package/src/core/material.ts +14 -4
- package/src/core/pickAssetFiles.ts +2 -2
- package/src/core/playback.ts +6 -0
- package/src/core/projectStore.ts +26 -0
- package/src/core/sceneEntries.ts +8 -5
- package/src/core/scrub.ts +3 -3
- package/src/core/shapes.ts +29 -2
- package/src/core/systems.ts +11 -4
- package/src/core/textureExport.ts +1 -1
- package/src/core/timeline.ts +43 -18
- package/src/core/transport.ts +4 -4
- package/src/core/values.ts +20 -4
- package/src/core/viewportPicker.ts +12 -11
- package/src/index.ts +25 -21
- package/src/react/AssetsPanel.tsx +13 -6
- package/src/react/ChoiceDialog.tsx +8 -1
- package/src/react/ContextMenu.tsx +11 -2
- package/src/react/CurveEditor.tsx +2 -2
- package/src/react/EditorWorkspace.tsx +16 -10
- package/src/react/EffectEditor.tsx +17 -9
- package/src/react/EffectEditorHost.tsx +415 -2354
- package/src/react/EffectTreeView.tsx +7 -4
- package/src/react/GradientEditor.tsx +3 -3
- package/src/react/InspectorInfoIcon.tsx +3 -3
- package/src/react/InspectorLabel.tsx +3 -3
- package/src/react/MessageDialog.tsx +6 -1
- package/src/react/ModuleSection.tsx +15 -4
- package/src/react/ObjectModule.tsx +5 -5
- package/src/react/ProjectsPage.tsx +44 -17
- package/src/react/PromptDialog.tsx +8 -1
- package/src/react/ScenePanel.tsx +21 -12
- package/src/react/SubEmittersModule.tsx +6 -6
- package/src/react/TextureSelect.tsx +118 -0
- package/src/react/TextureUVField.tsx +62 -0
- package/src/react/TimelinePanel.tsx +40 -21
- package/src/react/TimelineTrackRow.tsx +19 -9
- package/src/react/TransportBar.tsx +16 -7
- package/src/react/ValueField.tsx +60 -16
- package/src/react/behaviorModules.tsx +240 -55
- package/src/react/fields.tsx +22 -4
- package/src/react/host/BottomDocks.tsx +178 -0
- package/src/react/host/HostDialogs.tsx +228 -0
- package/src/react/host/InspectorSidebar.tsx +147 -0
- package/src/react/host/SceneSidebar.tsx +227 -0
- package/src/react/host/ViewportPane.tsx +300 -0
- package/src/react/host/hostHooks.ts +198 -0
- package/src/react/host/hostStyles.ts +65 -0
- package/src/react/index.ts +43 -38
- package/src/react/inspectorHints.ts +40 -0
- package/src/react/modules.tsx +440 -170
- package/src/react/theme.ts +15 -0
- package/src/session.ts +17 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera.js';
|
|
2
|
+
import '@babylonjs/core/Culling/ray.js';
|
|
3
|
+
import type { AbstractEngine } from '@babylonjs/core/Engines/abstractEngine.js';
|
|
4
|
+
import { GizmoManager } from '@babylonjs/core/Gizmos/gizmoManager.js';
|
|
5
|
+
import type { Texture } from '@babylonjs/core/Materials/Textures/texture.js';
|
|
6
|
+
import type { Mesh } from '@babylonjs/core/Meshes/mesh.js';
|
|
7
|
+
import type { TransformNode } from '@babylonjs/core/Meshes/transformNode.js';
|
|
8
|
+
import { Scene } from '@babylonjs/core/scene.js';
|
|
9
|
+
import { BatchedRenderer } from 'babylon.quarks';
|
|
10
|
+
import { type AssetDragPayload } from './assetTree.js';
|
|
11
|
+
import { type AssetLoadProgress, type EffectAsset } from './assets.js';
|
|
12
|
+
import type { EffectBinding } from './binding.js';
|
|
13
|
+
import { EffectHistory } from './history.js';
|
|
14
|
+
import { type PlaybackState } from './playback.js';
|
|
15
|
+
import type { ProjectStore } from './projectStore.js';
|
|
16
|
+
import { type SceneEntry } from './sceneEntries.js';
|
|
17
|
+
/** What an editor session hands its host once it is live, and again whenever the focused effect changes. */
|
|
18
|
+
export interface EffectEditorHostHandle {
|
|
19
|
+
/** The focused effect's binding; reading it throws when no effect is focused. */
|
|
20
|
+
binding: EffectBinding;
|
|
21
|
+
/** Undo/redo of the focused effect. */
|
|
22
|
+
history: EffectHistory;
|
|
23
|
+
/** The editor's preview scene. */
|
|
24
|
+
scene: Scene;
|
|
25
|
+
/** The renderer every effect in the scene draws through. */
|
|
26
|
+
renderer: BatchedRenderer;
|
|
27
|
+
/** Replaces the scene with this effect (it is also added to Assets). */
|
|
28
|
+
importJson: (json: unknown) => void;
|
|
29
|
+
/** Imports effect files (and the texture/geometry files they reference) into Assets. */
|
|
30
|
+
importAssets: (files: FileList | File[]) => Promise<void>;
|
|
31
|
+
/** @deprecated Renamed to `importAssets`. */
|
|
32
|
+
importGallery: (files: FileList | File[]) => Promise<void>;
|
|
33
|
+
/** The focused effect as quarks JSON; throws when no effect is focused. */
|
|
34
|
+
exportJson: () => string;
|
|
35
|
+
}
|
|
36
|
+
/** A project an editor session loads its assets and scene from, and saves them to. */
|
|
37
|
+
export interface EditorProject {
|
|
38
|
+
/** Where the project lives. */
|
|
39
|
+
store: ProjectStore;
|
|
40
|
+
/** The project's id in `store`. */
|
|
41
|
+
id: string;
|
|
42
|
+
/** The project's display name. */
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
/** Which prefab is open, as the host shows it. */
|
|
46
|
+
export interface PrefabInfo {
|
|
47
|
+
/** The asset's display name. */
|
|
48
|
+
name: string;
|
|
49
|
+
/** The asset's path in Assets. */
|
|
50
|
+
path: string;
|
|
51
|
+
}
|
|
52
|
+
/** Live readouts a session writes every frame. */
|
|
53
|
+
export interface EditorFrameStats {
|
|
54
|
+
/** Frames per second, rounded. */
|
|
55
|
+
fps: number;
|
|
56
|
+
/** Time and particle count of the focused effect, e.g. `1.2s / 3.0s · 240 particles`. */
|
|
57
|
+
counter: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* How an editor session reports to its host. A React host passes its state setters. Callbacks
|
|
61
|
+
* run synchronously from the action that changed the value, except `frame` (from the render
|
|
62
|
+
* loop) and the results of asynchronous work: asset import progress and a project's load. None
|
|
63
|
+
* runs after the session is disposed.
|
|
64
|
+
*/
|
|
65
|
+
export interface EditorSessionView {
|
|
66
|
+
/** The focused effect's binding changed (`null`: nothing is focused). */
|
|
67
|
+
bindingChanged(binding: EffectBinding | null): void;
|
|
68
|
+
/** The node selected in the focused effect changed. */
|
|
69
|
+
selectedNodeChanged(node: TransformNode | null): void;
|
|
70
|
+
/** The focused effect's root changed. */
|
|
71
|
+
focusedRootChanged(root: TransformNode | null): void;
|
|
72
|
+
/** The scene's entries changed. */
|
|
73
|
+
entriesChanged(entries: SceneEntry[]): void;
|
|
74
|
+
/** Assets changed. */
|
|
75
|
+
assetsChanged(assets: EffectAsset[]): void;
|
|
76
|
+
/** The set of shown entries changed, by root `uniqueId`. */
|
|
77
|
+
visibleChanged(rootIds: number[]): void;
|
|
78
|
+
/** The entry shown alone changed (`null`: none). */
|
|
79
|
+
soloChanged(rootId: number | null): void;
|
|
80
|
+
/** An asset import started, progressed (a progress value) or ended (`null`). */
|
|
81
|
+
assetsLoadingChanged(progress: AssetLoadProgress | null): void;
|
|
82
|
+
/** The scene has unsaved changes, or no longer has. */
|
|
83
|
+
sceneDirtyChanged(dirty: boolean): void;
|
|
84
|
+
/** The project's scene finished loading, or failed to. */
|
|
85
|
+
projectLoaded(): void;
|
|
86
|
+
/** The open prefab changed (`null`: back to the scene). */
|
|
87
|
+
prefabChanged(info: PrefabInfo | null): void;
|
|
88
|
+
/** The open prefab has unsaved edits, or no longer has. */
|
|
89
|
+
prefabDirtyChanged(dirty: boolean): void;
|
|
90
|
+
/** Opening another asset waits on what to do with the open prefab's unsaved edits. */
|
|
91
|
+
prefabSwitchRequested(asset: {
|
|
92
|
+
id: number;
|
|
93
|
+
name: string;
|
|
94
|
+
}): void;
|
|
95
|
+
/** The asset drag hovering the viewport changed (`null`: none). */
|
|
96
|
+
dragHoverChanged(hover: {
|
|
97
|
+
label: string;
|
|
98
|
+
count: number;
|
|
99
|
+
} | null): void;
|
|
100
|
+
/** Something was added to Assets that the user should see. */
|
|
101
|
+
assetsRevealed(): void;
|
|
102
|
+
/** Something changed that has no state of its own, such as an undo stack; re-render. */
|
|
103
|
+
refresh(): void;
|
|
104
|
+
/** A short notice. */
|
|
105
|
+
toast(text: string): void;
|
|
106
|
+
/** A notice the user dismisses. */
|
|
107
|
+
message(title: string, text: string): void;
|
|
108
|
+
/** The session is live, or what it hands out changed. */
|
|
109
|
+
ready(handle: EffectEditorHostHandle): void;
|
|
110
|
+
/** A frame was drawn. */
|
|
111
|
+
frame(stats: EditorFrameStats): void;
|
|
112
|
+
}
|
|
113
|
+
/** What an editor session is built from. */
|
|
114
|
+
export interface EditorSessionOptions {
|
|
115
|
+
/** The engine to draw with; its rendering canvas, if any, drives the camera and picking. */
|
|
116
|
+
engine: AbstractEngine;
|
|
117
|
+
/** Playback state shared with the host's transport and timeline. */
|
|
118
|
+
playback: PlaybackState;
|
|
119
|
+
/** How the session reports to its host; a callback left out is not called. */
|
|
120
|
+
view: Partial<EditorSessionView>;
|
|
121
|
+
/** The project to load and save; without it the session works in memory only. */
|
|
122
|
+
project?: EditorProject;
|
|
123
|
+
/** Quarks JSON to open when there is no project; a default effect is created when omitted. */
|
|
124
|
+
effectJson?: unknown;
|
|
125
|
+
/** Texture loader for new default effects. */
|
|
126
|
+
resolveTexture?: (url: string, scene: Scene) => Texture | null | undefined;
|
|
127
|
+
/** Texture URL of new default effects. */
|
|
128
|
+
defaultTextureUrl?: string;
|
|
129
|
+
/** True while an asset is being dragged over the viewport; viewport picking pauses meanwhile. */
|
|
130
|
+
isAssetDragActive?: () => boolean;
|
|
131
|
+
/** The node selected in the host, kept across undo and redo. */
|
|
132
|
+
getSelectedNode?: () => TransformNode | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The editor's headless half: the preview scene, the effects placed in it, Assets, prefab mode,
|
|
136
|
+
* the project's scene and undo, without any UI. `EffectEditorHost` is its React view; any
|
|
137
|
+
* other host can drive it through these actions and {@link EditorSessionView}.
|
|
138
|
+
*/
|
|
139
|
+
export interface EditorSession {
|
|
140
|
+
/** The engine the session draws with. */
|
|
141
|
+
readonly engine: AbstractEngine;
|
|
142
|
+
/** The preview scene. */
|
|
143
|
+
readonly scene: Scene;
|
|
144
|
+
/** The orbit camera. */
|
|
145
|
+
readonly camera: ArcRotateCamera;
|
|
146
|
+
/** The grid the effects stand on. */
|
|
147
|
+
readonly ground: Mesh;
|
|
148
|
+
/** The renderer every effect draws through. */
|
|
149
|
+
readonly renderer: BatchedRenderer;
|
|
150
|
+
/** Undo/redo of the focused effect. */
|
|
151
|
+
readonly history: EffectHistory;
|
|
152
|
+
/** The transform gizmos. */
|
|
153
|
+
readonly gizmoManager: GizmoManager;
|
|
154
|
+
/** The focused effect's binding, if any. */
|
|
155
|
+
readonly binding: EffectBinding | null;
|
|
156
|
+
/** The effects in the scene (in prefab mode, just the prefab's instance). */
|
|
157
|
+
readonly sceneEntries: SceneEntry[];
|
|
158
|
+
/** The shown entries, by root `uniqueId`. */
|
|
159
|
+
readonly visibleRootIds: number[];
|
|
160
|
+
/** Assets. */
|
|
161
|
+
readonly assets: EffectAsset[];
|
|
162
|
+
/** True while a prefab is open. */
|
|
163
|
+
readonly isPrefabOpen: boolean;
|
|
164
|
+
/** Imports effect files into Assets; throws when nothing new was found. */
|
|
165
|
+
importAssets(files: FileList | File[]): Promise<void>;
|
|
166
|
+
/** Replaces the scene with this effect, also added to Assets. */
|
|
167
|
+
importJson(json: unknown): void;
|
|
168
|
+
/** Focuses an entry and frames it. */
|
|
169
|
+
focusEntry(entry: SceneEntry | null, moveCamera?: boolean): void;
|
|
170
|
+
/** Shows or hides an entry. */
|
|
171
|
+
toggleVisible(entry: SceneEntry): void;
|
|
172
|
+
/** Shows an entry alone, or ends solo when it already is. */
|
|
173
|
+
toggleSolo(entry: SceneEntry): void;
|
|
174
|
+
/** Removes an entry from the scene. */
|
|
175
|
+
deleteEntry(entry: SceneEntry): void;
|
|
176
|
+
/** Removes the focused entry, if any; returns whether it did. */
|
|
177
|
+
deleteFocused(): boolean;
|
|
178
|
+
/** Adds a default effect at the camera target. */
|
|
179
|
+
createDefault(): void;
|
|
180
|
+
/** Where dragged assets would land, and what they are, for the drag preview. */
|
|
181
|
+
previewDrop(clientX: number, clientY: number): void;
|
|
182
|
+
/** Places dragged assets where they were dropped. */
|
|
183
|
+
placeDrop(clientX: number, clientY: number, dataTransfer?: DataTransfer): void;
|
|
184
|
+
/** Hides the drag preview while the drag goes on elsewhere. */
|
|
185
|
+
hideDropPreview(): void;
|
|
186
|
+
/** Hides the drag preview and forgets the drag, once it ended. */
|
|
187
|
+
clearDropPreview(): void;
|
|
188
|
+
/** Shows or hides wireframes of the focused effect's emitter shapes. */
|
|
189
|
+
setEmitterWireframesVisible(visible: boolean): void;
|
|
190
|
+
/** Adds assets at the camera target. */
|
|
191
|
+
addToScene(payload: AssetDragPayload): void;
|
|
192
|
+
/** Removes assets. */
|
|
193
|
+
deleteAssets(payload: AssetDragPayload): void;
|
|
194
|
+
/** Saves an entry as a new asset at `Folder/Name` and makes it an instance of it. */
|
|
195
|
+
saveEntryAsAsset(entry: SceneEntry, path: string): void;
|
|
196
|
+
/** Saves the scene to the project; resolves to false when it could not. */
|
|
197
|
+
saveScene(): Promise<boolean>;
|
|
198
|
+
/** Opens an asset on its own, setting the scene aside. */
|
|
199
|
+
openPrefab(assetId: number, discardChanges?: boolean): void;
|
|
200
|
+
/** Overwrites the open prefab's asset with the edits. */
|
|
201
|
+
overwritePrefab(): void;
|
|
202
|
+
/** Saves the open prefab as a new asset and keeps editing that one. */
|
|
203
|
+
savePrefabAsNew(path: string): void;
|
|
204
|
+
/** Leaves prefab mode without saving. */
|
|
205
|
+
closePrefab(): void;
|
|
206
|
+
/** Scene instances of the open prefab's asset. */
|
|
207
|
+
prefabInstanceCount(): number;
|
|
208
|
+
/** Undoes (`redo` false) or redoes a change to the focused effect. */
|
|
209
|
+
historyStep(redo: boolean): void;
|
|
210
|
+
/** Re-applies playback to the scene after the host changed `playback.stagePlaying`. */
|
|
211
|
+
syncPlayback(): void;
|
|
212
|
+
/** The handle a host hands to its embedder. */
|
|
213
|
+
makeHandle(): EffectEditorHostHandle;
|
|
214
|
+
/** Loads the project, or the initial effect, and starts the render loop. Later calls do nothing. */
|
|
215
|
+
start(): void;
|
|
216
|
+
/**
|
|
217
|
+
* Stops the render loop and frees the scene, the markers and the gizmos. Work still in flight
|
|
218
|
+
* (a project load, an asset import) is dropped when it finishes. The engine is the caller's.
|
|
219
|
+
*/
|
|
220
|
+
dispose(): void;
|
|
221
|
+
}
|
|
222
|
+
/** `Folder/Name` typed by the user → a clean asset path ending in `.json`. */
|
|
223
|
+
export declare function normalizeAssetPath(input: string): string;
|
|
224
|
+
/** Position of `node` in its effect tree (0 = root), to find the same node after a rebuild. */
|
|
225
|
+
export declare function nodeIndexInEffect(root: TransformNode, node: TransformNode | null): number;
|
|
226
|
+
/** The node at `index` in an effect tree, as {@link nodeIndexInEffect} counts; the root when out of range. */
|
|
227
|
+
export declare function nodeAtIndex(root: TransformNode, index: number): TransformNode;
|
|
228
|
+
/** Builds the editor's scene on `options.engine`; call `start()` once the host is ready for callbacks. */
|
|
229
|
+
export declare function createEditorSession(options: EditorSessionOptions): EditorSession;
|