@babylonjs/loaders 9.26.1 → 9.27.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/SPLAT/gaussianSplattingStream.d.ts +79 -25
- package/SPLAT/gaussianSplattingStream.js +320 -95
- package/SPLAT/gaussianSplattingStream.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_avif.pure.js +1 -1
- package/glTF/2.0/Extensions/EXT_texture_avif.pure.js.map +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.pure.js +1 -1
- package/glTF/2.0/Extensions/EXT_texture_webp.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +143 -3
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +622 -99
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.d.ts +47 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js +68 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.d.ts +24 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js +38 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.d.ts +41 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js +63 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +6 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.js +6 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphExporter.d.ts +243 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphExporter.js +2335 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphExporter.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.d.ts +193 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js +919 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +30 -10
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +485 -54
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.d.ts +2 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js +7 -2
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.d.ts +24 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js +89 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.d.ts +6 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.js +6 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.pure.d.ts +59 -1
- package/glTF/2.0/Extensions/KHR_interactivity.pure.js +129 -77
- package/glTF/2.0/Extensions/KHR_interactivity.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.types.d.ts +18 -1
- package/glTF/2.0/Extensions/KHR_interactivity.types.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.d.ts +2 -0
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js +114 -56
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.d.ts +2 -0
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.js +80 -35
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.pure.js +1 -1
- package/glTF/2.0/Extensions/KHR_texture_basisu.pure.js.map +1 -1
- package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js +3 -2
- package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js.map +1 -1
- package/glTF/2.0/Extensions/objectModelMapping.d.ts +4 -2
- package/glTF/2.0/Extensions/objectModelMapping.js +33 -4
- package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -1
- package/glTF/2.0/glTFLoader.pure.d.ts +3 -2
- package/glTF/2.0/glTFLoader.pure.js +50 -8
- package/glTF/2.0/glTFLoader.pure.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +2 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +9 -0
- package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { type IKHRInteractivity } from "babylonjs-gltf2interface";
|
|
2
|
+
import { type AnimationGroup } from "@babylonjs/core/Animations/animationGroup.js";
|
|
3
|
+
import { type FlowGraph } from "@babylonjs/core/FlowGraph/flowGraph.js";
|
|
4
|
+
import { type Material } from "@babylonjs/core/Materials/material.js";
|
|
5
|
+
import { type Node } from "@babylonjs/core/node.js";
|
|
6
|
+
import { type Camera } from "@babylonjs/core/Cameras/camera.js";
|
|
7
|
+
import { type IGLTF } from "../../glTFLoaderInterfaces.js";
|
|
8
|
+
import { type IKHRInteractivityDocument } from "./interactivityGraphModel.js";
|
|
9
|
+
/**
|
|
10
|
+
* Export support classification for a FlowGraph block or imported composite.
|
|
11
|
+
*/
|
|
12
|
+
export type KHRInteractivityExportClassification = "exact" | "inverse-composite" | "unsupported" | "lossy";
|
|
13
|
+
/**
|
|
14
|
+
* Structured KHR_interactivity export diagnostic.
|
|
15
|
+
*/
|
|
16
|
+
export interface IKHRInteractivityExportDiagnostic {
|
|
17
|
+
/** Stable diagnostic code. */
|
|
18
|
+
code: "GRAPH_SOURCE_MISSING" | "GRAPH_COUNT_MISMATCH" | "NODE_SOURCE_MISSING" | "BLOCK_PROVENANCE_INVALID" | "BLOCK_ROLE_MISSING" | "BLOCK_ROLE_DUPLICATE" | "BLOCK_TYPE_MISMATCH" | "BLOCK_UNSUPPORTED" | "BLOCK_AMBIGUOUS" | "COMPOSITE_CONNECTION_CHANGED" | "SOCKET_PROVENANCE_MISSING" | "SOCKET_CONNECTION_AMBIGUOUS" | "SOCKET_TARGET_UNREPRESENTABLE" | "INPUT_DEFAULT_UNREPRESENTABLE" | "VALUE_UNREPRESENTABLE" | "CONFIGURATION_UNREPRESENTABLE" | "REFERENCE_UNRESOLVED" | "DEPENDENCY_CYCLE" | "GRAPH_INVALID";
|
|
19
|
+
/** JSON pointer or FlowGraph location associated with the issue. */
|
|
20
|
+
path: string;
|
|
21
|
+
/** Human-readable actionable diagnostic. */
|
|
22
|
+
message: string;
|
|
23
|
+
/** Diagnostic severity. */
|
|
24
|
+
severity: "error" | "warning";
|
|
25
|
+
/** Source graph index, when known. */
|
|
26
|
+
graphIndex?: number;
|
|
27
|
+
/** Source node index, when known. */
|
|
28
|
+
nodeIndex?: number;
|
|
29
|
+
/** FlowGraph block id, when known. */
|
|
30
|
+
blockId?: string;
|
|
31
|
+
/** KHR socket id, when known. */
|
|
32
|
+
socket?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Representability result for one logical KHR node or standalone FlowGraph block.
|
|
36
|
+
*/
|
|
37
|
+
export interface IKHRInteractivityNodeExportAnalysis {
|
|
38
|
+
/** Source graph index. */
|
|
39
|
+
graphIndex: number;
|
|
40
|
+
/** Source KHR node index, when this is an imported node. */
|
|
41
|
+
nodeIndex?: number;
|
|
42
|
+
/** Full KHR operation name, when known. */
|
|
43
|
+
operation?: string;
|
|
44
|
+
/** FlowGraph blocks participating in this logical node. */
|
|
45
|
+
blockIds: string[];
|
|
46
|
+
/** Export support classification. */
|
|
47
|
+
classification: KHRInteractivityExportClassification;
|
|
48
|
+
/** Diagnostics scoped to this logical node. */
|
|
49
|
+
diagnostics: IKHRInteractivityExportDiagnostic[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Complete representability analysis for a KHR_interactivity export.
|
|
53
|
+
*/
|
|
54
|
+
export interface IKHRInteractivityExportAnalysis {
|
|
55
|
+
/** True when every graph can be exported without loss or ambiguity. */
|
|
56
|
+
representable: boolean;
|
|
57
|
+
/** Per-node classifications in deterministic graph/source order. */
|
|
58
|
+
nodes: IKHRInteractivityNodeExportAnalysis[];
|
|
59
|
+
/** All diagnostics in deterministic order. */
|
|
60
|
+
diagnostics: IKHRInteractivityExportDiagnostic[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Indexed glTF root collections that KHR_interactivity references can target.
|
|
64
|
+
*/
|
|
65
|
+
export type KhrInteractivityRootCollection = "nodes" | "animations" | "cameras" | "materials" | "meshes" | "textures" | "images" | "samplers" | "skins" | "scenes";
|
|
66
|
+
/**
|
|
67
|
+
* Final glTF remapping context supplied by the serializer extension.
|
|
68
|
+
*/
|
|
69
|
+
export interface IKHRInteractivitySerializerContext {
|
|
70
|
+
/**
|
|
71
|
+
* Gets the final number of glTF nodes.
|
|
72
|
+
* @returns final glTF node count
|
|
73
|
+
*/
|
|
74
|
+
getNodeCount(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the final glTF node index for a Babylon node.
|
|
77
|
+
* @param node Babylon node to resolve
|
|
78
|
+
* @returns final glTF node index, or undefined when the node was not exported
|
|
79
|
+
*/
|
|
80
|
+
getNodeIndex(node: Node): number | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the final glTF animation index for a Babylon animation group.
|
|
83
|
+
* @param animation Babylon animation group to resolve
|
|
84
|
+
* @returns final glTF animation index, or undefined when the animation was not exported
|
|
85
|
+
*/
|
|
86
|
+
getAnimationIndex(animation: AnimationGroup): number | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Gets the final glTF camera index for a Babylon camera.
|
|
89
|
+
* @param camera Babylon camera to resolve
|
|
90
|
+
* @returns final glTF camera index, or undefined when the camera was not exported
|
|
91
|
+
*/
|
|
92
|
+
getCameraIndex(camera: Camera): number | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Gets the final glTF material index for a Babylon material.
|
|
95
|
+
* @param material Babylon material to resolve
|
|
96
|
+
* @returns final glTF material index, or undefined when the material was not exported
|
|
97
|
+
*/
|
|
98
|
+
getMaterialIndex(material: Material): number | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the final glTF index for an imported Babylon entity in a root collection.
|
|
101
|
+
* @param collection target glTF root collection
|
|
102
|
+
* @param entity imported Babylon entity associated with the source entry
|
|
103
|
+
* @returns final glTF index, or undefined when the entity was not exported uniquely
|
|
104
|
+
*/
|
|
105
|
+
getRootIndex?(collection: KhrInteractivityRootCollection, entity: object): number | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Writes a companion extension on an already-exported glTF node.
|
|
108
|
+
* @param nodeIndex final glTF node index
|
|
109
|
+
* @param extensionName companion extension name
|
|
110
|
+
* @param value companion extension payload
|
|
111
|
+
*/
|
|
112
|
+
setNodeExtension(nodeIndex: number, extensionName: string, value: unknown): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Provider consumed by the KHR_interactivity serializer extension.
|
|
116
|
+
*/
|
|
117
|
+
export interface IKHRInteractivityExportProvider {
|
|
118
|
+
/** Whether KHR_interactivity must be listed in extensionsRequired. */
|
|
119
|
+
readonly required: boolean;
|
|
120
|
+
/** Other extensions referenced or emitted by the interactivity export. */
|
|
121
|
+
readonly additionalExtensionsUsed: readonly string[];
|
|
122
|
+
/** Other extensions that must be listed in extensionsRequired. */
|
|
123
|
+
readonly additionalExtensionsRequired: readonly string[];
|
|
124
|
+
/**
|
|
125
|
+
* Gets the detached representability analysis.
|
|
126
|
+
* @returns current export analysis
|
|
127
|
+
*/
|
|
128
|
+
analyze(): IKHRInteractivityExportAnalysis;
|
|
129
|
+
/**
|
|
130
|
+
* Builds the canonical extension after glTF entity indices are finalized.
|
|
131
|
+
* @param context final serializer remapping context
|
|
132
|
+
* @returns ratified KHR_interactivity extension payload
|
|
133
|
+
*/
|
|
134
|
+
build(context: IKHRInteractivitySerializerContext): IKHRInteractivity;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Options used to create a KHR_interactivity export plan.
|
|
138
|
+
*/
|
|
139
|
+
export interface IKHRInteractivityExportOptions {
|
|
140
|
+
/** Canonical Phase 1 document associated with the FlowGraphs. Required for a lossless export. */
|
|
141
|
+
document?: IKHRInteractivityDocument;
|
|
142
|
+
/** Loader glTF tree used to resolve original entity references. */
|
|
143
|
+
sourceGLTF?: IGLTF;
|
|
144
|
+
/** Root default graph index. Defaults to the canonical document selection or zero. */
|
|
145
|
+
defaultGraphIndex?: number;
|
|
146
|
+
/** Target animation frame rate used by imported animation composites. Defaults to 60. */
|
|
147
|
+
targetFps?: number;
|
|
148
|
+
/** Whether the emitted KHR_interactivity extension is required. Defaults to true. */
|
|
149
|
+
required?: boolean;
|
|
150
|
+
/** Additional extensions that must be required together with the behavior graph. */
|
|
151
|
+
additionalExtensionsRequired?: readonly string[];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Error thrown when export cannot preserve the authored behavior graph.
|
|
155
|
+
*/
|
|
156
|
+
export declare class KHRInteractivityExportError extends Error {
|
|
157
|
+
readonly diagnostics: readonly IKHRInteractivityExportDiagnostic[];
|
|
158
|
+
/**
|
|
159
|
+
* @param diagnostics precise export diagnostics
|
|
160
|
+
*/
|
|
161
|
+
constructor(diagnostics: readonly IKHRInteractivityExportDiagnostic[]);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Detached representability and export plan for one or more FlowGraphs.
|
|
165
|
+
*/
|
|
166
|
+
export declare class KHRInteractivityExportPlan implements IKHRInteractivityExportProvider {
|
|
167
|
+
private readonly _flowGraphs;
|
|
168
|
+
private readonly _options;
|
|
169
|
+
private _analysis;
|
|
170
|
+
private _graphAnalyses;
|
|
171
|
+
private _additionalExtensionsUsed;
|
|
172
|
+
private readonly _rootDiagnostics;
|
|
173
|
+
private _isPreflight;
|
|
174
|
+
/** Whether KHR_interactivity is required in the exported asset. */
|
|
175
|
+
readonly required: boolean;
|
|
176
|
+
/** Additional operation/companion extensions referenced by the exported graphs. */
|
|
177
|
+
get additionalExtensionsUsed(): readonly string[];
|
|
178
|
+
/** Additional extensions explicitly required by the caller. */
|
|
179
|
+
readonly additionalExtensionsRequired: readonly string[];
|
|
180
|
+
/**
|
|
181
|
+
* @param _flowGraphs FlowGraphs to analyze without mutating them
|
|
182
|
+
* @param _options canonical source and export settings
|
|
183
|
+
*/
|
|
184
|
+
constructor(_flowGraphs: readonly FlowGraph[], _options?: IKHRInteractivityExportOptions);
|
|
185
|
+
private _refreshAnalysis;
|
|
186
|
+
private _mergeBuildDiagnostics;
|
|
187
|
+
/**
|
|
188
|
+
* Gets the detached representability analysis.
|
|
189
|
+
* @returns current analysis
|
|
190
|
+
*/
|
|
191
|
+
analyze(): IKHRInteractivityExportAnalysis;
|
|
192
|
+
/**
|
|
193
|
+
* Builds the extension after final glTF entity remapping is available.
|
|
194
|
+
* @param context serializer remapping context
|
|
195
|
+
* @returns canonical KHR_interactivity payload
|
|
196
|
+
*/
|
|
197
|
+
build(context: IKHRInteractivitySerializerContext): IKHRInteractivity;
|
|
198
|
+
private _getSourceGraph;
|
|
199
|
+
private _validateBuildWithSourceIndices;
|
|
200
|
+
private _analyzeGraphs;
|
|
201
|
+
private _classifyStandaloneBlock;
|
|
202
|
+
private _analyzeImportedNodes;
|
|
203
|
+
private _validateUnsupportedExtensionBlock;
|
|
204
|
+
private _validateMappedBlocks;
|
|
205
|
+
private _buildGraph;
|
|
206
|
+
private _rebuildNode;
|
|
207
|
+
private _getMappingObject;
|
|
208
|
+
private _inferSocketProvenance;
|
|
209
|
+
private _isNoOpFlowTarget;
|
|
210
|
+
private _isEffectiveFlowInput;
|
|
211
|
+
private _isEffectiveFlowOutput;
|
|
212
|
+
private _getAllowedDynamicFlowSockets;
|
|
213
|
+
private _resolveValueTypeIndex;
|
|
214
|
+
private _resolveOutputTypeIndex;
|
|
215
|
+
private _isEffectiveValueInput;
|
|
216
|
+
private _rebuildInputValue;
|
|
217
|
+
private _unwrapAnimationTimeHelper;
|
|
218
|
+
private _rebuildConfiguration;
|
|
219
|
+
private _remapPointerTemplateInputs;
|
|
220
|
+
private _updateVariables;
|
|
221
|
+
private _remapValueArray;
|
|
222
|
+
private _topologicallyOrderNodes;
|
|
223
|
+
private _remapGraphReferences;
|
|
224
|
+
private _getVariableReferenceCollection;
|
|
225
|
+
private _getPointerReferenceCollection;
|
|
226
|
+
private _getRemappedRootIndex;
|
|
227
|
+
private _getSourceRootObjects;
|
|
228
|
+
private _getSourceRootIndex;
|
|
229
|
+
private _getExportedObjectIndex;
|
|
230
|
+
private _remapReferenceToCollection;
|
|
231
|
+
private _remapReference;
|
|
232
|
+
private _validateExtensionReferencePreservation;
|
|
233
|
+
private _collectAdditionalExtensions;
|
|
234
|
+
private _writeCompanionNodeExtensions;
|
|
235
|
+
private _sortDiagnostics;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Creates a detached KHR_interactivity export plan without mutating the FlowGraphs.
|
|
239
|
+
* @param flowGraphs graphs to export in root graph order
|
|
240
|
+
* @param options canonical source and serializer settings
|
|
241
|
+
* @returns reusable representability/export provider
|
|
242
|
+
*/
|
|
243
|
+
export declare function CreateKHRInteractivityExportPlan(flowGraphs: readonly FlowGraph[], options?: IKHRInteractivityExportOptions): KHRInteractivityExportPlan;
|