@babylonjs/inspector 9.8.0 → 9.9.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/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { A as Accordion, i as AccordionSection, l as AccordionSectionItem, m as AttachDebugLayer, n as BooleanBadgePropertyLine, o as BoundProperty, p as BridgeCommandRegistryIdentity, q as BuiltInsExtensionFeed, B as Button, j as ButtonLine, r as Checkbox, C as CheckboxPropertyLine, s as ChildWindow, t as Collapse, v as Color3GradientComponent, w as Color3GradientList, x as Color3PropertyLine, y as Color4GradientComponent, z as Color4GradientList, D as Color4PropertyLine, E as ColorPickerPopup, F as ColorStepGradientComponent, G as ComboBox, H as ComboBoxPropertyLine, I as ConstructorFactory, J as ConvertOptions, K as DebugServiceIdentity, O as DetachDebugLayer, Q as DraggableLine, R as Dropdown, U as EntitySelector, W as ErrorBoundary, X as ExtensibleAccordion, Y as FactorGradientComponent, Z as FactorGradientList, _ as FileUploadLine, $ as GetPropertyDescriptor, a0 as GizmoServiceIdentity, a1 as HexPropertyLine, a2 as InfoLabel, a3 as InputHexField, a4 as InputHsvField, a5 as Inspector, a6 as InterceptFunction, a7 as InterceptProperty, a8 as IsPropertyReadonly, a9 as LineContainer, L as Link, aa as LinkPropertyLine, c as LinkToEntity, ab as LinkToEntityPropertyLine, ac as List, ad as MakeDialogTeachingMoment, ae as MakeLazyComponent, af as MakeModularBridge, ag as MakeModularTool, ah as MakePopoverTeachingMoment, ai as MakePropertyHook, aj as MakeTeachingMoment, ak as MaterialSelector, M as MessageBar, al as NodeSelector, am as NumberDropdown, an as NumberDropdownPropertyLine, N as NumberInputPropertyLine, ao as ObservableCollection, ap as Pane, aq as PlaceholderPropertyLine, P as Popover, ar as PositionedPopover, as as PropertiesServiceIdentity, at as Property, au as PropertyContext, av as PropertyLine, aw as QuaternionPropertyLine, ax as RotationVectorPropertyLine, f as SceneContextIdentity, ay as SceneExplorerServiceIdentity, az as SearchBar, aA as SearchBox, aB as SelectionServiceDefinition, g as SelectionServiceIdentity, aC as SettingsServiceIdentity, aD as SettingsStore, aE as SettingsStoreIdentity, S as ShellServiceIdentity, aF as ShowInspector, aG as SidePaneContainer, aH as SkeletonSelector, aI as Slider, aJ as SpinButton, d as SpinButtonPropertyLine, aK as StartInspectable, aL as StatsServiceIdentity, aM as StringDropdown, aN as StringDropdownPropertyLine, aO as StringifiedPropertyLine, aP as Switch, aQ as SwitchPropertyLine, aR as SyncedSliderInput, aS as SyncedSliderPropertyLine, aT as TeachingMoment, aU as TextAreaPropertyLine, aV as TextInput, T as TextInputPropertyLine, aW as TextPropertyLine, aX as Textarea, aY as TextureSelector, aZ as TextureUpload, a_ as Theme, a$ as ThemeServiceIdentity, b0 as ToastProvider, b1 as ToggleButton, k as ToolsServiceIdentity, b2 as Tooltip, b3 as UploadButton, b4 as Vector2PropertyLine, V as Vector3PropertyLine, b5 as Vector4PropertyLine, b6 as WatcherServiceIdentity, b7 as inspectorAssetNotFoundHandler, b8 as useAngleConverters, b9 as useAsyncResource, ba as useColor3Property, bb as useColor4Property, bc as useEventListener, bd as useEventfulState, b as useInterceptObservable, be as useKeyListener, bf as useKeyState, bg as useObservableCollection, h as useObservableState, bh as useOrderedObservableCollection, bi as usePollingObservable, e as useProperty, bj as usePropertyChangedNotifier, bk as useQuaternionProperty, bl as useResource, bm as useTheme, bn as useThemeMode, a as useToast, bo as useVector3Property } from './index-PYblOaAV.js';
1
+ export { A as Accordion, i as AccordionSection, l as AccordionSectionItem, m as AttachDebugLayer, n as BooleanBadgePropertyLine, o as BoundProperty, p as BridgeCommandRegistryIdentity, q as BuiltInsExtensionFeed, B as Button, j as ButtonLine, r as Checkbox, C as CheckboxPropertyLine, s as ChildWindow, t as Collapse, v as Color3GradientComponent, w as Color3GradientList, x as Color3PropertyLine, y as Color4GradientComponent, z as Color4GradientList, D as Color4PropertyLine, E as ColorPickerPopup, F as ColorStepGradientComponent, G as ComboBox, H as ComboBoxPropertyLine, I as ConstructorFactory, J as ConvertOptions, K as DebugServiceIdentity, O as DetachDebugLayer, Q as DraggableLine, R as Dropdown, U as EntitySelector, W as ErrorBoundary, X as ExtensibleAccordion, Y as FactorGradientComponent, Z as FactorGradientList, _ as FileUploadLine, $ as GetPropertyDescriptor, a0 as GizmoServiceIdentity, a1 as HexPropertyLine, a2 as InfoLabel, a3 as InputHexField, a4 as InputHsvField, a5 as Inspector, a6 as InterceptFunction, a7 as InterceptProperty, a8 as IsPropertyReadonly, a9 as LineContainer, L as Link, aa as LinkPropertyLine, c as LinkToEntity, ab as LinkToEntityPropertyLine, ac as List, ad as MakeDialogTeachingMoment, ae as MakeLazyComponent, af as MakeModularBridge, ag as MakeModularTool, ah as MakePopoverTeachingMoment, ai as MakePropertyHook, aj as MakeTeachingMoment, ak as MaterialSelector, M as MessageBar, al as NodeSelector, am as NumberDropdown, an as NumberDropdownPropertyLine, N as NumberInputPropertyLine, ao as ObservableCollection, ap as Pane, aq as PlaceholderPropertyLine, P as Popover, ar as PositionedPopover, as as PropertiesServiceIdentity, at as Property, au as PropertyContext, av as PropertyLine, aw as QuaternionPropertyLine, ax as RotationVectorPropertyLine, f as SceneContextIdentity, ay as SceneExplorerServiceIdentity, az as SearchBar, aA as SearchBox, aB as SelectionServiceDefinition, g as SelectionServiceIdentity, aC as SettingsServiceIdentity, aD as SettingsStore, aE as SettingsStoreIdentity, S as ShellServiceIdentity, aF as ShowInspector, aG as SidePaneContainer, aH as SkeletonSelector, aI as Slider, aJ as SpinButton, d as SpinButtonPropertyLine, aK as StartInspectable, aL as StatsServiceIdentity, aM as StringDropdown, aN as StringDropdownPropertyLine, aO as StringifiedPropertyLine, aP as Switch, aQ as SwitchPropertyLine, aR as SyncedSliderInput, aS as SyncedSliderPropertyLine, aT as TeachingMoment, aU as TextAreaPropertyLine, aV as TextInput, T as TextInputPropertyLine, aW as TextPropertyLine, aX as Textarea, aY as TextureSelector, aZ as TextureUpload, a_ as Theme, a$ as ThemeServiceIdentity, b0 as ToastProvider, b1 as ToggleButton, k as ToolsServiceIdentity, b2 as Tooltip, b3 as UploadButton, b4 as Vector2PropertyLine, V as Vector3PropertyLine, b5 as Vector4PropertyLine, b6 as WatcherServiceIdentity, b7 as inspectorAssetNotFoundHandler, b8 as useAngleConverters, b9 as useAsyncResource, ba as useColor3Property, bb as useColor4Property, bc as useEventListener, bd as useEventfulState, b as useInterceptObservable, be as useKeyListener, bf as useKeyState, bg as useObservableCollection, h as useObservableState, bh as useOrderedObservableCollection, bi as usePollingObservable, e as useProperty, bj as usePropertyChangedNotifier, bk as useQuaternionProperty, bl as useResource, bm as useTheme, bn as useThemeMode, a as useToast, bo as useVector3Property } from './index-UoPnMkyH.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@fluentui/react-components';
@@ -146,6 +146,8 @@ import '@babylonjs/core/Misc/videoRecorder.js';
146
146
  import '@babylonjs/core/Misc/sceneSerializer.js';
147
147
  import '@babylonjs/core/Misc/environmentTextureTools.js';
148
148
  import '@babylonjs/core/SmartAssets/smartAssetManager.js';
149
+ import '@babylonjs/core/Loading/Plugins/babylonFileLoader.js';
150
+ import '@babylonjs/core/SmartAssets/smartAssetSerializer.js';
149
151
  import '@babylonjs/core/Loading/sceneLoader.js';
150
152
  import '@babylonjs/core/Misc/filesInput.js';
151
153
  import '@babylonjs/loaders/glTF/2.0/glTFLoaderExtensionRegistry.js';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Defines the shape of an override entry — a property diff applied to a
3
+ * scene object identified by name. Overrides target any object in the
4
+ * scene's standard collections (meshes, materials, lights, etc.) regardless
5
+ * of how that object was created.
6
+ */
7
+ export interface IOverrideEntry {
8
+ /** The type of object to target (e.g., "meshes", "materials", "lights"). */
9
+ readonly targetType: OverrideTargetType;
10
+ /** The name of the target object. Use "" for scene-level overrides. */
11
+ readonly targetName: string;
12
+ /**
13
+ * Disambiguator for when multiple objects in `scene[targetType]` share the
14
+ * same `targetName`. The override applies to the N-th match (0-based) at
15
+ * apply time. When names are unique, use 0.
16
+ */
17
+ readonly targetIndex: number;
18
+ /** Dot-separated property path on the target (e.g., "albedoColor", "position.x"). */
19
+ readonly propertyPath: string;
20
+ /** The override value. */
21
+ readonly value: OverrideValue;
22
+ }
23
+ /**
24
+ * The types of scene objects that can be targeted by overrides.
25
+ */
26
+ export type OverrideTargetType = "meshes" | "materials" | "textures" | "lights" | "cameras" | "animationGroups" | "scene";
27
+ /**
28
+ * An override value. Supports scalars, color/vector arrays, object references,
29
+ * and null (used to clear a slot, e.g. removing a material assignment).
30
+ * - number: scalar property (e.g., intensity, alpha)
31
+ * - string: string property, or "ref:name" / "samTexture:key" / "texture:name" object reference
32
+ * - boolean: boolean property
33
+ * - number[]: array property mapped to Vector3, Color3, Color4, etc.
34
+ * - null: explicitly clear an object-typed slot
35
+ */
36
+ export type OverrideValue = number | string | boolean | number[] | null;
@@ -0,0 +1,176 @@
1
+ import { type Scene } from "@babylonjs/core/scene.js";
2
+ import { Observable, type Observer } from "@babylonjs/core/Misc/observable.js";
3
+ import { type IOverrideEntry, type OverrideTargetType } from "./overrideEntry";
4
+ /**
5
+ * Stateful handle for a scene's property override registry.
6
+ *
7
+ * Override behavior is exposed through module-level functions rather than
8
+ * class methods so callers can import only the operations they need.
9
+ *
10
+ * Overrides are property diffs applied to scene objects identified by name.
11
+ * They persist across reloads and are typically saved alongside a project
12
+ * file. The override manager is fully independent of any other scene
13
+ * subsystem (SmartAssetManager, loaders, etc.) — it works with any object
14
+ * in the scene's standard collections (meshes, materials, lights, …)
15
+ * regardless of how that object was created.
16
+ *
17
+ * When multiple objects share a name (e.g. two materials both called
18
+ * "Default" loaded from different glTFs), {@link IOverrideEntry.targetIndex}
19
+ * disambiguates: it stores the object's position among same-named siblings
20
+ * at capture time and is used to pick the correct one at apply time.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * AddOverride(scene, {
25
+ * targetType: "materials",
26
+ * targetName: "canPaint",
27
+ * targetIndex: 0,
28
+ * propertyPath: "albedoColor",
29
+ * value: [1, 0, 0],
30
+ * });
31
+ * ```
32
+ */
33
+ export type OverrideManager = {
34
+ /**
35
+ * The scene this manager is attached to.
36
+ */
37
+ readonly scene: Scene;
38
+ /**
39
+ * Fires whenever the override registry or applied state changes.
40
+ */
41
+ readonly onChangedObservable: Observable<void>;
42
+ };
43
+ /**
44
+ * Returns the OverrideManager attached to the given scene, creating and
45
+ * attaching one if none exists.
46
+ * @param scene - The scene to look up or attach a manager to.
47
+ * @returns The existing or newly created OverrideManager.
48
+ */
49
+ export declare function GetOverrideManager(scene: Scene): OverrideManager;
50
+ /**
51
+ * Adds an observer that is notified whenever an OverrideManager is created.
52
+ * @param callback - The callback to invoke with each newly created manager.
53
+ * @returns The observer registration.
54
+ */
55
+ export declare function AddOverrideManagerCreatedObserver(callback: (manager: OverrideManager) => void): Observer<OverrideManager>;
56
+ /**
57
+ * Options for {@link AddOverride}.
58
+ */
59
+ export type AddOverrideOptions = {
60
+ /**
61
+ * If the `originalValue` field is present, the override is recorded *without*
62
+ * re-applying it (the caller is presumed to have already mutated the entity)
63
+ * and the field's content is captured as the property's pre-override
64
+ * "original" so {@link RemoveOverride} can restore it later.
65
+ *
66
+ * Inspector-driven edits use this: by the time `onPropertyChanged` fires,
67
+ * the binding has already written the new value, but it still has the prior
68
+ * value in hand. Without this seeding path, an override created via
69
+ * Inspector could never be reverted (the manager would have no record of
70
+ * the pre-edit value).
71
+ *
72
+ * If the field is absent, the override is applied normally and the original
73
+ * is captured by reading the property's current value on first apply.
74
+ */
75
+ readonly originalValue?: unknown;
76
+ };
77
+ /**
78
+ * Adds an override entry and immediately applies it.
79
+ * If an override with the same target coordinates already exists, it is replaced.
80
+ *
81
+ * When the caller has already mutated the target (e.g. an Inspector edit),
82
+ * pass `{ originalValue }` containing the property's prior value — this seeds
83
+ * the original-value map (so {@link RemoveOverride} can restore it) and skips
84
+ * the redundant apply step.
85
+ * @param scene - The scene whose override registry to update.
86
+ * @param entry - The override to add.
87
+ * @param options - Optional behavior modifiers; see {@link AddOverrideOptions}.
88
+ */
89
+ export declare function AddOverride(scene: Scene, entry: IOverrideEntry, options?: AddOverrideOptions): void;
90
+ /**
91
+ * Removes a single override matching the given coordinates. Restores the
92
+ * original value if one was captured.
93
+ * @param scene - The scene whose override registry to update.
94
+ * @param targetType - The target type.
95
+ * @param targetName - The target object name.
96
+ * @param targetIndex - The target index among same-named siblings.
97
+ * @param propertyPath - The property path to un-override.
98
+ * @returns True if an override was removed.
99
+ */
100
+ export declare function RemoveOverride(scene: Scene, targetType: OverrideTargetType, targetName: string, targetIndex: number, propertyPath: string): boolean;
101
+ /**
102
+ * Returns all overrides currently registered with the scene.
103
+ * @param scene - The scene whose override registry to read.
104
+ * @returns A read-only array of override entries.
105
+ */
106
+ export declare function GetOverrides(scene: Scene): readonly IOverrideEntry[];
107
+ /**
108
+ * Removes all overrides, optionally restoring original values.
109
+ * @param scene - The scene whose override registry to clear.
110
+ * @param restoreOriginals - If true, restores all captured original values.
111
+ */
112
+ export declare function ClearOverrides(scene: Scene, restoreOriginals?: boolean): void;
113
+ /**
114
+ * Updates the target coordinates on the override matching a specific (type,
115
+ * old-name, old-index) so it follows an entity rename. Used by capture services
116
+ * to keep overrides attached to a specific object after the user renames it.
117
+ *
118
+ * Only the override at the exact `(targetType, oldName, oldIndex)` slot is
119
+ * updated, so other same-named siblings keep their own overrides untouched.
120
+ *
121
+ * @param scene - The scene whose override registry to update.
122
+ * @param targetType - The target type.
123
+ * @param oldName - The previous name of the renamed entity.
124
+ * @param oldIndex - The previous index of the renamed entity among same-named siblings.
125
+ * @param newName - The new name of the renamed entity.
126
+ * @param newIndex - The new index of the renamed entity among same-named siblings.
127
+ */
128
+ export declare function RenameOverrideTarget(scene: Scene, targetType: OverrideTargetType, oldName: string, oldIndex: number, newName: string, newIndex: number): void;
129
+ /**
130
+ * Rewrites override *values* that reference an entity by name when that entity
131
+ * has been renamed. Mirrors {@link RenameOverrideTarget} but operates on the
132
+ * `value` field rather than the `targetName` field, so overrides whose value
133
+ * is `"ref:oldName"` (material/light/camera references) or `"texture:oldName"`
134
+ * (non-SmartAsset texture references) follow the rename instead of silently
135
+ * pointing at a non-existent entity.
136
+ *
137
+ * SmartAsset texture references (`"samTexture:<key>"`) are unaffected because
138
+ * the SmartAsset key is decoupled from the texture's runtime `name` field.
139
+ *
140
+ * @param scene - The scene whose override registry to update.
141
+ * @param valueScheme - Which encoded-reference prefix to rewrite: `"ref"` for
142
+ * material/light/camera references, `"texture"` for non-SAM textures.
143
+ * @param oldName - The previous name embedded in the reference.
144
+ * @param newName - The new name embedded in the reference.
145
+ */
146
+ export declare function RenameOverrideValueReferences(scene: Scene, valueScheme: "ref" | "texture", oldName: string, newName: string): void;
147
+ /**
148
+ * Applies all overrides to their current targets in the scene.
149
+ *
150
+ * Call this after any scene mutation that might have invalidated previously
151
+ * applied state (asset reload, object recreation, project load). The override
152
+ * manager does not auto-subscribe to other scene subsystems — coordination is
153
+ * the caller's responsibility, which keeps the override system independent.
154
+ * @param scene - The scene whose overrides to apply.
155
+ */
156
+ export declare function ApplyAllOverrides(scene: Scene): void;
157
+ /**
158
+ * Serializes all overrides to a JSON-compatible array.
159
+ * The on-disk shape is identical to the in-memory `IOverrideEntry`.
160
+ * @param scene - The scene whose overrides to serialize.
161
+ * @returns An array of override entries (shallow copies).
162
+ */
163
+ export declare function SerializeOverrides(scene: Scene): IOverrideEntry[];
164
+ /**
165
+ * Loads overrides from a serialized array and applies them.
166
+ * @param scene - The scene whose override registry to populate.
167
+ * @param data - Array of override entries.
168
+ */
169
+ export declare function DeserializeAndApplyOverrides(scene: Scene, data: IOverrideEntry[]): void;
170
+ /**
171
+ * Disposes the manager, clearing all overrides and detaching it from its scene.
172
+ * Safe to call multiple times; subsequent calls are no-ops. Automatically invoked when the
173
+ * owning scene is disposed.
174
+ * @param manager - The override manager state.
175
+ */
176
+ export declare function DisposeOverrideManager(manager: OverrideManager): void;
@@ -0,0 +1,143 @@
1
+ import "@babylonjs/core/Loading/Plugins/babylonFileLoader.js";
2
+ import { type Scene } from "@babylonjs/core/scene.js";
3
+ import { type ISerializedSmartAssetMap } from "@babylonjs/core/SmartAssets/smartAssetSerializer.js";
4
+ import { type IOverrideEntry } from "./overrideEntry";
5
+ /**
6
+ * ## `.babylonproj` project file format
7
+ *
8
+ * The `.babylonproj` zip on disk packages three layers:
9
+ * 1. **SmartAsset registry** — URL references to external assets (glb/gltf/textures
10
+ * loaded via SAM). Local blob/data assets are bundled inside the zip and
11
+ * extracted to fresh blob URLs on load.
12
+ * 2. **OverrideManager state** — declarative property overrides applied after load.
13
+ * 3. **Companion `.babylon`** — meshes, lights, cameras, transform nodes, and
14
+ * materials that are *not* tracked by SAM (i.e. user-created scene content).
15
+ * Plus a `companionBindings` side table mapping material texture slots back
16
+ * to SAM-tracked textures so re-attachment works without embedding texture
17
+ * bytes in the companion.
18
+ *
19
+ * ### What round-trips cleanly
20
+ * - SAM-tracked assets (re-fetched from their URLs or extracted from the zip)
21
+ * - User-created `Mesh` geometry, `Material`s (Standard/PBR/Multi/Node), and
22
+ * `*Texture` slot bindings to SAM textures
23
+ * - `Light`s, `Camera`s, `TransformNode`s, scene/material image processing,
24
+ * clear color, fog, environment intensity
25
+ * - Property overrides on any of the above
26
+ *
27
+ * ### Known gaps (not preserved on save/load)
28
+ * - `PostProcess` attachments to cameras (a post-process attaches to a *specific*
29
+ * camera instance; we dispose+recreate cameras, leaving post-processes orphaned).
30
+ * - `AdvancedDynamicTexture` GUI controls — not in `.babylon` format.
31
+ * - Audio (`Sound` / `AudioEngine` state).
32
+ * - Particle systems with runtime state, baked vertex animations.
33
+ * - Complex shader-driven content like GaussianSplatting: the mesh round-trips
34
+ * but its companion utility materials (`gaussianSplattingDepth`, `ProxyMaterial`)
35
+ * get duplicated on each load cycle.
36
+ * - Skeleton animation playback state.
37
+ *
38
+ * If you hit a "the scene looks different after load" issue, it's almost
39
+ * certainly one of the gaps above rather than camera or mesh state drift.
40
+ */
41
+ /**
42
+ * Reserved smart asset key for user-created objects (materials, lights, cameras)
43
+ * that are persisted as a companion `.babylon` file alongside the project JSON.
44
+ */
45
+ export declare const ProjectLocalsKey = "__project_locals__";
46
+ /**
47
+ * The result of serializing a project. Contains the project JSON and,
48
+ * if the scene has user-created objects, a companion `.babylon` blob.
49
+ */
50
+ export interface IProjectBundle {
51
+ /** The project JSON document (assets + overrides, no embedded scene data). */
52
+ readonly project: ISerializedProject;
53
+ /**
54
+ * A companion `.babylon` file containing user-created objects not owned by
55
+ * any smart asset. Undefined if there are no such objects.
56
+ */
57
+ readonly companionBabylon?: Blob;
58
+ }
59
+ /**
60
+ * Maps each user-created material (by name) to its texture-slot bindings.
61
+ * A binding records "this `*Texture` slot on this material should be
62
+ * re-attached to the SmartAsset registered under this key" so that texture
63
+ * references survive a save/load round-trip without embedding the texture
64
+ * data inside the companion `.babylon`.
65
+ */
66
+ export type CompanionTextureBindings = Record<string, Record<string, string>>;
67
+ /**
68
+ * A versioned project file that composes a smart asset map with overrides.
69
+ * This is the unified on-disk format for persisting a complete project.
70
+ */
71
+ export interface ISerializedProject {
72
+ /** Schema version. Must be 2 for the current version. */
73
+ readonly version: 2;
74
+ /** Smart asset key→URL mappings (from SmartAssetManager). */
75
+ readonly assets: ISerializedSmartAssetMap["assets"];
76
+ /** Property overrides (from OverrideManager). */
77
+ readonly overrides: IOverrideEntry[];
78
+ /**
79
+ * Optional bindings that re-attach SmartAsset-tracked textures to
80
+ * user-created material slots after the companion `.babylon` loads.
81
+ * Omitted when no user-created material references a SmartAsset texture.
82
+ */
83
+ readonly companionBindings?: CompanionTextureBindings;
84
+ }
85
+ /**
86
+ * Serializes a scene's smart asset map and override registry into a project
87
+ * bundle. User-created objects (materials, lights, cameras not owned by any
88
+ * smart asset) are serialized into a companion `.babylon` file rather than
89
+ * embedded in the project JSON.
90
+ *
91
+ * Both managers are looked up (and created if missing) via their respective
92
+ * `Get…Manager(scene)` accessors, so this function can be called on any scene.
93
+ *
94
+ * @param scene - The scene to serialize.
95
+ * @param baseUrl - Optional base URL for making asset paths relative.
96
+ * @returns A project bundle containing the JSON document and optional companion file.
97
+ */
98
+ export declare function SerializeProject(scene: Scene, baseUrl?: string): IProjectBundle;
99
+ /**
100
+ * Loads a project file from a URL, File, or pre-parsed object.
101
+ * Registers all asset entries on the scene's SmartAssetManager, loads all
102
+ * assets (including the companion `.babylon` for user-created objects), then
103
+ * applies all overrides via the OverrideManager.
104
+ *
105
+ * For loading the `.babylonproj` zip on-disk format, use {@link LoadProjectFileAsync}
106
+ * instead — it extracts the zip and then calls this function with the embedded
107
+ * JSON document.
108
+ *
109
+ * @param scene - The scene to populate.
110
+ * @param source - A URL string, File object, or pre-parsed ISerializedProject.
111
+ * @param rootUrl - Optional root URL for resolving relative asset paths.
112
+ */
113
+ export declare function LoadProjectAsync(scene: Scene, source: string | File | ISerializedProject, rootUrl?: string): Promise<void>;
114
+ /**
115
+ * Validates and parses a serialized project document.
116
+ * @param data - The raw data to validate (typically parsed JSON).
117
+ * @returns The validated project document.
118
+ * @throws If the data does not conform to the expected schema.
119
+ */
120
+ export declare function DeserializeProject(data: unknown): ISerializedProject;
121
+ /**
122
+ * Serializes a scene's project (smart assets + overrides) into a `.babylonproj`
123
+ * zip bundle.
124
+ *
125
+ * The zip contains:
126
+ * - `project.json` — the project document (assets + overrides)
127
+ * - `__project_locals__.babylon` — companion file for user-created objects (if any)
128
+ * - Bundled local asset files (blobs the user dragged in from disk)
129
+ *
130
+ * Remote URLs (http/https) are left as references and not bundled.
131
+ *
132
+ * @param scene - The scene to serialize.
133
+ * @returns A Blob containing the zip bundle.
134
+ */
135
+ export declare function SaveProjectFileAsync(scene: Scene): Promise<Blob>;
136
+ /**
137
+ * Loads a `.babylonproj` zip bundle into a scene. Extracts all files, creates
138
+ * blob URLs for bundled assets, and loads the project through SAM.
139
+ *
140
+ * @param scene - The scene to load the project into.
141
+ * @param zipFile - The `.babylonproj` zip file to load.
142
+ */
143
+ export declare function LoadProjectFileAsync(scene: Scene, zipFile: File): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { P as Popover, a as useToast, b as useInterceptObservable, B as Button, c as LinkToEntity, T as TextInputPropertyLine, d as SpinButtonPropertyLine, C as CheckboxPropertyLine, V as Vector3PropertyLine, e as useProperty, M as MessageBar, S as ShellServiceIdentity, f as SceneContextIdentity, g as SelectionServiceIdentity, h as useObservableState, A as Accordion, i as AccordionSection } from './index-PYblOaAV.js';
2
+ import { P as Popover, a as useToast, b as useInterceptObservable, B as Button, c as LinkToEntity, T as TextInputPropertyLine, d as SpinButtonPropertyLine, C as CheckboxPropertyLine, V as Vector3PropertyLine, e as useProperty, M as MessageBar, S as ShellServiceIdentity, f as SceneContextIdentity, g as SelectionServiceIdentity, h as useObservableState, A as Accordion, i as AccordionSection } from './index-UoPnMkyH.js';
3
3
  import { SettingsRegular, CollectionsAdd20Regular } from '@fluentui/react-icons';
4
4
  import '@babylonjs/core/Particles/webgl2ParticleSystem.js';
5
5
  import '@babylonjs/core/Rendering/prePassRendererSceneComponent.js';
@@ -156,6 +156,8 @@ import '@babylonjs/core/Misc/videoRecorder.js';
156
156
  import '@babylonjs/core/Misc/sceneSerializer.js';
157
157
  import '@babylonjs/core/Misc/environmentTextureTools.js';
158
158
  import '@babylonjs/core/SmartAssets/smartAssetManager.js';
159
+ import '@babylonjs/core/Loading/Plugins/babylonFileLoader.js';
160
+ import '@babylonjs/core/SmartAssets/smartAssetSerializer.js';
159
161
  import '@babylonjs/loaders/glTF/2.0/glTFLoaderExtensionRegistry.js';
160
162
  import '@babylonjs/loaders/glTF/glTFFileLoader.js';
161
163
  import '@babylonjs/loaders/glTF/glTFValidation.js';
@@ -776,4 +778,4 @@ var quickCreateToolsService = {
776
778
  };
777
779
 
778
780
  export { CreateToolsServiceDefinition, quickCreateToolsService as default };
779
- //# sourceMappingURL=quickCreateToolsService-8d6rBO-A.js.map
781
+ //# sourceMappingURL=quickCreateToolsService-CXUBvaDf.js.map