babylonjs-loaders 9.26.0 → 9.26.2
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/babylon.glTF2FileLoader.js +1 -1
- package/babylon.glTF2FileLoader.js.map +1 -1
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +1 -1
- package/babylon.glTFFileLoader.js.map +1 -1
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +1505 -92
- package/babylonjs.loaders.es5.js +13257 -8699
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.js.map +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +3068 -202
- package/package.json +3 -3
|
@@ -2946,8 +2946,9 @@ export interface IGLTFLoaderExtension extends IGLTFBaseLoaderExtension, IDisposa
|
|
|
2946
2946
|
onLoading?(): void;
|
|
2947
2947
|
/**
|
|
2948
2948
|
* Called after the loader state changes to READY.
|
|
2949
|
+
* @returns a promise when the extension has asynchronous readiness work
|
|
2949
2950
|
*/
|
|
2950
|
-
onReady?(): void
|
|
2951
|
+
onReady?(): void | Promise<void>;
|
|
2951
2952
|
/**
|
|
2952
2953
|
* Define this method to modify the default behavior when loading scenes.
|
|
2953
2954
|
* @param context The context when loading the asset
|
|
@@ -3548,7 +3549,7 @@ export class GLTFLoader implements IGLTFLoader {
|
|
|
3548
3549
|
private _forEachExtensions;
|
|
3549
3550
|
private _applyExtensions;
|
|
3550
3551
|
private _extensionsOnLoading;
|
|
3551
|
-
private
|
|
3552
|
+
private _extensionsOnReadyAsync;
|
|
3552
3553
|
private _extensionsLoadSceneAsync;
|
|
3553
3554
|
private _extensionsLoadNodeAsync;
|
|
3554
3555
|
private _extensionsLoadCameraAsync;
|
|
@@ -4237,9 +4238,10 @@ export interface IGLTFObjectModelTreeExtensionsObject {
|
|
|
4237
4238
|
/**
|
|
4238
4239
|
* get a path-to-object converter for the given glTF tree
|
|
4239
4240
|
* @param gltf the glTF tree to use
|
|
4241
|
+
* @param configure optional callback for adding asset-local accessors to this converter
|
|
4240
4242
|
* @returns a path-to-object converter for the given glTF tree
|
|
4241
4243
|
*/
|
|
4242
|
-
export function GetPathToObjectConverter(gltf: IGLTF): GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
4244
|
+
export function GetPathToObjectConverter(gltf: IGLTF, configure?: (mapping: object) => void): GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
4243
4245
|
/**
|
|
4244
4246
|
* This function will return the object accessor for the given key in the object model
|
|
4245
4247
|
* If the key is not found, it will return undefined
|
|
@@ -4258,8 +4260,9 @@ export function SetInterpolationForKey(key: string, interpolation?: IInterpolati
|
|
|
4258
4260
|
* Note that this will NOT change the typescript types. To do that you will need to change the interface itself (extending it in the module that uses it)
|
|
4259
4261
|
* @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
|
|
4260
4262
|
* @param accessor the object accessor to add
|
|
4263
|
+
* @param mapping object-model mapping to update; defaults to the process-wide mapping used as the template for new converters
|
|
4261
4264
|
*/
|
|
4262
|
-
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType
|
|
4265
|
+
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>, mapping?: object): void;
|
|
4263
4266
|
export {};
|
|
4264
4267
|
|
|
4265
4268
|
}
|
|
@@ -5173,6 +5176,8 @@ export class KHR_node_selectability implements IGLTFLoaderExtension {
|
|
|
5173
5176
|
* The name of this extension.
|
|
5174
5177
|
*/
|
|
5175
5178
|
readonly name: string;
|
|
5179
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
5180
|
+
readonly order: number;
|
|
5176
5181
|
/**
|
|
5177
5182
|
* Defines whether this extension is enabled.
|
|
5178
5183
|
*/
|
|
@@ -5230,6 +5235,8 @@ export class KHR_node_hoverability implements IGLTFLoaderExtension {
|
|
|
5230
5235
|
* The name of this extension.
|
|
5231
5236
|
*/
|
|
5232
5237
|
readonly name: string;
|
|
5238
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
5239
|
+
readonly order: number;
|
|
5233
5240
|
/**
|
|
5234
5241
|
* Defines whether this extension is enabled.
|
|
5235
5242
|
*/
|
|
@@ -6615,7 +6622,24 @@ module "babylonjs-loaders/glTF/glTFFileLoader" {
|
|
|
6615
6622
|
/**
|
|
6616
6623
|
* Defines options for the KHR_interactivity extension.
|
|
6617
6624
|
*/
|
|
6618
|
-
["KHR_interactivity"]: {
|
|
6625
|
+
["KHR_interactivity"]: {
|
|
6626
|
+
/**
|
|
6627
|
+
* Whether the selected default graph starts automatically after import.
|
|
6628
|
+
* Defaults to true.
|
|
6629
|
+
*/
|
|
6630
|
+
autoStart?: boolean;
|
|
6631
|
+
/**
|
|
6632
|
+
* Whether to retain only the canonical source model and executable
|
|
6633
|
+
* FlowGraph serialization without constructing runtime graphs.
|
|
6634
|
+
* Defaults to false.
|
|
6635
|
+
*/
|
|
6636
|
+
parseOnly?: boolean;
|
|
6637
|
+
/**
|
|
6638
|
+
* Whether to enforce the ratified graph validation rules.
|
|
6639
|
+
* Defaults to true. Set to false only for pre-ratification assets.
|
|
6640
|
+
*/
|
|
6641
|
+
strictValidation?: boolean;
|
|
6642
|
+
};
|
|
6619
6643
|
}
|
|
6620
6644
|
}
|
|
6621
6645
|
|
|
@@ -6623,7 +6647,58 @@ module "babylonjs-loaders/glTF/glTFFileLoader" {
|
|
|
6623
6647
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity.pure" {
|
|
6624
6648
|
import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader.pure";
|
|
6625
6649
|
import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
|
|
6650
|
+
import { FlowGraphCoordinator } from "babylonjs/FlowGraph/flowGraphCoordinator";
|
|
6626
6651
|
import { Scene } from "babylonjs/scene";
|
|
6652
|
+
import { CompositePathToObjectConverter } from "babylonjs-loaders/glTF/2.0/Extensions/compositePathToObjectConverter";
|
|
6653
|
+
import { InteractivityHostResolver } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver";
|
|
6654
|
+
import { IObjectAccessor, ISerializedFlowGraph } from "babylonjs/FlowGraph/typeDefinitions";
|
|
6655
|
+
import { IKHRInteractivityDiagnostic, IKHRInteractivityDocument, IKHRInteractivityGraphModel } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel";
|
|
6656
|
+
import { FlowGraph } from "babylonjs/FlowGraph/flowGraph";
|
|
6657
|
+
/**
|
|
6658
|
+
* Runtime projection of one canonical KHR_interactivity graph.
|
|
6659
|
+
*/
|
|
6660
|
+
export interface IKHRInteractivityGraphImportResult {
|
|
6661
|
+
/** Canonical source graph and diagnostics. */
|
|
6662
|
+
graph: IKHRInteractivityGraphModel;
|
|
6663
|
+
/** Executable FlowGraph serialization when lowering succeeded. */
|
|
6664
|
+
serializedFlowGraph?: ISerializedFlowGraph;
|
|
6665
|
+
/** Runtime FlowGraph when runtime construction was requested. */
|
|
6666
|
+
flowGraph?: FlowGraph;
|
|
6667
|
+
/** Coordinator that owns the runtime FlowGraph. */
|
|
6668
|
+
coordinator?: FlowGraphCoordinator;
|
|
6669
|
+
/** Additional lowering/runtime diagnostics. */
|
|
6670
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
6671
|
+
}
|
|
6672
|
+
/**
|
|
6673
|
+
* Completed KHR_interactivity import result associated with a loaded scene.
|
|
6674
|
+
*/
|
|
6675
|
+
export interface IKHRInteractivityImportResult {
|
|
6676
|
+
/** Stable zero-based identity of this interactivity asset among assets appended to the scene. */
|
|
6677
|
+
assetIndex: number;
|
|
6678
|
+
/** Canonical, lossless source document. */
|
|
6679
|
+
document: IKHRInteractivityDocument;
|
|
6680
|
+
/** Graph import results in source order. */
|
|
6681
|
+
graphs: IKHRInteractivityGraphImportResult[];
|
|
6682
|
+
/** Shared path converter required by pointer blocks. */
|
|
6683
|
+
pathConverter: CompositePathToObjectConverter<IObjectAccessor>;
|
|
6684
|
+
/** Live glTF loader data used by glTF data-provider blocks. */
|
|
6685
|
+
glTF: GLTFLoader["gltf"];
|
|
6686
|
+
/** Host resolver that supplies KHR reference semantics to executable graphs. */
|
|
6687
|
+
hostResolver: InteractivityHostResolver;
|
|
6688
|
+
}
|
|
6689
|
+
/**
|
|
6690
|
+
* Gets the completed KHR_interactivity import result for a loaded scene.
|
|
6691
|
+
* @param scene scene loaded from the glTF asset
|
|
6692
|
+
* @returns the import result, or undefined when the scene has no KHR_interactivity data
|
|
6693
|
+
*/
|
|
6694
|
+
export function GetKHRInteractivityImportResult(scene: Scene): IKHRInteractivityImportResult | undefined;
|
|
6695
|
+
/**
|
|
6696
|
+
* Gets every completed KHR_interactivity import result appended to a loaded scene.
|
|
6697
|
+
* Results remain in asset load order and each result has a stable {@link IKHRInteractivityImportResult.assetIndex}.
|
|
6698
|
+
* @param scene scene containing the loaded glTF assets
|
|
6699
|
+
* @returns the scene's import results, or an empty array when it has no KHR_interactivity data
|
|
6700
|
+
*/
|
|
6701
|
+
export function GetKHRInteractivityImportResults(scene: Scene): readonly IKHRInteractivityImportResult[];
|
|
6627
6702
|
/**
|
|
6628
6703
|
* Loader extension for KHR_interactivity
|
|
6629
6704
|
*/
|
|
@@ -6633,6 +6708,8 @@ export class KHR_interactivity implements IGLTFLoaderExtension {
|
|
|
6633
6708
|
* The name of this extension.
|
|
6634
6709
|
*/
|
|
6635
6710
|
readonly name: string;
|
|
6711
|
+
/** Runs after extensions that contribute interactivity operations and object state. */
|
|
6712
|
+
readonly order: number;
|
|
6636
6713
|
/**
|
|
6637
6714
|
* Defines whether this extension is enabled.
|
|
6638
6715
|
*/
|
|
@@ -6644,6 +6721,7 @@ export class KHR_interactivity implements IGLTFLoaderExtension {
|
|
|
6644
6721
|
* @param _loader
|
|
6645
6722
|
*/
|
|
6646
6723
|
constructor(_loader: GLTFLoader);
|
|
6724
|
+
private _initializePathConverter;
|
|
6647
6725
|
dispose(): void;
|
|
6648
6726
|
onReady(): Promise<void>;
|
|
6649
6727
|
}
|
|
@@ -6651,7 +6729,7 @@ export class KHR_interactivity implements IGLTFLoaderExtension {
|
|
|
6651
6729
|
* @internal
|
|
6652
6730
|
* populates the object model with the interactivity extension
|
|
6653
6731
|
*/
|
|
6654
|
-
export function _AddInteractivityObjectModel(scene: Scene): void;
|
|
6732
|
+
export function _AddInteractivityObjectModel(scene: Scene, targetFps: number, mapping: object): void;
|
|
6655
6733
|
/**
|
|
6656
6734
|
* @internal
|
|
6657
6735
|
* Registers KHR_interactivity runtime dependencies without changing the extension registry.
|
|
@@ -7380,6 +7458,11 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/pure" {
|
|
|
7380
7458
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper";
|
|
7381
7459
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser";
|
|
7382
7460
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider";
|
|
7461
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock";
|
|
7462
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock";
|
|
7463
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock";
|
|
7464
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel";
|
|
7465
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState";
|
|
7383
7466
|
|
|
7384
7467
|
}
|
|
7385
7468
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityReferences" {
|
|
@@ -7428,6 +7511,33 @@ export function GetEventReferenceKey(reference: string): string | undefined;
|
|
|
7428
7511
|
*/
|
|
7429
7512
|
export function IsEventReference(value: unknown): value is string;
|
|
7430
7513
|
|
|
7514
|
+
}
|
|
7515
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState" {
|
|
7516
|
+
import { INode } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
7517
|
+
type InteractivityNodeState = "hoverable" | "selectable";
|
|
7518
|
+
/**
|
|
7519
|
+
* Initializes authored and inherited selectability or hoverability state.
|
|
7520
|
+
* @param nodes all nodes in the glTF asset
|
|
7521
|
+
* @param state state kind to initialize
|
|
7522
|
+
* @param getAuthoredState reads the extension-authored local state
|
|
7523
|
+
*/
|
|
7524
|
+
export function InitializeInteractivityNodeState(nodes: readonly INode[], state: InteractivityNodeState, getAuthoredState: (node: INode) => boolean | undefined): void;
|
|
7525
|
+
/**
|
|
7526
|
+
* Gets the locally authored runtime state for a node.
|
|
7527
|
+
* @param node glTF node
|
|
7528
|
+
* @param state state kind
|
|
7529
|
+
* @returns local state, defaulting to true
|
|
7530
|
+
*/
|
|
7531
|
+
export function GetInteractivityNodeState(node: INode, state: InteractivityNodeState): boolean;
|
|
7532
|
+
/**
|
|
7533
|
+
* Updates local state and reapplies inherited state to the affected subtree.
|
|
7534
|
+
* @param node glTF node
|
|
7535
|
+
* @param state state kind
|
|
7536
|
+
* @param value new local state
|
|
7537
|
+
*/
|
|
7538
|
+
export function SetInteractivityNodeState(node: INode, state: InteractivityNodeState, value: boolean): void;
|
|
7539
|
+
export {};
|
|
7540
|
+
|
|
7431
7541
|
}
|
|
7432
7542
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver" {
|
|
7433
7543
|
import { IFlowGraphHostResolver } from "babylonjs/FlowGraph/flowGraphHostResolver";
|
|
@@ -7450,9 +7560,10 @@ export class InteractivityHostResolver implements IFlowGraphHostResolver {
|
|
|
7450
7560
|
decodeEventReference(reference: string): string | undefined;
|
|
7451
7561
|
/**
|
|
7452
7562
|
* @param reference the reference to decode
|
|
7563
|
+
* @param collection optional glTF root collection the reference must address
|
|
7453
7564
|
* @returns the index the reference denotes, or `undefined` when it is not an indexed JSON Pointer
|
|
7454
7565
|
*/
|
|
7455
|
-
decodeIndexReference(reference: string): number | undefined;
|
|
7566
|
+
decodeIndexReference(reference: string, collection?: string): number | undefined;
|
|
7456
7567
|
/**
|
|
7457
7568
|
* Maps a Babylon object loaded from the glTF back to a JSON Pointer addressing it.
|
|
7458
7569
|
*
|
|
@@ -7475,6 +7586,7 @@ import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
7475
7586
|
import { IGLTFToFlowGraphMapping } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper";
|
|
7476
7587
|
import { ISerializedFlowGraph, ISerializedFlowGraphBlock } from "babylonjs/FlowGraph/typeDefinitions";
|
|
7477
7588
|
import { FlowGraphTypes } from "babylonjs/FlowGraph/flowGraphRichTypes";
|
|
7589
|
+
import { IKHRInteractivityDeclarationModel } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel";
|
|
7478
7590
|
/**
|
|
7479
7591
|
* Description of a KHR_interactivity custom event, as parsed from the
|
|
7480
7592
|
* glTF `events` array. Used by the importer to register the event with the
|
|
@@ -7496,13 +7608,7 @@ export interface InteractivityEvent {
|
|
|
7496
7608
|
value?: any;
|
|
7497
7609
|
}[];
|
|
7498
7610
|
}
|
|
7499
|
-
export
|
|
7500
|
-
[key: string]: {
|
|
7501
|
-
length: number;
|
|
7502
|
-
flowGraphType: FlowGraphTypes;
|
|
7503
|
-
elementType: "number" | "boolean" | "string";
|
|
7504
|
-
};
|
|
7505
|
-
};
|
|
7611
|
+
export { gltfTypeToBabylonType } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel";
|
|
7506
7612
|
/**
|
|
7507
7613
|
* Parses a KHR_interactivity graph definition (the raw glTF JSON object) into
|
|
7508
7614
|
* the serialized FlowGraph form consumed by {@link ParseFlowGraphAsync}.
|
|
@@ -7512,9 +7618,11 @@ export const gltfTypeToBabylonType: {
|
|
|
7512
7618
|
* {@link serializeToFlowGraph}.
|
|
7513
7619
|
*/
|
|
7514
7620
|
export class InteractivityGraphToFlowGraphParser {
|
|
7515
|
-
private _interactivityGraph;
|
|
7516
7621
|
private _gltf;
|
|
7517
7622
|
_animationTargetFps: number;
|
|
7623
|
+
private _graphIndex;
|
|
7624
|
+
private _supportedExtensions?;
|
|
7625
|
+
private _declarationModels?;
|
|
7518
7626
|
/**
|
|
7519
7627
|
* Note - the graph should be rejected if the same type is defined twice.
|
|
7520
7628
|
* We currently don't validate that.
|
|
@@ -7532,16 +7640,22 @@ export class InteractivityGraphToFlowGraphParser {
|
|
|
7532
7640
|
* the last block) is not disturbed, then concatenated into the serialized graph.
|
|
7533
7641
|
*/
|
|
7534
7642
|
private _insertedBlocks;
|
|
7535
|
-
constructor(
|
|
7643
|
+
constructor(interactivityGraph: IKHRInteractivity_Graph, _gltf: IGLTF, _animationTargetFps?: number, _graphIndex?: number, _supportedExtensions?: ReadonlySet<string> | undefined, _declarationModels?: readonly IKHRInteractivityDeclarationModel[] | undefined);
|
|
7644
|
+
private _interactivityGraph;
|
|
7645
|
+
private get _strictValidation();
|
|
7646
|
+
private _hasDefaultFlowInput;
|
|
7647
|
+
private _getAllowedDynamicValueSockets;
|
|
7648
|
+
private _getAllowedDynamicFlowSockets;
|
|
7536
7649
|
get arrays(): {
|
|
7537
7650
|
types: {
|
|
7538
7651
|
length: number;
|
|
7539
7652
|
flowGraphType: FlowGraphTypes;
|
|
7540
|
-
elementType: "number" | "boolean" | "string";
|
|
7653
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
7541
7654
|
}[];
|
|
7542
7655
|
mappings: {
|
|
7543
7656
|
flowGraphMapping: IGLTFToFlowGraphMapping;
|
|
7544
7657
|
fullOperationName: string;
|
|
7658
|
+
declaration: IKHRInteractivityDeclarationModel;
|
|
7545
7659
|
}[];
|
|
7546
7660
|
staticVariables: {
|
|
7547
7661
|
type: FlowGraphTypes;
|
|
@@ -7557,12 +7671,15 @@ export class InteractivityGraphToFlowGraphParser {
|
|
|
7557
7671
|
private _parseDeclarations;
|
|
7558
7672
|
private _parseVariables;
|
|
7559
7673
|
private _parseVariable;
|
|
7674
|
+
private _normalizeStaticReference;
|
|
7560
7675
|
private _parseEvents;
|
|
7561
7676
|
private _parseNodes;
|
|
7562
7677
|
private _getEmptyBlock;
|
|
7678
|
+
private _createUnsupportedExtensionBlock;
|
|
7563
7679
|
private _parseNodeConfiguration;
|
|
7564
7680
|
private _parseNodeConnections;
|
|
7565
7681
|
private _createNewSocketConnection;
|
|
7682
|
+
private _isUnsupportedExtensionBlock;
|
|
7566
7683
|
/**
|
|
7567
7684
|
* Wires an upstream data output into a downstream data input through a runtime multiply block that
|
|
7568
7685
|
* scales the value by the animation target fps. This converts a KHR animation time (seconds),
|
|
@@ -7572,6 +7689,8 @@ export class InteractivityGraphToFlowGraphParser {
|
|
|
7572
7689
|
* @param context the serialized flow graph context that stores literal socket values
|
|
7573
7690
|
* @param upstreamOutput the data output socket providing the time value (in seconds)
|
|
7574
7691
|
* @param downstreamInput the data input socket that expects the time in frames
|
|
7692
|
+
* @param nodeIndex source node receiving the converted value
|
|
7693
|
+
* @param declarationIndex source declaration used by the receiving node
|
|
7575
7694
|
*/
|
|
7576
7695
|
private _connectWithSecondsToFramesConversion;
|
|
7577
7696
|
private _connectFlowGraphNodes;
|
|
@@ -7591,11 +7710,202 @@ export class InteractivityGraphToFlowGraphParser {
|
|
|
7591
7710
|
serializeToFlowGraph(): ISerializedFlowGraph;
|
|
7592
7711
|
}
|
|
7593
7712
|
|
|
7713
|
+
}
|
|
7714
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel" {
|
|
7715
|
+
import { IKHRInteractivity, IKHRInteractivity_Declaration, IKHRInteractivity_Graph } from "babylonjs-gltf2interface";
|
|
7716
|
+
import { FlowGraphTypes } from "babylonjs/FlowGraph/flowGraphRichTypes";
|
|
7717
|
+
/**
|
|
7718
|
+
* Ratified KHR_interactivity specification baseline used by this importer.
|
|
7719
|
+
*/
|
|
7720
|
+
export const KHR_INTERACTIVITY_SPECIFICATION_COMMIT = "f798712c5685bc9223a628140fba707db8889300";
|
|
7721
|
+
/**
|
|
7722
|
+
* Runtime representation of every ratified built-in KHR_interactivity type.
|
|
7723
|
+
*/
|
|
7724
|
+
export const gltfTypeToBabylonType: {
|
|
7725
|
+
[key: string]: {
|
|
7726
|
+
length: number;
|
|
7727
|
+
flowGraphType: FlowGraphTypes;
|
|
7728
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
7729
|
+
};
|
|
7730
|
+
};
|
|
7731
|
+
/**
|
|
7732
|
+
* Classification of a KHR_interactivity declaration.
|
|
7733
|
+
*/
|
|
7734
|
+
export type KHRInteractivityDeclarationSupport = "core" | "extension" | "unsupported-extension" | "unknown-core";
|
|
7735
|
+
/**
|
|
7736
|
+
* A structured KHR_interactivity import diagnostic.
|
|
7737
|
+
*/
|
|
7738
|
+
export interface IKHRInteractivityDiagnostic {
|
|
7739
|
+
/** JSON pointer identifying the source location. */
|
|
7740
|
+
path: string;
|
|
7741
|
+
/** Human-readable diagnostic text. */
|
|
7742
|
+
message: string;
|
|
7743
|
+
/** Diagnostic severity. */
|
|
7744
|
+
severity: "error" | "warning";
|
|
7745
|
+
}
|
|
7746
|
+
/**
|
|
7747
|
+
* Canonical declaration information retained during import.
|
|
7748
|
+
*/
|
|
7749
|
+
export interface IKHRInteractivityDeclarationModel {
|
|
7750
|
+
/** Declaration index in the source graph. */
|
|
7751
|
+
index: number;
|
|
7752
|
+
/** Full operation name, including the defining extension when present. */
|
|
7753
|
+
operation: string;
|
|
7754
|
+
/** Whether Babylon can execute the declaration. */
|
|
7755
|
+
support: KHRInteractivityDeclarationSupport;
|
|
7756
|
+
/** Exact source declaration. */
|
|
7757
|
+
source: IKHRInteractivity_Declaration;
|
|
7758
|
+
}
|
|
7759
|
+
/**
|
|
7760
|
+
* Canonical graph information retained during import.
|
|
7761
|
+
*/
|
|
7762
|
+
export interface IKHRInteractivityGraphModel {
|
|
7763
|
+
/** Graph index in the root extension. */
|
|
7764
|
+
index: number;
|
|
7765
|
+
/** Stable source path. */
|
|
7766
|
+
path: string;
|
|
7767
|
+
/** Human-readable graph name. */
|
|
7768
|
+
name: string;
|
|
7769
|
+
/** Exact source graph, including extension and extras payloads. */
|
|
7770
|
+
source: IKHRInteractivity_Graph;
|
|
7771
|
+
/** Executable graph with specification defaults and fallbacks applied. */
|
|
7772
|
+
effectiveSource: IKHRInteractivity_Graph;
|
|
7773
|
+
/** Canonical declarations in source order. */
|
|
7774
|
+
declarations: IKHRInteractivityDeclarationModel[];
|
|
7775
|
+
/** Validation diagnostics for this graph. */
|
|
7776
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
7777
|
+
/** Whether this graph is valid and can be lowered to FlowGraph. */
|
|
7778
|
+
valid: boolean;
|
|
7779
|
+
}
|
|
7780
|
+
/**
|
|
7781
|
+
* Lossless canonical representation of a KHR_interactivity root extension.
|
|
7782
|
+
*/
|
|
7783
|
+
export interface IKHRInteractivityDocument {
|
|
7784
|
+
/** Ratified specification revision used for validation. */
|
|
7785
|
+
specificationCommit: string;
|
|
7786
|
+
/** Exact source extension, including unknown extensions and extras. */
|
|
7787
|
+
source: IKHRInteractivity;
|
|
7788
|
+
/** Default graph index, or -1 when the source selection is invalid. */
|
|
7789
|
+
defaultGraphIndex: number;
|
|
7790
|
+
/** Canonical graph models in source order. */
|
|
7791
|
+
graphs: IKHRInteractivityGraphModel[];
|
|
7792
|
+
/** Root-level validation diagnostics. */
|
|
7793
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
7794
|
+
}
|
|
7795
|
+
/**
|
|
7796
|
+
* Creates a detached JSON copy of a KHR_interactivity graph.
|
|
7797
|
+
* @param graph source graph
|
|
7798
|
+
* @returns a lossless JSON copy
|
|
7799
|
+
*/
|
|
7800
|
+
export function CloneKHRInteractivityGraph(graph: IKHRInteractivity_Graph): IKHRInteractivity_Graph;
|
|
7801
|
+
/**
|
|
7802
|
+
* Creates the executable graph view with all ratified configuration defaults and fallback rules
|
|
7803
|
+
* applied without modifying the lossless source graph.
|
|
7804
|
+
* @param graph source graph
|
|
7805
|
+
* @param declarations canonical declarations
|
|
7806
|
+
* @param assetNodeCount number of glTF nodes in the containing asset
|
|
7807
|
+
* @returns normalized executable graph
|
|
7808
|
+
*/
|
|
7809
|
+
export function CreateEffectiveKHRInteractivityGraph(graph: IKHRInteractivity_Graph, declarations: readonly IKHRInteractivityDeclarationModel[], assetNodeCount?: number): IKHRInteractivity_Graph;
|
|
7810
|
+
/**
|
|
7811
|
+
* Creates and validates a canonical copy of one KHR_interactivity graph.
|
|
7812
|
+
* @param graph source graph
|
|
7813
|
+
* @param index graph index in the root extension
|
|
7814
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
7815
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
7816
|
+
* @returns the canonical graph model
|
|
7817
|
+
*/
|
|
7818
|
+
export function CreateKHRInteractivityGraphModel(graph: IKHRInteractivity_Graph | null | undefined, index?: number, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityGraphModel;
|
|
7819
|
+
/**
|
|
7820
|
+
* Creates an immutable canonical KHR_interactivity document and validates all graph-local references.
|
|
7821
|
+
* @param extension source extension object from the glTF document
|
|
7822
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
7823
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
7824
|
+
* @returns the canonical document
|
|
7825
|
+
*/
|
|
7826
|
+
export function CreateKHRInteractivityDocument(extension: IKHRInteractivity, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityDocument;
|
|
7827
|
+
|
|
7594
7828
|
}
|
|
7595
7829
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/index" {
|
|
7596
7830
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/declarationMapper";
|
|
7597
7831
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser";
|
|
7598
7832
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider";
|
|
7833
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock";
|
|
7834
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock";
|
|
7835
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock";
|
|
7836
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel";
|
|
7837
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState";
|
|
7838
|
+
|
|
7839
|
+
}
|
|
7840
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock" {
|
|
7841
|
+
import { FlowGraphExecutionBlock } from "babylonjs/FlowGraph/flowGraphExecutionBlock";
|
|
7842
|
+
import { IFlowGraphBlockConfiguration } from "babylonjs/FlowGraph/flowGraphBlock";
|
|
7843
|
+
import { FlowGraphContext } from "babylonjs/FlowGraph/flowGraphContext";
|
|
7844
|
+
import { FlowGraphSignalConnection } from "babylonjs/FlowGraph/flowGraphSignalConnection.pure";
|
|
7845
|
+
/**
|
|
7846
|
+
* Socket definition retained for an unsupported extension operation.
|
|
7847
|
+
*/
|
|
7848
|
+
export interface IFlowGraphUnsupportedInteractivitySocket {
|
|
7849
|
+
/** Socket name. */
|
|
7850
|
+
name: string;
|
|
7851
|
+
/** FlowGraph runtime type name. */
|
|
7852
|
+
type?: string;
|
|
7853
|
+
/** Exact KHR_interactivity type signature. */
|
|
7854
|
+
signature?: string;
|
|
7855
|
+
}
|
|
7856
|
+
/**
|
|
7857
|
+
* Configuration for an unsupported KHR_interactivity extension operation.
|
|
7858
|
+
*/
|
|
7859
|
+
export interface IFlowGraphUnsupportedInteractivityBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
7860
|
+
/** Full extension operation name. */
|
|
7861
|
+
operation: string;
|
|
7862
|
+
/** Input value sockets declared by the extension. */
|
|
7863
|
+
inputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
7864
|
+
/** Output value sockets declared by the extension. */
|
|
7865
|
+
outputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
7866
|
+
/** Input flow sockets used by the source graph. */
|
|
7867
|
+
inputFlowSockets: string[];
|
|
7868
|
+
/** Output flow sockets used by the source graph. */
|
|
7869
|
+
outputFlowSockets: string[];
|
|
7870
|
+
}
|
|
7871
|
+
/**
|
|
7872
|
+
* Inspectable runtime no-op for an operation owned by an unsupported glTF extension.
|
|
7873
|
+
*/
|
|
7874
|
+
export class FlowGraphUnsupportedInteractivityBlock extends FlowGraphExecutionBlock {
|
|
7875
|
+
config: IFlowGraphUnsupportedInteractivityBlockConfiguration;
|
|
7876
|
+
constructor(config: IFlowGraphUnsupportedInteractivityBlockConfiguration);
|
|
7877
|
+
/** @internal */
|
|
7878
|
+
_execute(_context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
7879
|
+
/** @returns the serialized class name */
|
|
7880
|
+
getClassName(): string;
|
|
7881
|
+
}
|
|
7882
|
+
|
|
7883
|
+
}
|
|
7884
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock" {
|
|
7885
|
+
import { FlowGraphBlock, IFlowGraphBlockConfiguration } from "babylonjs/FlowGraph/flowGraphBlock";
|
|
7886
|
+
import { FlowGraphContext } from "babylonjs/FlowGraph/flowGraphContext";
|
|
7887
|
+
import { FlowGraphDataConnection } from "babylonjs/FlowGraph/flowGraphDataConnection.pure";
|
|
7888
|
+
/**
|
|
7889
|
+
* Resolves a runtime object to its owning glTF node reference.
|
|
7890
|
+
* @param context active FlowGraph context
|
|
7891
|
+
* @param value runtime object, usually a picked primitive
|
|
7892
|
+
* @returns the owning node reference or the null reference
|
|
7893
|
+
*/
|
|
7894
|
+
export function GetInteractivityObjectReference(context: FlowGraphContext, value: object | undefined): string;
|
|
7895
|
+
/**
|
|
7896
|
+
* Converts a runtime object into the opaque reference used by KHR_interactivity.
|
|
7897
|
+
*/
|
|
7898
|
+
export class FlowGraphObjectReferenceBlock extends FlowGraphBlock {
|
|
7899
|
+
/** Runtime object to encode. */
|
|
7900
|
+
readonly object: FlowGraphDataConnection<object | undefined>;
|
|
7901
|
+
/** Opaque KHR_interactivity reference. */
|
|
7902
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
7903
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
7904
|
+
/** @internal */
|
|
7905
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
7906
|
+
/** @returns the serialized class name */
|
|
7907
|
+
getClassName(): string;
|
|
7908
|
+
}
|
|
7599
7909
|
|
|
7600
7910
|
}
|
|
7601
7911
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider" {
|
|
@@ -7611,7 +7921,7 @@ export interface IFlowGraphGLTFDataProviderBlockConfiguration extends IFlowGraph
|
|
|
7611
7921
|
/**
|
|
7612
7922
|
* the glTF object to provide data from
|
|
7613
7923
|
*/
|
|
7614
|
-
glTF
|
|
7924
|
+
glTF?: IGLTF;
|
|
7615
7925
|
}
|
|
7616
7926
|
/**
|
|
7617
7927
|
* a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
|
|
@@ -7628,7 +7938,57 @@ export class FlowGraphGLTFDataProvider extends FlowGraphBlock {
|
|
|
7628
7938
|
* Corresponds directly to the glTF nodes array
|
|
7629
7939
|
*/
|
|
7630
7940
|
readonly nodes: FlowGraphDataConnection<TransformNode[]>;
|
|
7631
|
-
constructor(config
|
|
7941
|
+
constructor(config?: IFlowGraphGLTFDataProviderBlockConfiguration);
|
|
7942
|
+
getClassName(): string;
|
|
7943
|
+
}
|
|
7944
|
+
|
|
7945
|
+
}
|
|
7946
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock" {
|
|
7947
|
+
import { IFlowGraphBlockConfiguration } from "babylonjs/FlowGraph/flowGraphBlock";
|
|
7948
|
+
import { FlowGraphContext } from "babylonjs/FlowGraph/flowGraphContext";
|
|
7949
|
+
import { FlowGraphDataConnection } from "babylonjs/FlowGraph/flowGraphDataConnection.pure";
|
|
7950
|
+
import { FlowGraphExecutionBlock } from "babylonjs/FlowGraph/flowGraphExecutionBlock";
|
|
7951
|
+
import { Vector3 } from "babylonjs/Maths/math.vector.pure";
|
|
7952
|
+
import { FlowGraphSignalConnection } from "babylonjs/FlowGraph/flowGraphSignalConnection.pure";
|
|
7953
|
+
/**
|
|
7954
|
+
* Configuration for a KHR event reference output.
|
|
7955
|
+
*/
|
|
7956
|
+
export interface IFlowGraphEventReferenceBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
7957
|
+
/** Stable key shared by equivalent event operations. */
|
|
7958
|
+
eventKey?: string;
|
|
7959
|
+
}
|
|
7960
|
+
/**
|
|
7961
|
+
* Produces the opaque reference associated with a KHR event operation.
|
|
7962
|
+
*/
|
|
7963
|
+
export class FlowGraphEventReferenceBlock extends FlowGraphExecutionBlock {
|
|
7964
|
+
config: IFlowGraphEventReferenceBlockConfiguration;
|
|
7965
|
+
private readonly _assetInverse;
|
|
7966
|
+
private readonly _selectionPointValue;
|
|
7967
|
+
private readonly _selectionRayOriginValue;
|
|
7968
|
+
/** Output flow activated after event values are captured. */
|
|
7969
|
+
readonly out: FlowGraphSignalConnection;
|
|
7970
|
+
/** Runtime node associated with the event. */
|
|
7971
|
+
readonly node: FlowGraphDataConnection<object | undefined>;
|
|
7972
|
+
/** Controller index associated with the event. */
|
|
7973
|
+
readonly controllerIndexInput: FlowGraphDataConnection<number>;
|
|
7974
|
+
/** Selection point associated with the event. */
|
|
7975
|
+
readonly selectionPointInput: FlowGraphDataConnection<Vector3>;
|
|
7976
|
+
/** Selection ray origin associated with the event. */
|
|
7977
|
+
readonly selectionRayOriginInput: FlowGraphDataConnection<Vector3>;
|
|
7978
|
+
/** Opaque node reference. */
|
|
7979
|
+
readonly nodeReference: FlowGraphDataConnection<string>;
|
|
7980
|
+
/** Retained controller index. */
|
|
7981
|
+
readonly controllerIndex: FlowGraphDataConnection<number>;
|
|
7982
|
+
/** Retained selection point. */
|
|
7983
|
+
readonly selectionPoint: FlowGraphDataConnection<Vector3>;
|
|
7984
|
+
/** Retained selection ray origin. */
|
|
7985
|
+
readonly selectionRayOrigin: FlowGraphDataConnection<Vector3>;
|
|
7986
|
+
/** Opaque event reference. */
|
|
7987
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
7988
|
+
constructor(config: IFlowGraphEventReferenceBlockConfiguration);
|
|
7989
|
+
/** @internal */
|
|
7990
|
+
_execute(context: FlowGraphContext): void;
|
|
7991
|
+
/** @returns the serialized class name */
|
|
7632
7992
|
getClassName(): string;
|
|
7633
7993
|
}
|
|
7634
7994
|
|
|
@@ -7639,11 +7999,21 @@ import { FlowGraphBlockNames } from "babylonjs/FlowGraph/Blocks/flowGraphBlockNa
|
|
|
7639
7999
|
import { ISerializedFlowGraphBlock, ISerializedFlowGraphContext } from "babylonjs/FlowGraph/typeDefinitions";
|
|
7640
8000
|
import { InteractivityGraphToFlowGraphParser } from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser";
|
|
7641
8001
|
import { IGLTF } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
7642
|
-
|
|
8002
|
+
/**
|
|
8003
|
+
* Describes how one KHR_interactivity configuration or socket property maps to FlowGraph.
|
|
8004
|
+
*
|
|
8005
|
+
* The same contract is used for fixed sockets, wildcard sockets, configuration validation,
|
|
8006
|
+
* defaulting, and multi-block routing during strict graph lowering.
|
|
8007
|
+
*/
|
|
8008
|
+
export interface IGLTFToFlowGraphMappingObject {
|
|
7643
8009
|
/**
|
|
7644
8010
|
* The name of the property in the FlowGraph block.
|
|
7645
8011
|
*/
|
|
7646
8012
|
name: string;
|
|
8013
|
+
/**
|
|
8014
|
+
* Whether this socket mapping exists only for pre-ratification compatibility input.
|
|
8015
|
+
*/
|
|
8016
|
+
compatibilityOnly?: boolean;
|
|
7647
8017
|
/**
|
|
7648
8018
|
* The type of the property in the glTF specs.
|
|
7649
8019
|
* If not provided will be inferred.
|
|
@@ -7676,7 +8046,7 @@ interface IGLTFToFlowGraphMappingObject {
|
|
|
7676
8046
|
* This is used if we generate more than one block for a single glTF node.
|
|
7677
8047
|
* Defaults to the first block in the mapping.
|
|
7678
8048
|
*/
|
|
7679
|
-
toBlock?: FlowGraphBlockNames;
|
|
8049
|
+
toBlock?: FlowGraphBlockNames | string;
|
|
7680
8050
|
/**
|
|
7681
8051
|
* Used in configuration values. If defined, this will be the default value, if no value is provided.
|
|
7682
8052
|
*/
|
|
@@ -7690,6 +8060,75 @@ interface IGLTFToFlowGraphMappingObject {
|
|
|
7690
8060
|
* be fed by a `pointer/get` (e.g. the read-only `maxTime` animation pointer).
|
|
7691
8061
|
*/
|
|
7692
8062
|
convertConnectedTimeToFrames?: boolean;
|
|
8063
|
+
/**
|
|
8064
|
+
* KHR configuration value type used by canonical validation.
|
|
8065
|
+
*/
|
|
8066
|
+
configurationType?: "bool" | "int" | "int[]" | "string";
|
|
8067
|
+
/**
|
|
8068
|
+
* Whether this configuration entry exists only for canonical validation.
|
|
8069
|
+
*/
|
|
8070
|
+
validationOnly?: boolean;
|
|
8071
|
+
/**
|
|
8072
|
+
* Whether an operation without a complete default configuration requires this property.
|
|
8073
|
+
*/
|
|
8074
|
+
required?: boolean;
|
|
8075
|
+
/**
|
|
8076
|
+
* Graph array referenced by an integer configuration value.
|
|
8077
|
+
*/
|
|
8078
|
+
indexSource?: "types" | "variables" | "events" | "nodes" | "assetNodes";
|
|
8079
|
+
/**
|
|
8080
|
+
* Minimum number of values required for an array configuration.
|
|
8081
|
+
*/
|
|
8082
|
+
minItems?: number;
|
|
8083
|
+
/**
|
|
8084
|
+
* Whether the configured indices generate required input value sockets.
|
|
8085
|
+
*/
|
|
8086
|
+
generatesInputValueSockets?: boolean;
|
|
8087
|
+
/**
|
|
8088
|
+
* Whether integer case values generate required input value sockets.
|
|
8089
|
+
*/
|
|
8090
|
+
generatesCaseInputValueSockets?: boolean;
|
|
8091
|
+
/**
|
|
8092
|
+
* Whether this string configuration generates JSON Pointer Template sockets.
|
|
8093
|
+
*/
|
|
8094
|
+
pointerTemplate?: boolean;
|
|
8095
|
+
/**
|
|
8096
|
+
* Whether an invalid value falls back to the operation's default configuration.
|
|
8097
|
+
*/
|
|
8098
|
+
invalidUsesDefault?: boolean;
|
|
8099
|
+
/**
|
|
8100
|
+
* Allowed KHR type signatures for a type-index configuration.
|
|
8101
|
+
*/
|
|
8102
|
+
allowedSignatures?: readonly ("bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom")[];
|
|
8103
|
+
/**
|
|
8104
|
+
* Input socket whose effective type determines this output socket type.
|
|
8105
|
+
*/
|
|
8106
|
+
typeSourceInput?: string;
|
|
8107
|
+
/** Inclusive minimum for an integer configuration value. */
|
|
8108
|
+
minimum?: number;
|
|
8109
|
+
/** Inclusive maximum for an integer configuration value. */
|
|
8110
|
+
maximum?: number;
|
|
8111
|
+
/**
|
|
8112
|
+
* Whether this configuration value generates numbered input flow sockets.
|
|
8113
|
+
*/
|
|
8114
|
+
generatesInputFlowSockets?: boolean;
|
|
8115
|
+
/**
|
|
8116
|
+
* Whether this configuration array generates output flow sockets.
|
|
8117
|
+
*/
|
|
8118
|
+
generatesOutputFlowSockets?: boolean;
|
|
8119
|
+
/**
|
|
8120
|
+
* Properties in the same group fall back to their defaults together when any member is
|
|
8121
|
+
* missing or invalid.
|
|
8122
|
+
*/
|
|
8123
|
+
configurationGroup?: string;
|
|
8124
|
+
/**
|
|
8125
|
+
* Whether duplicate array values are removed from the effective configuration.
|
|
8126
|
+
*/
|
|
8127
|
+
uniqueValues?: boolean;
|
|
8128
|
+
/**
|
|
8129
|
+
* Whether a string configuration value is a `debug/log` message template.
|
|
8130
|
+
*/
|
|
8131
|
+
debugLogTemplate?: boolean;
|
|
7693
8132
|
}
|
|
7694
8133
|
/**
|
|
7695
8134
|
* Description of how a KHR_interactivity declaration (op such as
|
|
@@ -7704,6 +8143,13 @@ export interface IGLTFToFlowGraphMapping {
|
|
|
7704
8143
|
* When adding blocks defined in this module use the KHR_interactivity prefix.
|
|
7705
8144
|
*/
|
|
7706
8145
|
blocks: (FlowGraphBlockNames | string)[];
|
|
8146
|
+
/**
|
|
8147
|
+
* Exact value socket contract for an operation supplied by another extension.
|
|
8148
|
+
*/
|
|
8149
|
+
declarationSchema?: {
|
|
8150
|
+
inputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
8151
|
+
outputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
8152
|
+
};
|
|
7707
8153
|
/**
|
|
7708
8154
|
* The inputs of the glTF node mapped to the FlowGraph block.
|
|
7709
8155
|
*/
|
|
@@ -7812,6 +8258,12 @@ export interface IGLTFToFlowGraphMapping {
|
|
|
7812
8258
|
}
|
|
7813
8259
|
export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
|
|
7814
8260
|
export function getMappingForDeclaration(declaration: IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
|
|
8261
|
+
/**
|
|
8262
|
+
* Creates the typed no-op mapping required for an unsupported extension declaration.
|
|
8263
|
+
* @param declaration unsupported extension declaration
|
|
8264
|
+
* @returns a mapping that preserves the declared value sockets
|
|
8265
|
+
*/
|
|
8266
|
+
export function getNoOpMappingForDeclaration(declaration: IKHRInteractivity_Declaration): IGLTFToFlowGraphMapping;
|
|
7815
8267
|
/**
|
|
7816
8268
|
* This function will add new mapping to glTF interactivity.
|
|
7817
8269
|
* Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
|
|
@@ -7820,8 +8272,23 @@ export function getMappingForDeclaration(declaration: IKHRInteractivity_Declarat
|
|
|
7820
8272
|
* @param mapping The mapping object. See documentation or examples below.
|
|
7821
8273
|
*/
|
|
7822
8274
|
export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
|
|
8275
|
+
/**
|
|
8276
|
+
* Result of parsing a ratified `debug/log` message template.
|
|
8277
|
+
*/
|
|
8278
|
+
export interface IDebugLogTemplateParseResult {
|
|
8279
|
+
/** Whether all literal braces are doubled and every parameter is well formed. */
|
|
8280
|
+
valid: boolean;
|
|
8281
|
+
/** Unique parameter socket ids in first-occurrence order. */
|
|
8282
|
+
sockets: string[];
|
|
8283
|
+
}
|
|
8284
|
+
/**
|
|
8285
|
+
* Parses a ratified `debug/log` message template.
|
|
8286
|
+
* Literal braces must be doubled; non-empty text inside a single brace pair defines a socket id.
|
|
8287
|
+
* @param message message template to parse
|
|
8288
|
+
* @returns template validity and its exact dynamic socket ids
|
|
8289
|
+
*/
|
|
8290
|
+
export function ParseDebugLogTemplate(message: string): IDebugLogTemplateParseResult;
|
|
7823
8291
|
export function getAllSupportedNativeNodeTypes(): string[];
|
|
7824
|
-
export {};
|
|
7825
8292
|
/**
|
|
7826
8293
|
*
|
|
7827
8294
|
* These are the nodes from the specs:
|
|
@@ -9085,7 +9552,7 @@ export * from "babylonjs-loaders/USD/usdFileLoader.pure";
|
|
|
9085
9552
|
}
|
|
9086
9553
|
declare module "babylonjs-loaders/USD/usdCommandProtocol" {
|
|
9087
9554
|
export const COMMAND_MAGIC = 1111774037;
|
|
9088
|
-
export const PROTOCOL_VERSION =
|
|
9555
|
+
export const PROTOCOL_VERSION = 5;
|
|
9089
9556
|
export const MISSING_OFFSET = 4294967295;
|
|
9090
9557
|
export enum Command {
|
|
9091
9558
|
Scene = 1,
|
|
@@ -9097,7 +9564,9 @@ export enum Command {
|
|
|
9097
9564
|
Mesh = 7,
|
|
9098
9565
|
Instance = 8,
|
|
9099
9566
|
Animation = 9,
|
|
9100
|
-
AnalyticPrimitive = 10
|
|
9567
|
+
AnalyticPrimitive = 10,
|
|
9568
|
+
ThinInstances = 11,
|
|
9569
|
+
MorphTarget = 12
|
|
9101
9570
|
}
|
|
9102
9571
|
export enum AnalyticPrimitiveType {
|
|
9103
9572
|
Cube = 0,
|
|
@@ -9112,19 +9581,33 @@ export enum PrimitiveAxis {
|
|
|
9112
9581
|
}
|
|
9113
9582
|
export enum AnimationTarget {
|
|
9114
9583
|
Node = 0,
|
|
9115
|
-
Bone = 1
|
|
9584
|
+
Bone = 1,
|
|
9585
|
+
MorphTarget = 2
|
|
9116
9586
|
}
|
|
9117
9587
|
export enum AnimationProperty {
|
|
9118
9588
|
Position = 0,
|
|
9119
9589
|
RotationQuaternion = 1,
|
|
9120
9590
|
Scaling = 2,
|
|
9121
|
-
Matrix = 3
|
|
9591
|
+
Matrix = 3,
|
|
9592
|
+
Influence = 4
|
|
9122
9593
|
}
|
|
9123
9594
|
export enum MaterialFlags {
|
|
9124
9595
|
DoubleSided = 1,
|
|
9125
9596
|
Unlit = 2,
|
|
9126
9597
|
AlphaBlend = 4
|
|
9127
9598
|
}
|
|
9599
|
+
export enum TextureOutputChannel {
|
|
9600
|
+
R = 0,
|
|
9601
|
+
G = 1,
|
|
9602
|
+
B = 2,
|
|
9603
|
+
A = 3,
|
|
9604
|
+
RGB = 4
|
|
9605
|
+
}
|
|
9606
|
+
export enum USDTextureColorSpace {
|
|
9607
|
+
Auto = 0,
|
|
9608
|
+
Raw = 1,
|
|
9609
|
+
SRGB = 2
|
|
9610
|
+
}
|
|
9128
9611
|
export enum MeshFlags {
|
|
9129
9612
|
DoubleSided = 1,
|
|
9130
9613
|
LeftHanded = 2
|
|
@@ -10266,17 +10749,20 @@ export interface IGaussianSplattingStreamOptions {
|
|
|
10266
10749
|
/** Number of times a failed file download is retried before giving up. PlayCanvas default `2`. */
|
|
10267
10750
|
maxDownloadRetries?: number;
|
|
10268
10751
|
/**
|
|
10269
|
-
* GPU memory
|
|
10270
|
-
*
|
|
10271
|
-
*
|
|
10272
|
-
*
|
|
10273
|
-
*
|
|
10752
|
+
* Initial GPU/CPU memory estimate (in megabytes) for resident splats. It is converted to a splat count
|
|
10753
|
+
* using the per-splat cost (core data plus any baked SH and rotation/scale textures), combined with
|
|
10754
|
+
* {@link maxResidentSplats} by taking the smaller limit, then raised when necessary to fit the complete
|
|
10755
|
+
* coarse layer. The work buffer has a fixed lifetime capacity; construct a new stream to use another limit.
|
|
10756
|
+
* Finite non-positive values leave this limit unset; non-finite values are rejected.
|
|
10274
10757
|
*/
|
|
10275
10758
|
memoryBudgetMb?: number;
|
|
10276
10759
|
/**
|
|
10277
|
-
*
|
|
10278
|
-
*
|
|
10279
|
-
*
|
|
10760
|
+
* Initial maximum number of splats kept resident in the fixed-size work buffer. It is raised when necessary
|
|
10761
|
+
* to fit the complete coarse layer. When unset and the complete source size is known, streams retain the complete
|
|
10762
|
+
* source. Streams that defer finer metadata use a bounded device-tiered default with coarse-derived refinement
|
|
10763
|
+
* headroom.
|
|
10764
|
+
* Finite non-positive values leave this limit unset; non-finite or unsafe positive counts are rejected.
|
|
10765
|
+
* Positive fractional counts are floored to at least one splat before applying the coarse minimum.
|
|
10280
10766
|
*/
|
|
10281
10767
|
maxResidentSplats?: number;
|
|
10282
10768
|
/**
|
|
@@ -10306,10 +10792,10 @@ export interface IGaussianSplattingStreamOptions {
|
|
|
10306
10792
|
/**
|
|
10307
10793
|
* When true, higher-order spherical-harmonics carried by the SOG files (`shN`) are GPU-decoded into baked
|
|
10308
10794
|
* packed-u32 SH textures so the streamed splats render with view-dependent lighting (matching the non-stream
|
|
10309
|
-
* `.spz`/`.sog` path) instead of flat DC-only color.
|
|
10310
|
-
*
|
|
10311
|
-
*
|
|
10312
|
-
*
|
|
10795
|
+
* `.spz`/`.sog` path) instead of flat DC-only color. Streams with complete initial metadata use the maximum
|
|
10796
|
+
* source SH degree. Streams that defer finer metadata reserve the supported degree-4 layout before it is known,
|
|
10797
|
+
* even if the files ultimately carry no `shN`; lower-degree files neutral-fill the unused bands.
|
|
10798
|
+
* Defaults to `true`; set to `false` to force flat DC-only color and avoid the SH decode cost/texture memory.
|
|
10313
10799
|
*/
|
|
10314
10800
|
decodeSh?: boolean;
|
|
10315
10801
|
/**
|
|
@@ -10354,6 +10840,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10354
10840
|
private _hostBudgetAllocation;
|
|
10355
10841
|
private _frustumCulling;
|
|
10356
10842
|
private readonly _frustumPlanes;
|
|
10843
|
+
private readonly _cullCameraViewProj;
|
|
10357
10844
|
private readonly _cullViewProj;
|
|
10358
10845
|
private readonly _frustumScratch;
|
|
10359
10846
|
private _workBuffer;
|
|
@@ -10367,6 +10854,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10367
10854
|
private _residency;
|
|
10368
10855
|
private readonly _fileCounts;
|
|
10369
10856
|
private readonly _fileMeta;
|
|
10857
|
+
private readonly _baseFileIds;
|
|
10370
10858
|
private readonly _decodedFiles;
|
|
10371
10859
|
private readonly _loadingFiles;
|
|
10372
10860
|
private readonly _decodeQueue;
|
|
@@ -10374,6 +10862,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10374
10862
|
private readonly _cancelledDecodes;
|
|
10375
10863
|
private _evictionEnabled;
|
|
10376
10864
|
private _residentBudget;
|
|
10865
|
+
private _minimumResidentSplats;
|
|
10377
10866
|
private _maxResidentSplats;
|
|
10378
10867
|
private _memoryBudgetMb;
|
|
10379
10868
|
private _evictionCooldownFrames;
|
|
@@ -10385,6 +10874,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10385
10874
|
private _environmentFiles;
|
|
10386
10875
|
private _lodObserver;
|
|
10387
10876
|
private _baseLayerReady;
|
|
10877
|
+
private _metadataReady;
|
|
10388
10878
|
private _framesSinceLodUpdate;
|
|
10389
10879
|
private readonly _lastLodCamPositions;
|
|
10390
10880
|
private _lastLodSignature;
|
|
@@ -10507,10 +10997,19 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10507
10997
|
/**
|
|
10508
10998
|
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
10509
10999
|
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
10510
|
-
* taking the smaller limit
|
|
11000
|
+
* taking the smaller positive limit and raising it to {@link minimumResidentSplats}. With neither limit set,
|
|
11001
|
+
* the complete source size is retained when known; otherwise a bounded device-tiered default is used.
|
|
11002
|
+
* The fixed capacity is capped at the device texture limit. `0` means initial capacity has not been resolved.
|
|
10511
11003
|
* @experimental
|
|
10512
11004
|
*/
|
|
10513
11005
|
get residentSplatBudget(): number;
|
|
11006
|
+
/**
|
|
11007
|
+
* Minimum fixed work-buffer capacity required for the complete coarse representation: one invisible padding
|
|
11008
|
+
* splat, the included environment, and every unique whole coarse source file. It is `0` until the required
|
|
11009
|
+
* coarse metadata has resolved. Initial residency options below this value are raised to it.
|
|
11010
|
+
* @experimental
|
|
11011
|
+
*/
|
|
11012
|
+
get minimumResidentSplats(): number;
|
|
10514
11013
|
/**
|
|
10515
11014
|
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
10516
11015
|
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
@@ -10585,14 +11084,14 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10585
11084
|
set debugLodSource(value: GaussianSplattingStreamDebugLodSource);
|
|
10586
11085
|
dispose(doNotRecurse?: boolean): void;
|
|
10587
11086
|
/**
|
|
10588
|
-
* Disposes this stream
|
|
10589
|
-
*
|
|
11087
|
+
* Disposes this stream and, when hosted, compacts the host once to reclaim its tombstoned region's reserved
|
|
11088
|
+
* rows. Used on a definitive load failure / empty result — a discrete, one-off reclaim, versus a bare
|
|
10590
11089
|
* {@link dispose} that only tombstones so tearing down several parts doesn't rebuild the atlas repeatedly.
|
|
10591
11090
|
*/
|
|
10592
11091
|
private _disposeAndReclaim;
|
|
10593
11092
|
/**
|
|
10594
11093
|
* The world matrix that actually places this stream's splats, used to map the camera into the space the
|
|
10595
|
-
* node bounds live in (for LOD distance) and to build
|
|
11094
|
+
* node bounds live in (for LOD distance) and to build camera-local frusta (for frustum culling). Standalone:
|
|
10596
11095
|
* this controller mesh carries the transform. Hosted: this controller is a hidden, unplaced node — the splats
|
|
10597
11096
|
* are placed by the reserved part's proxy (SOG up-axis basis composed with the host's placement), so LOD and
|
|
10598
11097
|
* culling MUST use the proxy's world matrix or they compute distances/frustum tests in the wrong space
|
|
@@ -10660,9 +11159,9 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10660
11159
|
*/
|
|
10661
11160
|
private _collectLodEntries;
|
|
10662
11161
|
/**
|
|
10663
|
-
* Streams the scene
|
|
10664
|
-
*
|
|
10665
|
-
*
|
|
11162
|
+
* Streams the scene. Large streams fetch only required coarse metadata before allocating and decoding the
|
|
11163
|
+
* complete coarse layer; finer metadata starts afterwards so it cannot occupy the download queue ahead of
|
|
11164
|
+
* visible geometry. Small streams and streams containing only coarse files retain an exact all-file capacity upper bound.
|
|
10666
11165
|
*/
|
|
10667
11166
|
private _streamAllAsync;
|
|
10668
11167
|
/**
|
|
@@ -10675,26 +11174,47 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10675
11174
|
*/
|
|
10676
11175
|
private _waitForCanBackupAsync;
|
|
10677
11176
|
/**
|
|
10678
|
-
* Resolves the
|
|
10679
|
-
*
|
|
10680
|
-
*
|
|
10681
|
-
*
|
|
11177
|
+
* Resolves the fixed initial work-buffer capacity. Explicit count/MB limits are combined by taking the smaller
|
|
11178
|
+
* and then raised to the complete coarse minimum. Without an explicit limit, a known complete source retains
|
|
11179
|
+
* legacy full residency. When finer metadata is deferred and the complete size is unknown, the device-tiered
|
|
11180
|
+
* memory estimate is given at least one largest-coarse-file of headroom so one replacement file can refine
|
|
11181
|
+
* while all coarse fallback files remain pinned.
|
|
11182
|
+
* @param fullCapacity exact complete source capacity, or null when unavailable
|
|
11183
|
+
* @param largestBaseFileCount largest whole coarse source file, used as modest replacement headroom
|
|
11184
|
+
* @returns the fixed initial work-buffer capacity
|
|
10682
11185
|
*/
|
|
10683
11186
|
private _resolveResidentBudget;
|
|
11187
|
+
/**
|
|
11188
|
+
* Returns the estimated combined GPU/CPU bytes occupied by one resident splat.
|
|
11189
|
+
* @returns estimated bytes per resident splat
|
|
11190
|
+
*/
|
|
11191
|
+
private _bytesPerResidentSplat;
|
|
10684
11192
|
/**
|
|
10685
11193
|
* Collects the unique set of source file indices referenced by any LOD of any leaf, sorted ascending.
|
|
10686
11194
|
* @returns sorted unique file indices
|
|
10687
11195
|
*/
|
|
10688
11196
|
private _collectAllFileIds;
|
|
11197
|
+
/**
|
|
11198
|
+
* Collects unique whole source files required by the coarsest entry of every valid leaf.
|
|
11199
|
+
* @returns sorted unique coarse file indices
|
|
11200
|
+
*/
|
|
11201
|
+
private _collectBaseFileIds;
|
|
11202
|
+
/**
|
|
11203
|
+
* Resolves the immutable minimum initial capacity from padding, environment, and unique whole coarse files.
|
|
11204
|
+
* @param baseFileIds unique coarse source file indices
|
|
11205
|
+
* @param environmentCount included environment splat count
|
|
11206
|
+
*/
|
|
11207
|
+
private _resolveMinimumResidentSplats;
|
|
10689
11208
|
/**
|
|
10690
11209
|
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
10691
11210
|
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
10692
11211
|
*/
|
|
10693
11212
|
private _resolveLod0SplatCount;
|
|
10694
11213
|
/**
|
|
10695
|
-
* Fetches the environment bundle and
|
|
10696
|
-
* each file's parsed metadata for the later on-demand decode.
|
|
11214
|
+
* Fetches the environment bundle and the supplied referenced files' metadata to learn splat counts, caching
|
|
11215
|
+
* each file's parsed metadata for the later on-demand decode. File metadata fetches run in parallel.
|
|
10697
11216
|
* @param fileIds file indices to fetch metadata for
|
|
11217
|
+
* @param includeEnvironment whether to fetch the optional environment bundle in this phase
|
|
10698
11218
|
* @returns the environment splat count (0 when there is no environment)
|
|
10699
11219
|
*/
|
|
10700
11220
|
private _gatherCountsAsync;
|
|
@@ -10762,6 +11282,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10762
11282
|
* Concurrent or repeat requests for the same file are ignored. If the file is cancelled mid-flight
|
|
10763
11283
|
* (because every node that wanted it retargeted), the decode bails cooperatively at the next checkpoint.
|
|
10764
11284
|
* @param fileId file index to decode
|
|
11285
|
+
* @returns whether the file was decoded and published successfully
|
|
10765
11286
|
*/
|
|
10766
11287
|
private _decodeFileAsync;
|
|
10767
11288
|
/**
|
|
@@ -10926,6 +11447,22 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10926
11447
|
* @returns whether any node's in-frustum state changed
|
|
10927
11448
|
*/
|
|
10928
11449
|
private _updateNodeFrustum;
|
|
11450
|
+
/**
|
|
11451
|
+
* Normalizes an initial residency option, preserving finite non-positive values as an unset limit.
|
|
11452
|
+
* @param value option value
|
|
11453
|
+
* @param name option name used in errors
|
|
11454
|
+
* @param integer whether the normalized value must be an integer splat count
|
|
11455
|
+
* @returns normalized value
|
|
11456
|
+
*/
|
|
11457
|
+
private static _NormalizeResidentLimit;
|
|
11458
|
+
/**
|
|
11459
|
+
* Adds trusted non-negative integer counts without allowing unsafe capacity arithmetic.
|
|
11460
|
+
* @param left first count
|
|
11461
|
+
* @param right second count
|
|
11462
|
+
* @param label capacity name used in errors
|
|
11463
|
+
* @returns the safe integer sum
|
|
11464
|
+
*/
|
|
11465
|
+
private static _SafeAddCounts;
|
|
10929
11466
|
/**
|
|
10930
11467
|
* Reads the splat count from SOG metadata, coerced to a finite non-negative integer (metadata is untrusted, so
|
|
10931
11468
|
* `count` / `shape[0]` may be a string or malformed — a non-numeric value must not leak into count arithmetic).
|
|
@@ -11876,12 +12413,16 @@ declare module "babylonjs-loaders/FBX/pure" {
|
|
|
11876
12413
|
/** Pure barrel — re-exports only side-effect-free modules */
|
|
11877
12414
|
export { FBXFileLoader } from "babylonjs-loaders/FBX/fbxFileLoader.pure";
|
|
11878
12415
|
export { FBXFileLoaderMetadata } from "babylonjs-loaders/FBX/fbxFileLoader.metadata";
|
|
12416
|
+
export { FBXConstraintBehavior, FBXConstraintSolver } from "babylonjs-loaders/FBX/fbxConstraintBehavior";
|
|
11879
12417
|
|
|
11880
12418
|
}
|
|
11881
12419
|
declare module "babylonjs-loaders/FBX/index" {
|
|
11882
12420
|
export { FBXFileLoader } from "babylonjs-loaders/FBX/fbxFileLoader";
|
|
11883
|
-
export type { FBXFileLoaderOptions, FBXNormalMapCoordinateSystem } from "babylonjs-loaders/FBX/fbxFileLoader";
|
|
12421
|
+
export type { FBXFileLoaderOptions, FBXNormalMapCoordinateSystem, FBXLoaderWarning } from "babylonjs-loaders/FBX/fbxFileLoader";
|
|
11884
12422
|
export { FBXFileLoaderMetadata } from "babylonjs-loaders/FBX/fbxFileLoader.metadata";
|
|
12423
|
+
export { FBXConstraintBehavior, FBXConstraintSolver } from "babylonjs-loaders/FBX/fbxConstraintBehavior";
|
|
12424
|
+
export type { FBXConstraintBehaviorOptions, FBXConstraintBehaviorTarget } from "babylonjs-loaders/FBX/fbxConstraintBehavior";
|
|
12425
|
+
export type { FBXConstraintData, FBXConstraintTarget, FBXConstraintType } from "babylonjs-loaders/FBX/interpreter/constraints";
|
|
11885
12426
|
|
|
11886
12427
|
}
|
|
11887
12428
|
declare module "babylonjs-loaders/FBX/fbxFileLoader.types" {
|
|
@@ -11910,12 +12451,83 @@ export type FBXNormalMapCoordinateSystem = "y-up" | "y-down";
|
|
|
11910
12451
|
* Defines options for the FBX loader.
|
|
11911
12452
|
*/
|
|
11912
12453
|
export interface FBXFileLoaderOptions {
|
|
12454
|
+
/**
|
|
12455
|
+
* Bundle of defaults for the options that change what the loaded scene looks like.
|
|
12456
|
+
* - "compatible" (default): the behaviour of the loader as first shipped: StandardMaterial for every material,
|
|
12457
|
+
* one Babylon geometry per model, curve geometry skipped, constraints recorded as metadata only, clips rebased
|
|
12458
|
+
* to start at frame 0, cameras and lights placed in world space.
|
|
12459
|
+
* - "full": everything the loader can do: PBRMaterial for physically based shaders, geometry shared between
|
|
12460
|
+
* instances, curves as lines meshes, constraints solved at runtime, authored clip times, cameras and lights
|
|
12461
|
+
* parented to their nodes so they animate.
|
|
12462
|
+
* An option set explicitly always wins over the preset.
|
|
12463
|
+
*/
|
|
12464
|
+
preset?: "compatible" | "full";
|
|
11913
12465
|
/**
|
|
11914
12466
|
* Source convention for tangent-space normal maps connected through FBX normal-map slots.
|
|
11915
12467
|
* FBX does not standardize this convention, so the loader defaults to the glTF/USD-style Y-up convention.
|
|
11916
12468
|
* Set to "y-down" for assets authored with inverted green/Y normal maps.
|
|
11917
12469
|
*/
|
|
11918
12470
|
normalMapCoordinateSystem?: FBXNormalMapCoordinateSystem;
|
|
12471
|
+
/**
|
|
12472
|
+
* Which Babylon material to build.
|
|
12473
|
+
* - "standard" (default, "full" preset: "auto"): always StandardMaterial (PBR parameters are approximated).
|
|
12474
|
+
* - "auto": PBRMaterial for physically based FBX materials (Standard Surface, Arnold, 3ds Max Physical,
|
|
12475
|
+
* 3ds Max PBR, glTF, OpenPBR, Stingray PBS) and StandardMaterial for classic Lambert/Phong materials.
|
|
12476
|
+
* - "pbr": always PBRMaterial (Lambert/Phong parameters are converted).
|
|
12477
|
+
*/
|
|
12478
|
+
materials?: "auto" | "standard" | "pbr";
|
|
12479
|
+
/**
|
|
12480
|
+
* Unit conversion applied at the root of the loaded hierarchy.
|
|
12481
|
+
* - "preserve" (default): keep the file's units (1 Babylon unit = 1 FBX unit).
|
|
12482
|
+
* - "meters": scale so that 1 Babylon unit is 1 meter, using the file's UnitScaleFactor.
|
|
12483
|
+
* - a number: centimeters per Babylon unit (100 = meters, 1 = centimeters, 2.54 = inches).
|
|
12484
|
+
*/
|
|
12485
|
+
unitScale?: "preserve" | "meters" | number;
|
|
12486
|
+
/**
|
|
12487
|
+
* Share vertex data between models that reference the same FBX geometry (default false, "full" preset: true).
|
|
12488
|
+
* Skinned meshes are never shared.
|
|
12489
|
+
*/
|
|
12490
|
+
shareGeometry?: boolean;
|
|
12491
|
+
/**
|
|
12492
|
+
* Called for every recoverable issue found while loading (unsupported features, malformed data that was
|
|
12493
|
+
* skipped, approximations). The same list is stored on the root node's metadata as `fbxDiagnostics`.
|
|
12494
|
+
*/
|
|
12495
|
+
onWarning?: (warning: FBXLoaderWarning) => void;
|
|
12496
|
+
/**
|
|
12497
|
+
* Segments per knot span when tessellating NURBS surfaces. Zero or undefined uses the subdivision stored in
|
|
12498
|
+
* the file (usually 4), capped at 16.
|
|
12499
|
+
*/
|
|
12500
|
+
nurbsSubdivision?: number;
|
|
12501
|
+
/** How curve geometry (Line, NurbsCurve) is imported: skipped (default) or as lines meshes ("full" preset). */
|
|
12502
|
+
curves?: "lines" | "skip";
|
|
12503
|
+
/**
|
|
12504
|
+
* Constraints (aim, parent, position, rotation, scale): "metadata" (default) only records them on the nodes,
|
|
12505
|
+
* "apply" ("full" preset) attaches an `FBXConstraintBehavior` to each constrained node so it is solved before
|
|
12506
|
+
* every render. IK chains are always metadata only.
|
|
12507
|
+
*/
|
|
12508
|
+
constraints?: "apply" | "metadata";
|
|
12509
|
+
/**
|
|
12510
|
+
* Shift every clip so its first keyframe sits at frame 0 (default true). With false ("full" preset) keys keep
|
|
12511
|
+
* the times authored in the file, so clips of one file stay aligned with each other and with their declared
|
|
12512
|
+
* ranges.
|
|
12513
|
+
*/
|
|
12514
|
+
rebaseAnimations?: boolean;
|
|
12515
|
+
/**
|
|
12516
|
+
* Parent cameras and lights to their FBX node so they follow its animation (default false, "full" preset:
|
|
12517
|
+
* true). Otherwise they are created at the node's world position and orientation, unparented.
|
|
12518
|
+
*/
|
|
12519
|
+
attachCamerasAndLights?: boolean;
|
|
12520
|
+
}
|
|
12521
|
+
/** A recoverable issue reported while loading an FBX file. */
|
|
12522
|
+
export interface FBXLoaderWarning {
|
|
12523
|
+
/** Which part of the loader reported the issue */
|
|
12524
|
+
source: "scene" | "model" | "geometry" | "skin" | "rig" | "animation" | "blendShape" | "camera" | "light";
|
|
12525
|
+
/** Human readable description */
|
|
12526
|
+
message: string;
|
|
12527
|
+
/** Name of the affected object, when known */
|
|
12528
|
+
objectName?: string;
|
|
12529
|
+
/** Structured details from the interpreter, when any */
|
|
12530
|
+
details?: unknown;
|
|
11919
12531
|
}
|
|
11920
12532
|
/**
|
|
11921
12533
|
* FBX file loader plugin for Babylon.js.
|
|
@@ -11938,6 +12550,22 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
11938
12550
|
private readonly _bindRestBones;
|
|
11939
12551
|
private readonly _sourceBonesBySkeleton;
|
|
11940
12552
|
private readonly _scaleCompensationHelpersBySkeleton;
|
|
12553
|
+
/** Frame rate of the file being loaded (GlobalSettings TimeMode); animation is baked at this rate. */
|
|
12554
|
+
private _frameRate;
|
|
12555
|
+
/** Layers of the animation stack currently being converted; used by the transform samplers. */
|
|
12556
|
+
private _activeLayers;
|
|
12557
|
+
/** Parent model per model id, for inherit-mode aware sampling. */
|
|
12558
|
+
private _parentModelById;
|
|
12559
|
+
/** Curve nodes per model id for the stack currently being converted. */
|
|
12560
|
+
private _curveNodesByModelId;
|
|
12561
|
+
/** Helper nodes inserted above models whose InheritType is not RSrs. */
|
|
12562
|
+
private _inheritScaleHelpers;
|
|
12563
|
+
/** First mesh built per (geometry, geometric transform), for geometry sharing between instances. */
|
|
12564
|
+
private _meshByGeometryKey;
|
|
12565
|
+
/** Instance mesh -> source mesh whose geometry it shares. */
|
|
12566
|
+
private _instanceSource;
|
|
12567
|
+
/** Property curve nodes that were mapped onto Babylon animations; their "not evaluated" diagnostics are dropped. */
|
|
12568
|
+
private _evaluatedCurveNodeIds;
|
|
11941
12569
|
/**
|
|
11942
12570
|
* Creates a new FBX loader.
|
|
11943
12571
|
* @param options - Options controlling FBX loading behavior
|
|
@@ -11980,6 +12608,11 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
11980
12608
|
* @returns A promise containing the loaded asset container
|
|
11981
12609
|
*/
|
|
11982
12610
|
loadAssetContainerAsync(scene: Scene, data: unknown, rootUrl: string, _onProgress?: (event: ISceneLoaderProgressEvent) => void, _fileName?: string): Promise<AssetContainer>;
|
|
12611
|
+
/**
|
|
12612
|
+
* Parses and interprets the file. Parsing is synchronous, so no progress events are emitted: the scene loader's
|
|
12613
|
+
* progress callback reports download bytes and must not be fed synthetic counts.
|
|
12614
|
+
*/
|
|
12615
|
+
private _parseAndInterpret;
|
|
11983
12616
|
private _parse;
|
|
11984
12617
|
private _parseFromArrayBuffer;
|
|
11985
12618
|
private _buildScene;
|
|
@@ -11991,6 +12624,15 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
11991
12624
|
private _linkSkeletonsToTransformNodes;
|
|
11992
12625
|
private static _modelSubtreeMatchesNameFilter;
|
|
11993
12626
|
private static _applyModelMetadata;
|
|
12627
|
+
/**
|
|
12628
|
+
* Wires a LodGroup's children as Babylon LOD levels: the first child holds the highest detail; every further
|
|
12629
|
+
* child replaces it beyond the group's threshold distance (or screen coverage when thresholds are percentages).
|
|
12630
|
+
* Each child's display mode is honoured first: level 1 (show) stays visible outside the LOD chain, level 2
|
|
12631
|
+
* (hide) is disabled, and only level 0 (use LOD) children take part in the distance switching.
|
|
12632
|
+
*/
|
|
12633
|
+
private static _applyLodGroup;
|
|
12634
|
+
/** Builds a lines mesh from Line or tessellated NurbsCurve geometry, applying the model's geometric transform. */
|
|
12635
|
+
private _createLinesMesh;
|
|
11994
12636
|
private _createMesh;
|
|
11995
12637
|
/**
|
|
11996
12638
|
* Apply multi-material to a mesh by creating sub-meshes grouped by material index.
|
|
@@ -12014,6 +12656,11 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
12014
12656
|
*/
|
|
12015
12657
|
private _buildSkinningData;
|
|
12016
12658
|
private _createMaterial;
|
|
12659
|
+
private _createPbrMaterial;
|
|
12660
|
+
/** Alpha of a classic Lambert/Phong material: Opacity when present, otherwise 1 - TransparentColor * TransparencyFactor. */
|
|
12661
|
+
private static _alphaFromClassicTransparency;
|
|
12662
|
+
private static _applyTextureSettings;
|
|
12663
|
+
private _createStandardMaterial;
|
|
12017
12664
|
private _configureNormalTexture;
|
|
12018
12665
|
private _getNormalMapTangentHandednessScale;
|
|
12019
12666
|
private static _isSupportedMaterialTextureSlot;
|
|
@@ -12037,11 +12684,27 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
12037
12684
|
private _createCamera;
|
|
12038
12685
|
private _createLight;
|
|
12039
12686
|
private _createSkeleton;
|
|
12687
|
+
private _rigBoneModelIds;
|
|
12688
|
+
private _isRigBone;
|
|
12040
12689
|
private _getSourceBone;
|
|
12041
12690
|
private _getScaleCompensationHelper;
|
|
12042
12691
|
private static _computeFBXAbsoluteMatrices;
|
|
12692
|
+
/**
|
|
12693
|
+
* Effective ("inherit") scale of every bone, following the FBX SDK: the local scale for RSrs bones, and for
|
|
12694
|
+
* RrSs / Rrs bones the local scale multiplied by the scale of the bone's inherit-scale node (the parent for RrSs,
|
|
12695
|
+
* the parent's inherit-scale node for Rrs). Bones are ordered parents first.
|
|
12696
|
+
*/
|
|
12697
|
+
private static _computeBoneInheritScales;
|
|
12698
|
+
private static _getBoneInheritScaleNode;
|
|
12699
|
+
/** Scale a bone inherits into its own scale (RrSs chains), or unit scale. */
|
|
12700
|
+
private static _getBoneInheritedScale;
|
|
12043
12701
|
private static _computeFBXRuntimeLocalMatrix;
|
|
12044
12702
|
private static _applyParentScaleCompensation;
|
|
12703
|
+
/**
|
|
12704
|
+
* Splits a bone's FBX local matrix into a helper (which cancels the parent scale and carries the translation,
|
|
12705
|
+
* so the translation still follows the parent scale as the SDK does) and the bone's own rotation/scale. For RrSs
|
|
12706
|
+
* bones the inherited scale is folded into the bone scale.
|
|
12707
|
+
*/
|
|
12045
12708
|
private static _splitParentScaleCompensatedLocalMatrix;
|
|
12046
12709
|
private static _safeInverseScale;
|
|
12047
12710
|
private static _getInverseScaleVector;
|
|
@@ -12058,13 +12721,8 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
12058
12721
|
* In row-vector convention: v' = v * M
|
|
12059
12722
|
*/
|
|
12060
12723
|
private static _computeFBXLocalMatrix;
|
|
12061
|
-
|
|
12062
|
-
* Apply the FBX transform chain to a Babylon TransformNode or Mesh.
|
|
12063
|
-
* Decomposes the full local matrix into position/rotation/scale.
|
|
12064
|
-
*/
|
|
12065
|
-
private static _applyFBXTransform;
|
|
12724
|
+
private _applyRestTRS;
|
|
12066
12725
|
private static _computeFBXModelLocalMatrix;
|
|
12067
|
-
private static _getBoneReferenceWorldMatrix;
|
|
12068
12726
|
private static _applyMatrixToTransform;
|
|
12069
12727
|
private _createAnimationGroup;
|
|
12070
12728
|
private _buildInheritedRigBoneAnimations;
|
|
@@ -12074,9 +12732,61 @@ export class FBXFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
12074
12732
|
* Computes the full FBX transform matrix at each keyframe and decomposes into TRS.
|
|
12075
12733
|
*/
|
|
12076
12734
|
private _buildNodeAnimations;
|
|
12735
|
+
/**
|
|
12736
|
+
* Baked keys are interpolated linearly by Babylon. Between two frames an FBX cubic segment can deviate from that
|
|
12737
|
+
* line, so sample times are refined (midpoints inserted, up to two levels) wherever the interpolated transform
|
|
12738
|
+
* differs noticeably from the curve. Flat and linear segments stay at frame resolution.
|
|
12739
|
+
*/
|
|
12740
|
+
private static _refineSampleTimes;
|
|
12741
|
+
/**
|
|
12742
|
+
* Keys of a scalar property animated by one or more layers: the authored keys when a single layer drives it,
|
|
12743
|
+
* otherwise the frame grid evaluated through the layer stack.
|
|
12744
|
+
* @param sources - Per-layer curves of the property (each with at least one curve)
|
|
12745
|
+
* @param animStack - Stack being converted
|
|
12746
|
+
* @param mapValue - Conversion from the FBX value to the Babylon property value
|
|
12747
|
+
* @returns Animation keys
|
|
12748
|
+
*/
|
|
12749
|
+
private _layeredScalarKeys;
|
|
12750
|
+
/**
|
|
12751
|
+
* Maps an animated FBX property (anything other than node transforms and blend shape weights) onto the Babylon
|
|
12752
|
+
* property that carries it: mesh visibility, camera field of view and clip planes, light intensity, colour and
|
|
12753
|
+
* cone angles, and material colours, alpha, roughness and metalness. `group` holds the curve nodes of every
|
|
12754
|
+
* layer animating that property, in layer order; several layers are evaluated through the layer stack.
|
|
12755
|
+
*/
|
|
12756
|
+
private _buildPropertyAnimations;
|
|
12757
|
+
/** Records constraints on their nodes and, unless disabled, attaches the runtime behavior that solves them. */
|
|
12758
|
+
private _applyConstraints;
|
|
12759
|
+
/** Collects every recoverable issue the interpreter recorded, stores it on the root node and notifies the caller. */
|
|
12760
|
+
private _reportDiagnostics;
|
|
12761
|
+
/** Curve nodes affecting the inherit scale of a model: its own scale curves and those of its inherit-scale chain. */
|
|
12762
|
+
private _collectInheritScaleCurves;
|
|
12077
12763
|
private _isVector3KeysConstant;
|
|
12764
|
+
/** Samples the animated Lcl Translation / Rotation / Scaling of a model, blending all layers of the active stack. */
|
|
12765
|
+
private _sampleModelTRS;
|
|
12766
|
+
/**
|
|
12767
|
+
* Local position/rotation/scale of a model from FBX Lcl values. Without pivots and offsets the components map
|
|
12768
|
+
* directly (rotation = pre * lcl * post⁻¹), which keeps zero and negative scales exact. With pivots the full
|
|
12769
|
+
* matrix is built and decomposed.
|
|
12770
|
+
*/
|
|
12771
|
+
private static _computeLocalTRS;
|
|
12772
|
+
/** Applies inherit-mode adjustments to a local TRS (see _computeInheritAwareLocalMatrix). */
|
|
12773
|
+
private _adjustTRSForInheritMode;
|
|
12078
12774
|
private _sampleModelLocalMatrix;
|
|
12079
12775
|
private _sampleModelScale;
|
|
12776
|
+
/**
|
|
12777
|
+
* Effective scale of a model for inherit-mode math (`inherit_scale` in ufbx terms): its own local scale, multiplied
|
|
12778
|
+
* componentwise by the inherited scale when the model uses RrSs inheritance. `time` samples animation; undefined
|
|
12779
|
+
* uses the rest pose.
|
|
12780
|
+
*/
|
|
12781
|
+
private _getInheritScale;
|
|
12782
|
+
/** RrSs nodes inherit scale from their parent; Rrs nodes skip their immediate parent (chaining through Rrs parents). */
|
|
12783
|
+
private _getInheritScaleNode;
|
|
12784
|
+
/**
|
|
12785
|
+
* Local matrix of a model relative to its Babylon parent frame, accounting for inherit modes. For RSrs (the
|
|
12786
|
+
* default) this is the FBX local matrix. For RrSs / Rrs the node sits under a helper that removes the parent's
|
|
12787
|
+
* scale, so translation is pre-scaled by the parent scale and (for RrSs) scale accumulates componentwise.
|
|
12788
|
+
*/
|
|
12789
|
+
private _computeInheritAwareLocalMatrix;
|
|
12080
12790
|
/**
|
|
12081
12791
|
* Build matrix-baked bone animation from full FBX local transforms.
|
|
12082
12792
|
* The bind matrix carries the skinning offset, so animation curves drive
|
|
@@ -12114,6 +12824,197 @@ declare module "babylonjs-loaders/FBX/fbxFileLoader" {
|
|
|
12114
12824
|
export * from "babylonjs-loaders/FBX/fbxFileLoader.types";
|
|
12115
12825
|
export * from "babylonjs-loaders/FBX/fbxFileLoader.pure";
|
|
12116
12826
|
|
|
12827
|
+
}
|
|
12828
|
+
declare module "babylonjs-loaders/FBX/fbxConstraintBehavior" {
|
|
12829
|
+
/**
|
|
12830
|
+
* Runtime evaluation of FBX constraints. An `FBXConstraintBehavior` is attached to each constrained node; all
|
|
12831
|
+
* behaviors of a scene register with one `FBXConstraintSolver`, which solves them in dependency order (a constraint
|
|
12832
|
+
* whose target or parent is driven by another constraint is solved after it) and reuses scratch objects, so solving
|
|
12833
|
+
* allocates nothing per frame.
|
|
12834
|
+
*
|
|
12835
|
+
* The solver brackets the scene's animation phase: before animations run it writes each node's unconstrained
|
|
12836
|
+
* transform back, after they ran it captures the result as the new unconstrained transform and solves. A partial
|
|
12837
|
+
* weight therefore always blends from what animation (or nothing) produced this frame, never from the previous
|
|
12838
|
+
* solve's output, so a 50% weight stays a 50% blend instead of converging on the target.
|
|
12839
|
+
*
|
|
12840
|
+
* All maths happen in FBX space, i.e. relative to the loader's root node, so the handedness conversion applied
|
|
12841
|
+
* at the root never enters the solve.
|
|
12842
|
+
*/
|
|
12843
|
+
import { Behavior } from "babylonjs/Behaviors/behavior";
|
|
12844
|
+
import { Nullable } from "babylonjs/types";
|
|
12845
|
+
import { Node } from "babylonjs/node";
|
|
12846
|
+
import { Scene } from "babylonjs/scene";
|
|
12847
|
+
import { Matrix, Vector3 } from "babylonjs/Maths/math.vector.pure";
|
|
12848
|
+
import { TransformNode } from "babylonjs/Meshes/transformNode.pure";
|
|
12849
|
+
import { FBXConstraintData } from "babylonjs-loaders/FBX/interpreter/constraints";
|
|
12850
|
+
/** Resolved target of a constraint. */
|
|
12851
|
+
export interface FBXConstraintBehaviorTarget {
|
|
12852
|
+
/** Target node */
|
|
12853
|
+
node: TransformNode;
|
|
12854
|
+
/** Normalized target weight (0..1) */
|
|
12855
|
+
weight: number;
|
|
12856
|
+
/** Offset matrix for parent constraints (in the target's space) */
|
|
12857
|
+
offset: Matrix;
|
|
12858
|
+
}
|
|
12859
|
+
/** Options resolved by the loader when creating the behavior. */
|
|
12860
|
+
export interface FBXConstraintBehaviorOptions {
|
|
12861
|
+
/** Root of the loaded asset; world matrices are made relative to it */
|
|
12862
|
+
root: TransformNode;
|
|
12863
|
+
/** Resolved targets of the constraint, in file order */
|
|
12864
|
+
targets: FBXConstraintBehaviorTarget[];
|
|
12865
|
+
/** World up object of an aim constraint, when it has one */
|
|
12866
|
+
upNode: Nullable<TransformNode>;
|
|
12867
|
+
/** Scene up axis in FBX space */
|
|
12868
|
+
sceneUp: Vector3;
|
|
12869
|
+
}
|
|
12870
|
+
/**
|
|
12871
|
+
* Solves every FBX constraint of a scene once per frame, in dependency order, from the scene's animation phase
|
|
12872
|
+
* observers (`beginFrame` before animations, `solve` after them). Created on demand by the first
|
|
12873
|
+
* `FBXConstraintBehavior` attached in the scene and removed with the last one.
|
|
12874
|
+
*/
|
|
12875
|
+
export class FBXConstraintSolver {
|
|
12876
|
+
private readonly _scene;
|
|
12877
|
+
private readonly _behaviors;
|
|
12878
|
+
private _ordered;
|
|
12879
|
+
private _cyclic;
|
|
12880
|
+
private _dirty;
|
|
12881
|
+
private _beforeAnimations;
|
|
12882
|
+
private _afterAnimations;
|
|
12883
|
+
private constructor();
|
|
12884
|
+
/**
|
|
12885
|
+
* Solver of a scene, if any constraint behavior is attached in it.
|
|
12886
|
+
* @param scene - Scene to look up
|
|
12887
|
+
* @returns The solver, or undefined
|
|
12888
|
+
*/
|
|
12889
|
+
static Get(scene: Scene): FBXConstraintSolver | undefined;
|
|
12890
|
+
/**
|
|
12891
|
+
* Solver of a scene, created when missing.
|
|
12892
|
+
* @param scene - Scene to look up
|
|
12893
|
+
* @returns The solver
|
|
12894
|
+
*/
|
|
12895
|
+
static GetOrCreate(scene: Scene): FBXConstraintSolver;
|
|
12896
|
+
/** Registered behaviors in solve order (a target's constraint before the constraints that read it). */
|
|
12897
|
+
get constraints(): readonly FBXConstraintBehavior[];
|
|
12898
|
+
/**
|
|
12899
|
+
* Behaviors that take part in a dependency cycle (A targets B while B targets A). They are solved after all
|
|
12900
|
+
* acyclic constraints, in registration order, so each sees the other's result from the previous solve.
|
|
12901
|
+
*/
|
|
12902
|
+
get cyclicConstraints(): readonly FBXConstraintBehavior[];
|
|
12903
|
+
/**
|
|
12904
|
+
* Adds a behavior to the solve set.
|
|
12905
|
+
* @param behavior - Behavior to add
|
|
12906
|
+
*/
|
|
12907
|
+
register(behavior: FBXConstraintBehavior): void;
|
|
12908
|
+
/**
|
|
12909
|
+
* Removes a behavior from the solve set; the solver disposes itself with the last one.
|
|
12910
|
+
* @param behavior - Behavior to remove
|
|
12911
|
+
*/
|
|
12912
|
+
unregister(behavior: FBXConstraintBehavior): void;
|
|
12913
|
+
/** Marks the solve order stale, e.g. after re-parenting a constrained node. */
|
|
12914
|
+
invalidateOrder(): void;
|
|
12915
|
+
/**
|
|
12916
|
+
* Start of a frame, before animations run: every constrained node gets its unconstrained transform back, so
|
|
12917
|
+
* that animation either overwrites it or leaves it untouched.
|
|
12918
|
+
*/
|
|
12919
|
+
beginFrame(): void;
|
|
12920
|
+
/**
|
|
12921
|
+
* End of the animation phase: takes every constrained node's current transform as its unconstrained value,
|
|
12922
|
+
* then solves every registered constraint once, in dependency order.
|
|
12923
|
+
*/
|
|
12924
|
+
solve(): void;
|
|
12925
|
+
private _ensureOrder;
|
|
12926
|
+
private static _IsAncestorOrSelf;
|
|
12927
|
+
}
|
|
12928
|
+
/** Babylon behavior evaluating an FBX aim, parent, position, rotation or scale constraint. */
|
|
12929
|
+
export class FBXConstraintBehavior implements Behavior<TransformNode> {
|
|
12930
|
+
/** Constraint data extracted from the file */
|
|
12931
|
+
readonly constraint: FBXConstraintData;
|
|
12932
|
+
private readonly _options;
|
|
12933
|
+
/** Behavior name (`fbxConstraint:` followed by the constraint name) */
|
|
12934
|
+
readonly name: string;
|
|
12935
|
+
/** Node the behavior is attached to */
|
|
12936
|
+
attachedNode: Nullable<TransformNode>;
|
|
12937
|
+
/** Set to false to pause the constraint without detaching it */
|
|
12938
|
+
enabled: boolean;
|
|
12939
|
+
private readonly _offsetTranslation;
|
|
12940
|
+
private readonly _offsetRotation;
|
|
12941
|
+
private readonly _offsetScale;
|
|
12942
|
+
private readonly _localBasisTransposed;
|
|
12943
|
+
/** Unconstrained transform of the current frame (what animation produced), blended towards the constraint's result. */
|
|
12944
|
+
private readonly _base;
|
|
12945
|
+
private _hasBase;
|
|
12946
|
+
/**
|
|
12947
|
+
* Creates the behavior.
|
|
12948
|
+
* @param constraint - Constraint data extracted from the file
|
|
12949
|
+
* @param _options - Resolved targets and scene information
|
|
12950
|
+
*/
|
|
12951
|
+
constructor(
|
|
12952
|
+
/** Constraint data extracted from the file */
|
|
12953
|
+
constraint: FBXConstraintData, _options: FBXConstraintBehaviorOptions);
|
|
12954
|
+
/** Nothing to initialize */
|
|
12955
|
+
init(): void;
|
|
12956
|
+
/**
|
|
12957
|
+
* Registers the behavior with the scene's solver, takes the node's current transform as the unconstrained
|
|
12958
|
+
* value and solves the constraint once.
|
|
12959
|
+
* @param target - Node to constrain
|
|
12960
|
+
*/
|
|
12961
|
+
attach(target: TransformNode): void;
|
|
12962
|
+
/** Unregisters the behavior; the node keeps its last solved transform. */
|
|
12963
|
+
detach(): void;
|
|
12964
|
+
/**
|
|
12965
|
+
* Takes the node's current transform as the unconstrained value the next solve blends from. The solver calls
|
|
12966
|
+
* this after the scene's animations ran; call it yourself after writing a transform by hand.
|
|
12967
|
+
*/
|
|
12968
|
+
captureBase(): void;
|
|
12969
|
+
/**
|
|
12970
|
+
* Writes the unconstrained transform back to the node. The solver calls this before the scene's animations
|
|
12971
|
+
* run, so a node nothing animates keeps its unconstrained value between frames instead of the solved one.
|
|
12972
|
+
*/
|
|
12973
|
+
restoreBase(): void;
|
|
12974
|
+
/**
|
|
12975
|
+
* Nodes whose world transform the solve reads: the targets, the up node and the constrained node's parent.
|
|
12976
|
+
* @returns The nodes, used by the solver to order constraints
|
|
12977
|
+
*/
|
|
12978
|
+
dependencyNodes(): Nullable<Node>[];
|
|
12979
|
+
/**
|
|
12980
|
+
* Solves the constraint from the captured unconstrained transform and writes the node's local transform.
|
|
12981
|
+
* Blends are relative to the value captured by `captureBase`, not to whatever the node holds now.
|
|
12982
|
+
*/
|
|
12983
|
+
evaluate(): void;
|
|
12984
|
+
/**
|
|
12985
|
+
* World matrix of a node relative to the asset root (FBX space).
|
|
12986
|
+
* @param node - node to evaluate
|
|
12987
|
+
* @param out - matrix receiving the result
|
|
12988
|
+
* @returns `out`
|
|
12989
|
+
*/
|
|
12990
|
+
private _fbxWorld;
|
|
12991
|
+
/**
|
|
12992
|
+
* Weighted blend of the targets' world transforms (relative to the root).
|
|
12993
|
+
* @param position - Receives the blended translation
|
|
12994
|
+
* @param rotation - Receives the blended rotation
|
|
12995
|
+
* @param scale - Receives the blended scale
|
|
12996
|
+
* @returns The total target weight, 0 when no target contributes
|
|
12997
|
+
*/
|
|
12998
|
+
private _blendTargets;
|
|
12999
|
+
private _applyWeighted;
|
|
13000
|
+
private _applyRotation;
|
|
13001
|
+
private _writePosition;
|
|
13002
|
+
private _writeScaling;
|
|
13003
|
+
private _solvePosition;
|
|
13004
|
+
private _solveRotation;
|
|
13005
|
+
private _solveScale;
|
|
13006
|
+
private _solveParent;
|
|
13007
|
+
private _solveAim;
|
|
13008
|
+
/**
|
|
13009
|
+
* Builds a rotation matrix whose rows are `first`, `second` made orthogonal to it, and their cross product.
|
|
13010
|
+
* @param first - primary axis
|
|
13011
|
+
* @param second - secondary axis
|
|
13012
|
+
* @param out - matrix receiving the basis
|
|
13013
|
+
* @returns false when the axes are parallel or degenerate (`out` is then unchanged)
|
|
13014
|
+
*/
|
|
13015
|
+
private static _OrthonormalBasisToRef;
|
|
13016
|
+
}
|
|
13017
|
+
|
|
12117
13018
|
}
|
|
12118
13019
|
declare module "babylonjs-loaders/FBX/types/fbxTypes" {
|
|
12119
13020
|
/**
|
|
@@ -12130,6 +13031,11 @@ export interface FBXProperty {
|
|
|
12130
13031
|
type: FBXPropertyType;
|
|
12131
13032
|
/** Parsed property value. */
|
|
12132
13033
|
value: FBXPropertyValue;
|
|
13034
|
+
/**
|
|
13035
|
+
* Exact decimal text of an int64 whose magnitude exceeds 2^53; `value` then holds the rounded double. Object
|
|
13036
|
+
* ids are the only int64 values where the last bits matter, and `resolveConnections` keys them by this text.
|
|
13037
|
+
*/
|
|
13038
|
+
raw?: string;
|
|
12133
13039
|
}
|
|
12134
13040
|
/** A node in the FBX document tree */
|
|
12135
13041
|
export interface FBXNode {
|
|
@@ -12156,11 +13062,22 @@ export function findDocumentNode(doc: FBXDocument, name: string): FBXNode | unde
|
|
|
12156
13062
|
/** Extract a property value by index, with type narrowing */
|
|
12157
13063
|
export function getPropertyValue<T extends FBXPropertyValue>(node: FBXNode, index: number): T | undefined;
|
|
12158
13064
|
/**
|
|
12159
|
-
*
|
|
13065
|
+
* Validates an FBX object ID value: IDs are 64-bit integers, so anything non-numeric, non-finite or fractional is
|
|
13066
|
+
* rejected. IDs beyond 2^53 are carried losslessly through the property's `raw` text by `resolveConnections`.
|
|
12160
13067
|
* @param value - Parsed FBX object ID value
|
|
12161
|
-
* @returns The object ID, or undefined when the value
|
|
13068
|
+
* @returns The object ID, or undefined when the value cannot be an ID
|
|
12162
13069
|
*/
|
|
12163
13070
|
export function getSafeFBXObjectId(value: unknown): number | undefined;
|
|
13071
|
+
/** Typed array payload types produced by the parsers. */
|
|
13072
|
+
export type FBXArrayValue = Float32Array | Float64Array | Int32Array | Uint8Array;
|
|
13073
|
+
/**
|
|
13074
|
+
* Returns the array payload of a node.
|
|
13075
|
+
* FBX 7.x stores arrays as a single array property. FBX 6.x (and some 7.x ASCII exporters) store them as a run of
|
|
13076
|
+
* scalar properties, and a one-element array degenerates to a single scalar. All of these are coalesced here.
|
|
13077
|
+
* @param node - Node whose properties hold the array
|
|
13078
|
+
* @returns The array, or null when the node has no numeric payload
|
|
13079
|
+
*/
|
|
13080
|
+
export function getNodeArray(node: FBXNode | undefined | null): FBXArrayValue | null;
|
|
12164
13081
|
/** Get the numeric ID from a node (first property is typically the int64 UID) */
|
|
12165
13082
|
export function getNodeId(node: FBXNode): number | undefined;
|
|
12166
13083
|
/**
|
|
@@ -12224,6 +13141,8 @@ export function computeFBXLocalMatrix(components: FBXTransformComponents): Matri
|
|
|
12224
13141
|
|
|
12225
13142
|
}
|
|
12226
13143
|
declare module "babylonjs-loaders/FBX/interpreter/skeleton" {
|
|
13144
|
+
import { FBXNodeTransformData } from "babylonjs-loaders/FBX/interpreter/nodeTransform";
|
|
13145
|
+
import { FBXPropertyTemplate, FBXPropertyTemplateMap } from "babylonjs-loaders/FBX/interpreter/propertyTemplates";
|
|
12227
13146
|
import { FBXNode } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
12228
13147
|
import { FBXObjectMap } from "babylonjs-loaders/FBX/interpreter/connections";
|
|
12229
13148
|
export type FBXClusterMode = "Normalize" | "Additive" | "TotalOne" | "Unknown";
|
|
@@ -12298,25 +13217,9 @@ export interface FBXSkinData {
|
|
|
12298
13217
|
/** Recoverable skinning/bind diagnostics */
|
|
12299
13218
|
diagnostics: FBXSkinDiagnostic[];
|
|
12300
13219
|
}
|
|
12301
|
-
|
|
12302
|
-
* Extract all skin deformers from the FBX scene.
|
|
12303
|
-
* Returns skin data including bone hierarchy and vertex weights.
|
|
12304
|
-
*/
|
|
12305
|
-
export function extractSkins(objectMap: FBXObjectMap): FBXSkinData[];
|
|
13220
|
+
export function extractSkins(objectMap: FBXObjectMap, propertyTemplates?: FBXPropertyTemplateMap): FBXSkinData[];
|
|
12306
13221
|
export function isSkeletonModel(modelNode: FBXNode): boolean;
|
|
12307
|
-
export function extractBoneTransform(modelNode: FBXNode):
|
|
12308
|
-
translation: [number, number, number];
|
|
12309
|
-
rotation: [number, number, number];
|
|
12310
|
-
preRotation: [number, number, number];
|
|
12311
|
-
postRotation: [number, number, number];
|
|
12312
|
-
rotationPivot: [number, number, number];
|
|
12313
|
-
scalingPivot: [number, number, number];
|
|
12314
|
-
rotationOffset: [number, number, number];
|
|
12315
|
-
scalingOffset: [number, number, number];
|
|
12316
|
-
scale: [number, number, number];
|
|
12317
|
-
rotationOrder: number;
|
|
12318
|
-
inheritType: number;
|
|
12319
|
-
};
|
|
13222
|
+
export function extractBoneTransform(modelNode: FBXNode, template?: FBXPropertyTemplate): FBXNodeTransformData;
|
|
12320
13223
|
|
|
12321
13224
|
}
|
|
12322
13225
|
declare module "babylonjs-loaders/FBX/interpreter/sceneDiagnostics" {
|
|
@@ -12382,12 +13285,173 @@ export function resolveNumberProperty(node: FBXNode, template: FBXPropertyTempla
|
|
|
12382
13285
|
export function resolveVector2Property(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string, fallback: [number, number]): [number, number];
|
|
12383
13286
|
export function resolveVector3Property(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string, fallback: [number, number, number]): [number, number, number];
|
|
12384
13287
|
export function resolvePropertyValues(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string): FBXPropertyValue[] | undefined;
|
|
12385
|
-
|
|
13288
|
+
/** A property from a Properties70 ("P") or Properties60 ("Property") block. */
|
|
13289
|
+
export interface FBXPropertyEntry {
|
|
13290
|
+
name: string;
|
|
13291
|
+
type: string;
|
|
13292
|
+
flags: string;
|
|
13293
|
+
values: FBXPropertyValue[];
|
|
13294
|
+
}
|
|
13295
|
+
/**
|
|
13296
|
+
* Lists the properties declared directly on an object, from both the 7.x and 6.x property blocks.
|
|
13297
|
+
* @param node - Object node
|
|
13298
|
+
* @returns Property entries in declaration order (empty when the node has no property block)
|
|
13299
|
+
*/
|
|
13300
|
+
export function getPropertyEntries(node: FBXNode | undefined): FBXPropertyEntry[];
|
|
13301
|
+
/** Value of a user property: scalars as-is, vectors and colours as number arrays. */
|
|
13302
|
+
export type FBXUserPropertyValue = string | number | boolean | number[];
|
|
13303
|
+
/**
|
|
13304
|
+
* User-defined properties of an object: those flagged "U" (user) in the property flags. Every DCC exports custom
|
|
13305
|
+
* attributes this way (Maya extra attributes, 3ds Max user properties, Blender custom properties).
|
|
13306
|
+
* @param node - Object node
|
|
13307
|
+
* @returns Map of property name to value, or undefined when the object has none
|
|
13308
|
+
*/
|
|
13309
|
+
export function extractUserProperties(node: FBXNode): Record<string, FBXUserPropertyValue> | undefined;
|
|
13310
|
+
export function userPropertyValue(values: FBXPropertyValue[], typeName?: string): FBXUserPropertyValue | undefined;
|
|
13311
|
+
|
|
13312
|
+
}
|
|
13313
|
+
declare module "babylonjs-loaders/FBX/interpreter/nurbs" {
|
|
13314
|
+
/**
|
|
13315
|
+
* NURBS curves and surfaces, and polyline ("Line") geometry.
|
|
13316
|
+
*
|
|
13317
|
+
* The basis evaluation and tessellation follow the FBX SDK conventions as implemented by ufbx: knot spans are
|
|
13318
|
+
* subdivided uniformly, closed and periodic curves wrap their control points, and surfaces are tessellated into
|
|
13319
|
+
* quads (degenerate quads at poles become triangles) with welded positions along the wrapped edges.
|
|
13320
|
+
*/
|
|
13321
|
+
import { FBXNode } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
13322
|
+
import { FBXGeometryData, FBXGeometryDiagnostic } from "babylonjs-loaders/FBX/interpreter/geometry";
|
|
13323
|
+
export type FBXNurbsTopology = "open" | "closed" | "periodic";
|
|
13324
|
+
/** Knot vector and derived data of one parametric direction. */
|
|
13325
|
+
export interface FBXNurbsBasis {
|
|
13326
|
+
order: number;
|
|
13327
|
+
topology: FBXNurbsTopology;
|
|
13328
|
+
knots: Float64Array;
|
|
13329
|
+
/** Parameter range that the curve is defined on */
|
|
13330
|
+
tMin: number;
|
|
13331
|
+
tMax: number;
|
|
13332
|
+
/** Distinct knot values inside [tMin, tMax], i.e. the boundaries of the non-empty spans */
|
|
13333
|
+
spans: Float64Array;
|
|
13334
|
+
/** False when the knot vector is too short or not monotonic */
|
|
13335
|
+
valid: boolean;
|
|
13336
|
+
}
|
|
13337
|
+
/** NURBS curve: homogeneous control points (x, y, z, w) and a basis. */
|
|
13338
|
+
export interface FBXNurbsCurveData {
|
|
13339
|
+
basis: FBXNurbsBasis;
|
|
13340
|
+
/** Control points as x,y,z,w */
|
|
13341
|
+
controlPoints: Float64Array;
|
|
13342
|
+
numControlPoints: number;
|
|
13343
|
+
}
|
|
13344
|
+
/** NURBS surface: control points laid out as `v * numU + u`. */
|
|
13345
|
+
export interface FBXNurbsSurfaceData {
|
|
13346
|
+
basisU: FBXNurbsBasis;
|
|
13347
|
+
basisV: FBXNurbsBasis;
|
|
13348
|
+
numU: number;
|
|
13349
|
+
numV: number;
|
|
13350
|
+
/** Control points as x,y,z,w */
|
|
13351
|
+
controlPoints: Float64Array;
|
|
13352
|
+
flipNormals: boolean;
|
|
13353
|
+
/** Span subdivision stored in the file (Step), 0 when absent */
|
|
13354
|
+
stepU: number;
|
|
13355
|
+
stepV: number;
|
|
13356
|
+
}
|
|
13357
|
+
/** Polyline geometry ready for a lines mesh: one or more open or closed point runs. */
|
|
13358
|
+
export interface FBXCurveGeometryData {
|
|
13359
|
+
id: number;
|
|
13360
|
+
name: string;
|
|
13361
|
+
kind: "line" | "nurbsCurve";
|
|
13362
|
+
/** Each polyline as x,y,z triples; closed runs repeat their first point at the end */
|
|
13363
|
+
polylines: Float64Array[];
|
|
13364
|
+
/** Display colour from the geometry's Color property */
|
|
13365
|
+
color: [number, number, number] | null;
|
|
13366
|
+
diagnostics: FBXGeometryDiagnostic[];
|
|
13367
|
+
}
|
|
13368
|
+
export function createNurbsBasis(order: number, form: string | undefined, knots: Float64Array): FBXNurbsBasis;
|
|
13369
|
+
/**
|
|
13370
|
+
* Evaluates the basis functions (and their derivatives) that are non-zero at `u`.
|
|
13371
|
+
* @returns index of the first influencing control point, or -1 when the basis cannot be evaluated
|
|
13372
|
+
*/
|
|
13373
|
+
export function evaluateNurbsBasis(basis: FBXNurbsBasis, u: number, weights: Float64Array, derivatives: Float64Array | null): number;
|
|
13374
|
+
/** Evaluates a curve point; `out` receives position (0..2) and derivative (3..5). */
|
|
13375
|
+
export function evaluateNurbsCurve(curve: FBXNurbsCurveData, u: number, out: Float64Array, weights: Float64Array, derivs: Float64Array): boolean;
|
|
13376
|
+
/** Evaluates a surface point; `out` receives position (0..2), du (3..5) and dv (6..8). */
|
|
13377
|
+
export function evaluateNurbsSurface(surface: FBXNurbsSurfaceData, u: number, v: number, out: Float64Array, scratch: {
|
|
13378
|
+
wu: Float64Array;
|
|
13379
|
+
wv: Float64Array;
|
|
13380
|
+
du: Float64Array;
|
|
13381
|
+
dv: Float64Array;
|
|
13382
|
+
}): boolean;
|
|
13383
|
+
/**
|
|
13384
|
+
* Tessellates a curve into a polyline with `subdivision` segments per knot span. Closed and periodic curves
|
|
13385
|
+
* end on a copy of their first point.
|
|
13386
|
+
*/
|
|
13387
|
+
export function tessellateNurbsCurve(curve: FBXNurbsCurveData, subdivision?: number): Float64Array | null;
|
|
13388
|
+
/** Span subdivision to use for a surface direction: an explicit override, else the file's Step, else 4. */
|
|
13389
|
+
export function resolveSpanSubdivision(fileStep: number, override: number | undefined): number;
|
|
13390
|
+
/**
|
|
13391
|
+
* Tessellates a surface into triangles. Positions on wrapped (closed/periodic) edges and at poles are welded
|
|
13392
|
+
* exactly like the FBX SDK does, so degenerate quads collapse into triangles.
|
|
13393
|
+
*/
|
|
13394
|
+
export function tessellateNurbsSurface(surface: FBXNurbsSurfaceData, subU: number, subV: number): {
|
|
13395
|
+
positions: Float64Array;
|
|
13396
|
+
indices: Uint32Array;
|
|
13397
|
+
normals: Float64Array;
|
|
13398
|
+
uvs: Float64Array;
|
|
13399
|
+
} | null;
|
|
13400
|
+
/** Reads a NurbsCurve geometry node. */
|
|
13401
|
+
export function extractNurbsCurve(node: FBXNode): FBXNurbsCurveData | null;
|
|
13402
|
+
/** Reads a NurbsSurface geometry node. */
|
|
13403
|
+
export function extractNurbsSurface(node: FBXNode): FBXNurbsSurfaceData | null;
|
|
13404
|
+
/** Tessellates a NurbsSurface geometry node into mesh geometry. */
|
|
13405
|
+
export function nurbsSurfaceToGeometry(node: FBXNode, geometryId: number, subdivisionOverride: number | undefined): FBXGeometryData | null;
|
|
13406
|
+
/** Reads a NurbsCurve geometry node into a tessellated polyline. */
|
|
13407
|
+
export function extractNurbsCurveGeometry(node: FBXNode, geometryId: number, subdivision?: number): FBXCurveGeometryData;
|
|
13408
|
+
/**
|
|
13409
|
+
* Reads a Line geometry node: Points plus PointsIndex where a negative index (~index) ends a segment, as in
|
|
13410
|
+
* polygon vertex indices.
|
|
13411
|
+
*/
|
|
13412
|
+
export function extractLineGeometry(node: FBXNode, geometryId: number): FBXCurveGeometryData;
|
|
13413
|
+
|
|
13414
|
+
}
|
|
13415
|
+
declare module "babylonjs-loaders/FBX/interpreter/nodeTransform" {
|
|
13416
|
+
import { FBXNode } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
13417
|
+
import { FBXPropertyTemplate } from "babylonjs-loaders/FBX/interpreter/propertyTemplates";
|
|
13418
|
+
/** Transform properties resolved from an FBX Model, with template defaults applied. */
|
|
13419
|
+
export interface FBXNodeTransformData {
|
|
13420
|
+
translation: [number, number, number];
|
|
13421
|
+
rotation: [number, number, number];
|
|
13422
|
+
scale: [number, number, number];
|
|
13423
|
+
preRotation: [number, number, number];
|
|
13424
|
+
postRotation: [number, number, number];
|
|
13425
|
+
rotationPivot: [number, number, number];
|
|
13426
|
+
scalingPivot: [number, number, number];
|
|
13427
|
+
rotationOffset: [number, number, number];
|
|
13428
|
+
scalingOffset: [number, number, number];
|
|
13429
|
+
geometricTranslation: [number, number, number];
|
|
13430
|
+
geometricRotation: [number, number, number];
|
|
13431
|
+
geometricScaling: [number, number, number];
|
|
13432
|
+
/** Rotation order: 0=XYZ, 1=XZY, 2=YZX, 3=YXZ, 4=ZXY, 5=ZYX, 6=SphericXYZ */
|
|
13433
|
+
rotationOrder: number;
|
|
13434
|
+
/** FBX transform inheritance mode. 0=RrSs, 1=RSrs, 2=Rrs */
|
|
13435
|
+
inheritType: number;
|
|
13436
|
+
/** Whether the rotation space (rotation order, pre/post rotation) is active for this node */
|
|
13437
|
+
rotationActive: boolean;
|
|
13438
|
+
diagnostics: string[];
|
|
13439
|
+
}
|
|
13440
|
+
/**
|
|
13441
|
+
* Resolves the transform properties of a Model node the way the FBX SDK evaluates them.
|
|
13442
|
+
*
|
|
13443
|
+
* `RotationActive` gates the whole rotation space: when it is false (the FbxNode template default), the SDK
|
|
13444
|
+
* composes `Lcl Rotation` in plain XYZ order and ignores `RotationOrder`, `PreRotation` and `PostRotation`.
|
|
13445
|
+
* `RotationSpaceForLimitOnly` restricts the rotation space to limits, which has the same effect for us.
|
|
13446
|
+
*/
|
|
13447
|
+
export function extractNodeTransform(modelNode: FBXNode, template?: FBXPropertyTemplate): FBXNodeTransformData;
|
|
13448
|
+
|
|
12386
13449
|
}
|
|
12387
13450
|
declare module "babylonjs-loaders/FBX/interpreter/materials" {
|
|
12388
13451
|
import { FBXNode } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
12389
13452
|
import { FBXObjectMap } from "babylonjs-loaders/FBX/interpreter/connections";
|
|
12390
|
-
import { FBXPropertyTemplateMap } from "babylonjs-loaders/FBX/interpreter/propertyTemplates";
|
|
13453
|
+
import { FBXPropertyTemplate, FBXPropertyTemplateMap, FBXUserPropertyValue } from "babylonjs-loaders/FBX/interpreter/propertyTemplates";
|
|
13454
|
+
import { FBXMaterialModel } from "babylonjs-loaders/FBX/interpreter/materialModel";
|
|
12391
13455
|
/** Parsed material data */
|
|
12392
13456
|
export interface FBXMaterialData {
|
|
12393
13457
|
id: number;
|
|
@@ -12395,6 +13459,10 @@ export interface FBXMaterialData {
|
|
|
12395
13459
|
type: "Lambert" | "Phong";
|
|
12396
13460
|
properties: FBXMaterialProperties;
|
|
12397
13461
|
textures: FBXTextureRef[];
|
|
13462
|
+
/** Unified classic + PBR parameter model resolved from whichever shader flavour the file uses */
|
|
13463
|
+
model: FBXMaterialModel<FBXTextureRef>;
|
|
13464
|
+
/** User-defined properties */
|
|
13465
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
12398
13466
|
}
|
|
12399
13467
|
export interface FBXMaterialProperties {
|
|
12400
13468
|
diffuseColor?: [number, number, number];
|
|
@@ -12430,11 +13498,106 @@ export interface FBXTextureRef {
|
|
|
12430
13498
|
uvSetIndex?: number;
|
|
12431
13499
|
/** Which named UV set this texture uses */
|
|
12432
13500
|
uvSetName?: string;
|
|
13501
|
+
/** WrapModeU: 0 = repeat, 1 = clamp */
|
|
13502
|
+
wrapU?: number;
|
|
13503
|
+
/** WrapModeV: 0 = repeat, 1 = clamp */
|
|
13504
|
+
wrapV?: number;
|
|
13505
|
+
/** Set when the texture came from a LayeredTexture (only the first layer is used) */
|
|
13506
|
+
layeredTextureId?: number;
|
|
12433
13507
|
}
|
|
12434
13508
|
/**
|
|
12435
13509
|
* Extract material data from an FBX Material node.
|
|
12436
13510
|
*/
|
|
12437
13511
|
export function extractMaterial(materialNode: FBXNode, materialId: number, objectMap: FBXObjectMap, templates?: FBXPropertyTemplateMap): FBXMaterialData;
|
|
13512
|
+
export function extractTextureRef(id: number, node: FBXNode, propertyName: string | undefined, objectMap: FBXObjectMap, template?: FBXPropertyTemplate): FBXTextureRef;
|
|
13513
|
+
|
|
13514
|
+
}
|
|
13515
|
+
declare module "babylonjs-loaders/FBX/interpreter/materialModel" {
|
|
13516
|
+
/**
|
|
13517
|
+
* Unified material model.
|
|
13518
|
+
*
|
|
13519
|
+
* FBX materials come in many vendor flavours: the classic FbxSurfaceLambert / FbxSurfacePhong, Autodesk Standard
|
|
13520
|
+
* Surface (OSL), Arnold aiStandardSurface, 3ds Max Physical Material, 3ds Max PBR (metal/rough and spec/gloss),
|
|
13521
|
+
* the 3ds Max glTF material, OpenPBR, and Maya's Stingray PBS ShaderFX graph. Each stores its parameters under
|
|
13522
|
+
* different property names, sometimes behind a shader binding table.
|
|
13523
|
+
*
|
|
13524
|
+
* This module resolves any of them into two parameter sets, mirroring how the FBX SDK / ufbx expose materials:
|
|
13525
|
+
* `fbx` (the classic Lambert/Phong parameters) and `pbr` (a physically based parameter set), plus feature flags.
|
|
13526
|
+
*/
|
|
13527
|
+
import { FBXPropertyValue } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
13528
|
+
export type FBXShaderType = "unknown" | "fbxLambert" | "fbxPhong" | "oslStandardSurface" | "arnoldStandardSurface" | "3dsMaxPhysicalMaterial" | "3dsMaxPbrMetalRough" | "3dsMaxPbrSpecGloss" | "gltfMaterial" | "openPbrMaterial" | "shaderFxGraph";
|
|
13529
|
+
/** One resolved material parameter: a constant value and/or a texture. */
|
|
13530
|
+
export interface FBXMaterialMap<TTexture> {
|
|
13531
|
+
/** Constant value (r,g,b,a for colours, x for scalars) */
|
|
13532
|
+
value?: number[];
|
|
13533
|
+
/** Number of meaningful components in `value` (1 for scalars, 3 or 4 for colours) */
|
|
13534
|
+
valueComponents: number;
|
|
13535
|
+
/** Texture bound to the parameter */
|
|
13536
|
+
texture?: TTexture;
|
|
13537
|
+
/** Whether the texture is enabled (some vendors carry an explicit toggle) */
|
|
13538
|
+
textureEnabled: boolean;
|
|
13539
|
+
}
|
|
13540
|
+
export type FBXFbxMapName = "diffuseFactor" | "diffuseColor" | "specularFactor" | "specularColor" | "specularExponent" | "reflectionFactor" | "reflectionColor" | "transparencyFactor" | "transparencyColor" | "emissionFactor" | "emissionColor" | "ambientFactor" | "ambientColor" | "normalMap" | "bump" | "bumpFactor" | "displacement" | "displacementFactor" | "vectorDisplacement" | "vectorDisplacementFactor";
|
|
13541
|
+
export type FBXPbrMapName = "baseFactor" | "baseColor" | "roughness" | "metalness" | "diffuseRoughness" | "specularFactor" | "specularColor" | "specularIor" | "specularAnisotropy" | "specularRotation" | "transmissionFactor" | "transmissionColor" | "transmissionDepth" | "transmissionScatter" | "transmissionScatterAnisotropy" | "transmissionDispersion" | "transmissionRoughness" | "transmissionExtraRoughness" | "transmissionPriority" | "transmissionEnableInAov" | "subsurfaceFactor" | "subsurfaceColor" | "subsurfaceRadius" | "subsurfaceScale" | "subsurfaceAnisotropy" | "subsurfaceTintColor" | "subsurfaceType" | "sheenFactor" | "sheenColor" | "sheenRoughness" | "coatFactor" | "coatColor" | "coatRoughness" | "coatIor" | "coatAnisotropy" | "coatRotation" | "coatNormal" | "coatAffectBaseColor" | "coatAffectBaseRoughness" | "thinFilmFactor" | "thinFilmThickness" | "thinFilmIor" | "emissionFactor" | "emissionColor" | "opacity" | "indirectDiffuse" | "indirectSpecular" | "normalMap" | "tangentMap" | "displacementMap" | "matteFactor" | "matteColor" | "ambientOcclusion" | "glossiness" | "coatGlossiness" | "transmissionGlossiness";
|
|
13542
|
+
export type FBXMaterialFeatureName = "pbr" | "metalness" | "diffuse" | "specular" | "emission" | "transmission" | "coat" | "sheen" | "opacity" | "ambientOcclusion" | "matte" | "unlit" | "ior" | "diffuseRoughness" | "transmissionRoughness" | "thinWalled" | "caustics" | "exitToBackground" | "internalReflections" | "doubleSided" | "roughnessAsGlossiness" | "coatRoughnessAsGlossiness" | "transmissionRoughnessAsGlossiness";
|
|
13543
|
+
export interface FBXMaterialModel<TTexture> {
|
|
13544
|
+
shaderType: FBXShaderType;
|
|
13545
|
+
/** Prefix material property names carry for this shader (e.g. "3dsMax|Parameters|") */
|
|
13546
|
+
shaderPropPrefix: string;
|
|
13547
|
+
fbx: Partial<Record<FBXFbxMapName, FBXMaterialMap<TTexture>>>;
|
|
13548
|
+
pbr: Partial<Record<FBXPbrMapName, FBXMaterialMap<TTexture>>>;
|
|
13549
|
+
features: Partial<Record<FBXMaterialFeatureName, {
|
|
13550
|
+
enabled: boolean;
|
|
13551
|
+
explicit: boolean;
|
|
13552
|
+
}>>;
|
|
13553
|
+
}
|
|
13554
|
+
/** Inputs needed to resolve a material, independent of the parse representation. */
|
|
13555
|
+
export interface FBXMaterialSource<TTexture> {
|
|
13556
|
+
/** "lambert", "phong", "unknown", ... as written in the file */
|
|
13557
|
+
shadingModelName: string;
|
|
13558
|
+
/** Property values by full property name (e.g. "DiffuseColor", "Maya|baseColor", "3dsMax|Parameters|roughness") */
|
|
13559
|
+
props: Map<string, {
|
|
13560
|
+
type: string;
|
|
13561
|
+
values: FBXPropertyValue[];
|
|
13562
|
+
}>;
|
|
13563
|
+
/** Textures connected to the material by property name (OP connection property) */
|
|
13564
|
+
texturesByProp: Map<string, TTexture>;
|
|
13565
|
+
/** Connected shader implementation, when any */
|
|
13566
|
+
shader?: {
|
|
13567
|
+
renderApi: string;
|
|
13568
|
+
/** shader semantic name -> material property names */
|
|
13569
|
+
bindings: Map<string, string[]>;
|
|
13570
|
+
};
|
|
13571
|
+
}
|
|
13572
|
+
/** Shader types whose parameters are physically based; the loader emits PBR materials for them by default. */
|
|
13573
|
+
export function isPbrShaderType(type: FBXShaderType): boolean;
|
|
13574
|
+
/** Detects the shader flavour of a material from its shading model name, connected shader and 3ds Max class ids. */
|
|
13575
|
+
export function detectShaderType<T>(source: FBXMaterialSource<T>): {
|
|
13576
|
+
shaderType: FBXShaderType;
|
|
13577
|
+
shaderPropPrefix: string;
|
|
13578
|
+
};
|
|
13579
|
+
/**
|
|
13580
|
+
* Resolves the unified material model from raw material data.
|
|
13581
|
+
*/
|
|
13582
|
+
export function resolveMaterialModel<T>(source: FBXMaterialSource<T>): FBXMaterialModel<T>;
|
|
13583
|
+
/** Colour (first three components) of a map, or undefined. */
|
|
13584
|
+
export function mapColor<T>(map: FBXMaterialMap<T> | undefined): [number, number, number] | undefined;
|
|
13585
|
+
/** Scalar (first component) of a map, or undefined. */
|
|
13586
|
+
export function mapScalar<T>(map: FBXMaterialMap<T> | undefined): number | undefined;
|
|
13587
|
+
|
|
13588
|
+
}
|
|
13589
|
+
declare module "babylonjs-loaders/FBX/interpreter/legacyDocument" {
|
|
13590
|
+
/**
|
|
13591
|
+
* FBX 5.x (and older) documents store everything at the top level: one `Model` node per object with inline
|
|
13592
|
+
* geometry, materials, skin links, lights and cameras, and `Children` lists instead of connections. This module
|
|
13593
|
+
* rewrites such a document into the 6.x layout (`Objects`, `Connections`, `Takes`) so the rest of the importer
|
|
13594
|
+
* can treat both the same way. The rules follow the FBX SDK's legacy reader as implemented by ufbx.
|
|
13595
|
+
*/
|
|
13596
|
+
import { FBXDocument } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
13597
|
+
/** True for pre-6000 files: no `Objects` section but top-level `Model` nodes. */
|
|
13598
|
+
export function isLegacyDocument(doc: FBXDocument): boolean;
|
|
13599
|
+
/** Rewrites a legacy document into the 6.x object/connection layout. */
|
|
13600
|
+
export function upgradeLegacyDocument(doc: FBXDocument): FBXDocument;
|
|
12438
13601
|
|
|
12439
13602
|
}
|
|
12440
13603
|
declare module "babylonjs-loaders/FBX/interpreter/geometry" {
|
|
@@ -12449,7 +13612,7 @@ export interface FBXUVSet {
|
|
|
12449
13612
|
/** Recoverable geometry import issue. */
|
|
12450
13613
|
export interface FBXGeometryDiagnostic {
|
|
12451
13614
|
/** Diagnostic category. */
|
|
12452
|
-
type: "degenerate-polygon" | "triangulation-fallback" | "layer-index-out-of-bounds" | "layer-data-too-short";
|
|
13615
|
+
type: "degenerate-polygon" | "triangulation-fallback" | "layer-index-out-of-bounds" | "layer-data-too-short" | "nurbs-invalid" | "nurbs-trim-ignored" | "nurbs-deformer-ignored";
|
|
12453
13616
|
/** Human-readable diagnostic message. */
|
|
12454
13617
|
message: string;
|
|
12455
13618
|
/** Polygon index associated with the diagnostic, if applicable. */
|
|
@@ -12496,8 +13659,11 @@ export function extractGeometry(geometryNode: FBXNode, nodeId: number): FBXGeome
|
|
|
12496
13659
|
|
|
12497
13660
|
}
|
|
12498
13661
|
declare module "babylonjs-loaders/FBX/interpreter/fbxInterpreter" {
|
|
13662
|
+
import { FBXUserPropertyValue } from "babylonjs-loaders/FBX/interpreter/propertyTemplates";
|
|
12499
13663
|
import { FBXDocument } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
12500
13664
|
import { FBXGeometryData } from "babylonjs-loaders/FBX/interpreter/geometry";
|
|
13665
|
+
import { FBXCurveGeometryData } from "babylonjs-loaders/FBX/interpreter/nurbs";
|
|
13666
|
+
import { FBXConstraintData } from "babylonjs-loaders/FBX/interpreter/constraints";
|
|
12501
13667
|
import { FBXMaterialData } from "babylonjs-loaders/FBX/interpreter/materials";
|
|
12502
13668
|
import { FBXSkinData } from "babylonjs-loaders/FBX/interpreter/skeleton";
|
|
12503
13669
|
import { FBXRigData } from "babylonjs-loaders/FBX/interpreter/rig";
|
|
@@ -12509,8 +13675,10 @@ export interface FBXModelData {
|
|
|
12509
13675
|
id: number;
|
|
12510
13676
|
name: string;
|
|
12511
13677
|
subType: string;
|
|
12512
|
-
/** Geometry attached to this model (
|
|
13678
|
+
/** Geometry attached to this model (meshes and tessellated NURBS surfaces) */
|
|
12513
13679
|
geometry?: FBXGeometryData;
|
|
13680
|
+
/** Curve geometry attached to this model (Line and NurbsCurve) */
|
|
13681
|
+
curve?: FBXCurveGeometryData;
|
|
12514
13682
|
/** Materials assigned to this model */
|
|
12515
13683
|
materials: FBXMaterialData[];
|
|
12516
13684
|
/** Child models */
|
|
@@ -12542,18 +13710,68 @@ export interface FBXModelData {
|
|
|
12542
13710
|
/** Whether backface culling is disabled ("CullingOff") */
|
|
12543
13711
|
cullingOff: boolean;
|
|
12544
13712
|
/** User-defined custom properties from Properties70 */
|
|
12545
|
-
customProperties?: Record<string,
|
|
13713
|
+
customProperties?: Record<string, FBXUserPropertyValue>;
|
|
13714
|
+
/** LOD group settings when this model is a LodGroup; children are the levels in order */
|
|
13715
|
+
lodGroup?: FBXLodGroupData;
|
|
13716
|
+
/** Display layer (CollectionExclusive) the model belongs to */
|
|
13717
|
+
displayLayer?: FBXDisplayLayerData;
|
|
12546
13718
|
/** Recoverable model import diagnostics */
|
|
12547
13719
|
diagnostics: string[];
|
|
12548
13720
|
}
|
|
13721
|
+
/** LOD group settings (NodeAttribute "LodGroup") */
|
|
13722
|
+
export interface FBXLodGroupData {
|
|
13723
|
+
/** Switch distance for level i+1 (level 0 has none). In scene units, or percent of screen when `relative`. */
|
|
13724
|
+
thresholds: number[];
|
|
13725
|
+
/** ThresholdsUsedAsPercentage */
|
|
13726
|
+
relative: boolean;
|
|
13727
|
+
/** DisplayLevels|LevelN: 0 use LOD, 1 show, 2 hide */
|
|
13728
|
+
displayLevels: number[];
|
|
13729
|
+
}
|
|
13730
|
+
/** Display layer (CollectionExclusive "DisplayLayer") */
|
|
13731
|
+
export interface FBXDisplayLayerData {
|
|
13732
|
+
id: number;
|
|
13733
|
+
name: string;
|
|
13734
|
+
show: boolean;
|
|
13735
|
+
freeze: boolean;
|
|
13736
|
+
color: [number, number, number];
|
|
13737
|
+
modelIds: number[];
|
|
13738
|
+
}
|
|
13739
|
+
/** One member of a selection set: a model, optionally with a component selection on its mesh */
|
|
13740
|
+
export interface FBXSelectionNodeData {
|
|
13741
|
+
modelId: number;
|
|
13742
|
+
/** IsTheNodeInSet: the whole node is selected (as opposed to only components) */
|
|
13743
|
+
includeNode: boolean;
|
|
13744
|
+
/** Selected control point indices (VertexIndexArray) */
|
|
13745
|
+
vertices?: number[];
|
|
13746
|
+
/** Selected edge indices (EdgeIndexArray) */
|
|
13747
|
+
edges?: number[];
|
|
13748
|
+
/** Selected polygon indices (PolygonIndexArray) */
|
|
13749
|
+
faces?: number[];
|
|
13750
|
+
}
|
|
13751
|
+
/** Selection set (Collection "SelectionSet") */
|
|
13752
|
+
export interface FBXSelectionSetData {
|
|
13753
|
+
id: number;
|
|
13754
|
+
name: string;
|
|
13755
|
+
members: FBXSelectionNodeData[];
|
|
13756
|
+
}
|
|
12549
13757
|
/** Camera data extracted from FBX */
|
|
12550
13758
|
export interface FBXCameraData {
|
|
12551
13759
|
/** Model ID this camera is attached to */
|
|
12552
13760
|
modelId: number;
|
|
13761
|
+
/** NodeAttribute object ID (animation curves target this) */
|
|
13762
|
+
attributeId: number;
|
|
12553
13763
|
/** Camera name */
|
|
12554
13764
|
name: string;
|
|
12555
|
-
/**
|
|
13765
|
+
/** Vertical field of view in degrees */
|
|
12556
13766
|
fieldOfView: number;
|
|
13767
|
+
/** Horizontal field of view in degrees */
|
|
13768
|
+
fieldOfViewX: number;
|
|
13769
|
+
/** ApertureMode: 0 horizontal and vertical, 1 horizontal, 2 vertical, 3 focal length */
|
|
13770
|
+
apertureMode: number;
|
|
13771
|
+
/** Aperture (film gate after gate fit) size in inches */
|
|
13772
|
+
apertureSizeInch: [number, number];
|
|
13773
|
+
/** Orthographic view size (width, height) in scene units */
|
|
13774
|
+
orthographicSize: [number, number];
|
|
12557
13775
|
/** Near clip plane */
|
|
12558
13776
|
nearPlane: number;
|
|
12559
13777
|
/** Far clip plane */
|
|
@@ -12572,6 +13790,8 @@ export interface FBXCameraData {
|
|
|
12572
13790
|
orthoZoom?: number;
|
|
12573
13791
|
/** Camera roll in degrees when present */
|
|
12574
13792
|
roll?: number;
|
|
13793
|
+
/** User-defined properties on the camera attribute */
|
|
13794
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
12575
13795
|
/** Known unsupported or unrecognized camera properties */
|
|
12576
13796
|
unknownProperties: string[];
|
|
12577
13797
|
/** Recoverable camera import diagnostics */
|
|
@@ -12581,6 +13801,8 @@ export interface FBXCameraData {
|
|
|
12581
13801
|
export interface FBXLightData {
|
|
12582
13802
|
/** Model ID this light is attached to */
|
|
12583
13803
|
modelId: number;
|
|
13804
|
+
/** NodeAttribute object ID (animation curves target this) */
|
|
13805
|
+
attributeId: number;
|
|
12584
13806
|
/** Light name */
|
|
12585
13807
|
name: string;
|
|
12586
13808
|
/** Light type: 0=Point, 1=Directional, 2=Spot */
|
|
@@ -12605,6 +13827,15 @@ export interface FBXLightData {
|
|
|
12605
13827
|
enableFarAttenuation?: boolean;
|
|
12606
13828
|
/** Whether the source light requested shadow casting */
|
|
12607
13829
|
castShadows?: boolean;
|
|
13830
|
+
/** Near/far attenuation ranges in scene units (when enabled) */
|
|
13831
|
+
nearAttenuationStart?: number;
|
|
13832
|
+
nearAttenuationEnd?: number;
|
|
13833
|
+
farAttenuationStart?: number;
|
|
13834
|
+
farAttenuationEnd?: number;
|
|
13835
|
+
/** Area light shape: 0 rectangle, 1 sphere */
|
|
13836
|
+
areaLightShape?: number;
|
|
13837
|
+
/** User-defined properties on the light attribute */
|
|
13838
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
12608
13839
|
/** Known unsupported or unrecognized light properties */
|
|
12609
13840
|
unknownProperties: string[];
|
|
12610
13841
|
/** Recoverable light import diagnostics */
|
|
@@ -12616,6 +13847,8 @@ export interface FBXSceneData {
|
|
|
12616
13847
|
rootModels: FBXModelData[];
|
|
12617
13848
|
/** All geometries in the scene */
|
|
12618
13849
|
geometries: FBXGeometryData[];
|
|
13850
|
+
/** All curve geometries (lines and tessellated NURBS curves) */
|
|
13851
|
+
curves: FBXCurveGeometryData[];
|
|
12619
13852
|
/** All materials in the scene */
|
|
12620
13853
|
materials: FBXMaterialData[];
|
|
12621
13854
|
/** Skin deformers (skeletons + vertex weights) */
|
|
@@ -12632,6 +13865,12 @@ export interface FBXSceneData {
|
|
|
12632
13865
|
lights: FBXLightData[];
|
|
12633
13866
|
/** Scene-level unsupported feature diagnostics */
|
|
12634
13867
|
diagnostics: FBXSceneDiagnostic[];
|
|
13868
|
+
/** Constraints (aim, parent, position, rotation, scale, IK) */
|
|
13869
|
+
constraints: FBXConstraintData[];
|
|
13870
|
+
/** Display layers */
|
|
13871
|
+
displayLayers: FBXDisplayLayerData[];
|
|
13872
|
+
/** Selection sets */
|
|
13873
|
+
selectionSets: FBXSelectionSetData[];
|
|
12635
13874
|
/** Global settings */
|
|
12636
13875
|
upAxis: number;
|
|
12637
13876
|
upAxisSign: number;
|
|
@@ -12640,11 +13879,91 @@ export interface FBXSceneData {
|
|
|
12640
13879
|
coordAxis: number;
|
|
12641
13880
|
coordAxisSign: number;
|
|
12642
13881
|
unitScaleFactor: number;
|
|
13882
|
+
/** Scene frame rate derived from GlobalSettings TimeMode / CustomFrameRate */
|
|
13883
|
+
frameRate: number;
|
|
12643
13884
|
}
|
|
12644
13885
|
/**
|
|
12645
13886
|
* Interpret a parsed FBX document into scene data.
|
|
12646
13887
|
*/
|
|
12647
|
-
|
|
13888
|
+
/** Options controlling how the document is interpreted. */
|
|
13889
|
+
export interface FBXInterpretOptions {
|
|
13890
|
+
/** Segments per knot span when tessellating NURBS surfaces; defaults to the Step stored in the file */
|
|
13891
|
+
nurbsSubdivision?: number;
|
|
13892
|
+
/** Shift every clip so its first key sits at time 0 (default true); false keeps the authored times */
|
|
13893
|
+
rebaseKeyframes?: boolean;
|
|
13894
|
+
}
|
|
13895
|
+
export function interpretFBX(doc: FBXDocument, options?: FBXInterpretOptions): FBXSceneData;
|
|
13896
|
+
|
|
13897
|
+
}
|
|
13898
|
+
declare module "babylonjs-loaders/FBX/interpreter/constraints" {
|
|
13899
|
+
import { FBXObjectMap } from "babylonjs-loaders/FBX/interpreter/connections";
|
|
13900
|
+
export type FBXConstraintType = "aim" | "parent" | "position" | "rotation" | "scale" | "singleChainIK" | "unknown";
|
|
13901
|
+
export type Vec3 = [number, number, number];
|
|
13902
|
+
export type Bool3 = [boolean, boolean, boolean];
|
|
13903
|
+
/** One weighted target of a constraint. */
|
|
13904
|
+
export interface FBXConstraintTarget {
|
|
13905
|
+
/** Model id of the target node */
|
|
13906
|
+
modelId: number;
|
|
13907
|
+
/** Normalized weight (file value / 100, or as-is for IK pole targets) */
|
|
13908
|
+
weight: number;
|
|
13909
|
+
/** Parent constraint translation offset expressed in the target's space */
|
|
13910
|
+
offsetTranslation: Vec3;
|
|
13911
|
+
/** Parent constraint rotation offset in degrees, expressed in the target's space */
|
|
13912
|
+
offsetRotation: Vec3;
|
|
13913
|
+
/** Parent constraint scale offset expressed in the target's space */
|
|
13914
|
+
offsetScale: Vec3;
|
|
13915
|
+
}
|
|
13916
|
+
/** A constraint object of the file, with its targets and parameters resolved. */
|
|
13917
|
+
export interface FBXConstraintData {
|
|
13918
|
+
/** Constraint object id */
|
|
13919
|
+
id: number;
|
|
13920
|
+
/** Constraint name */
|
|
13921
|
+
name: string;
|
|
13922
|
+
/** Resolved constraint kind */
|
|
13923
|
+
type: FBXConstraintType;
|
|
13924
|
+
/** Constraint type name as written in the file (e.g. "Parent-Child") */
|
|
13925
|
+
typeName: string;
|
|
13926
|
+
/** Constrained model */
|
|
13927
|
+
nodeId?: number;
|
|
13928
|
+
/** Weighted targets in file order */
|
|
13929
|
+
targets: FBXConstraintTarget[];
|
|
13930
|
+
/** Global weight (file value / 100) */
|
|
13931
|
+
weight: number;
|
|
13932
|
+
/** False when the constraint is switched off in the file */
|
|
13933
|
+
active: boolean;
|
|
13934
|
+
/** Which translation axes the constraint drives */
|
|
13935
|
+
affectTranslation: Bool3;
|
|
13936
|
+
/** Which rotation axes the constraint drives */
|
|
13937
|
+
affectRotation: Bool3;
|
|
13938
|
+
/** Which scale axes the constraint drives */
|
|
13939
|
+
affectScale: Bool3;
|
|
13940
|
+
/** Translation offset of the constrained node */
|
|
13941
|
+
offsetTranslation: Vec3;
|
|
13942
|
+
/** Rotation offset of the constrained node, in degrees */
|
|
13943
|
+
offsetRotation: Vec3;
|
|
13944
|
+
/** Scale offset of the constrained node */
|
|
13945
|
+
offsetScale: Vec3;
|
|
13946
|
+
/** Aim: local axis that points at the target */
|
|
13947
|
+
aimVector: Vec3;
|
|
13948
|
+
/** Aim: local axis aligned with the up direction */
|
|
13949
|
+
upVector: Vec3;
|
|
13950
|
+
/** Aim: world up direction (world up modes 2 and 3) */
|
|
13951
|
+
worldUpVector: Vec3;
|
|
13952
|
+
/** Aim: 0 scene up, 1 aim up node, 2 align to node, 3 vector, 4 none */
|
|
13953
|
+
worldUpType: number;
|
|
13954
|
+
/** Aim: model id of the world up object (world up modes 1 and 2) */
|
|
13955
|
+
worldUpNodeId?: number;
|
|
13956
|
+
/** Single chain IK: model id of the first joint of the chain */
|
|
13957
|
+
ikFirstJointId?: number;
|
|
13958
|
+
/** Single chain IK: model id of the last joint of the chain */
|
|
13959
|
+
ikEndJointId?: number;
|
|
13960
|
+
/** Single chain IK: model id of the effector */
|
|
13961
|
+
ikEffectorId?: number;
|
|
13962
|
+
/** Single chain IK: pole vector */
|
|
13963
|
+
ikPoleVector: Vec3;
|
|
13964
|
+
}
|
|
13965
|
+
/** Reads every constraint object of the scene. */
|
|
13966
|
+
export function extractConstraints(objectMap: FBXObjectMap): FBXConstraintData[];
|
|
12648
13967
|
|
|
12649
13968
|
}
|
|
12650
13969
|
declare module "babylonjs-loaders/FBX/interpreter/connections" {
|
|
@@ -12669,7 +13988,7 @@ export interface FBXObjectEntry {
|
|
|
12669
13988
|
/** Object node. */
|
|
12670
13989
|
node: FBXNode;
|
|
12671
13990
|
/** Source of the object entry. */
|
|
12672
|
-
source: "Objects" | "legacySyntheticGeometry";
|
|
13991
|
+
source: "Objects" | "legacySyntheticGeometry" | "legacySyntheticAttribute" | "legacySyntheticBlendShape";
|
|
12673
13992
|
/** Legacy string object name, when applicable. */
|
|
12674
13993
|
legacyName?: string;
|
|
12675
13994
|
/** True if the object was synthesized for legacy compatibility. */
|
|
@@ -12792,9 +14111,24 @@ export interface FBXBlendShapeData {
|
|
|
12792
14111
|
export function extractBlendShapes(objectMap: FBXObjectMap): FBXBlendShapeData[];
|
|
12793
14112
|
|
|
12794
14113
|
}
|
|
12795
|
-
declare module "babylonjs-loaders/FBX/interpreter/
|
|
12796
|
-
|
|
14114
|
+
declare module "babylonjs-loaders/FBX/interpreter/animationCurve" {
|
|
14115
|
+
/**
|
|
14116
|
+
* FBX animation curve model and evaluator.
|
|
14117
|
+
*
|
|
14118
|
+
* Keys carry cubic Bezier tangents expressed the way the FBX SDK stores them: a left and right tangent with a time
|
|
14119
|
+
* extent (dx, as a fraction of the segment scaled by the tangent weight) and a value extent (dy). Linear and constant
|
|
14120
|
+
* segments are represented the same way so that a single evaluator handles every case, including the weighted
|
|
14121
|
+
* tangents Maya and MotionBuilder write, TCB keys, and the pre/post extrapolation modes.
|
|
14122
|
+
*/
|
|
14123
|
+
/** FBX time units: 46186158000 ticks per second */
|
|
14124
|
+
export const FBX_TIME_UNIT = 46186158000;
|
|
12797
14125
|
export type FBXInterpolationType = "constant" | "linear" | "cubic";
|
|
14126
|
+
export type FBXExtrapolationMode = "constant" | "repeat" | "mirror" | "slope" | "repeatRelative";
|
|
14127
|
+
export interface FBXExtrapolation {
|
|
14128
|
+
mode: FBXExtrapolationMode;
|
|
14129
|
+
/** Number of repetitions, or -1 for infinite */
|
|
14130
|
+
repeatCount: number;
|
|
14131
|
+
}
|
|
12798
14132
|
/** A single keyframe */
|
|
12799
14133
|
export interface FBXKeyframe {
|
|
12800
14134
|
/** Time in seconds */
|
|
@@ -12805,9 +14139,15 @@ export interface FBXKeyframe {
|
|
|
12805
14139
|
interpolation: FBXInterpolationType;
|
|
12806
14140
|
/** Constant interpolation variant */
|
|
12807
14141
|
constantMode?: "standard" | "next";
|
|
12808
|
-
/**
|
|
14142
|
+
/** Left (incoming) tangent: time extent in seconds and value extent */
|
|
14143
|
+
leftDx: number;
|
|
14144
|
+
leftDy: number;
|
|
14145
|
+
/** Right (outgoing) tangent: time extent in seconds and value extent */
|
|
14146
|
+
rightDx: number;
|
|
14147
|
+
rightDy: number;
|
|
14148
|
+
/** Cubic outgoing slope in value units per second (derived, kept for consumers that export hermite keys) */
|
|
12809
14149
|
rightSlope?: number;
|
|
12810
|
-
/** Cubic incoming slope for the next key, in value units per second */
|
|
14150
|
+
/** Cubic incoming slope for the next key, in value units per second (derived) */
|
|
12811
14151
|
nextLeftSlope?: number;
|
|
12812
14152
|
}
|
|
12813
14153
|
/** An animation curve (one axis of one property) */
|
|
@@ -12818,7 +14158,60 @@ export interface FBXCurveData {
|
|
|
12818
14158
|
keys: FBXKeyframe[];
|
|
12819
14159
|
/** True for baked sample curves that should be connected as linear samples */
|
|
12820
14160
|
isSampled?: boolean;
|
|
14161
|
+
preExtrapolation?: FBXExtrapolation;
|
|
14162
|
+
postExtrapolation?: FBXExtrapolation;
|
|
14163
|
+
}
|
|
14164
|
+
/** Raw key attribute data for one key, after run-length decoding. */
|
|
14165
|
+
export interface FBXKeyAttributes {
|
|
14166
|
+
flags: number;
|
|
14167
|
+
data: [number, number, number, number];
|
|
14168
|
+
}
|
|
14169
|
+
/**
|
|
14170
|
+
* Builds keyframes from parallel time/value arrays and their (run-length encoded) attributes, resolving every
|
|
14171
|
+
* tangent mode the FBX SDK writes: user, broken, auto (with clamp / progressive clamp / time-independent flags and
|
|
14172
|
+
* auto bias), TCB, weighted, linear and constant.
|
|
14173
|
+
*/
|
|
14174
|
+
export function buildKeyframes(times: ArrayLike<number>, values: ArrayLike<number>, attributes: (index: number) => FBXKeyAttributes): FBXKeyframe[];
|
|
14175
|
+
/** Auto tangent as the FBX SDK computes it, including clamping and auto bias. */
|
|
14176
|
+
export function solveAutoTangent(prevTime: number, time: number, nextTime: number, prevValue: number, value: number, nextValue: number, weightLeft: number, weightRight: number, autoBias: number, flags: number): number;
|
|
14177
|
+
/** Builds a keyframe list from explicit per-key slopes (legacy Takes and synthetic curves). */
|
|
14178
|
+
export function keyframesFromSlopes(times: number[], values: number[], interpolation: FBXInterpolationType[], constantNext: boolean[], leftSlope: number[], rightSlope: number[], leftWeight?: number[], rightWeight?: number[]): FBXKeyframe[];
|
|
14179
|
+
/** Reads a `Pre-Extrapolation` / `Post-Extrapolation` block: `Type` is a character code, `Repetition` a count. */
|
|
14180
|
+
export function parseExtrapolation(typeValue: unknown, repetitionValue: unknown): FBXExtrapolation;
|
|
14181
|
+
export function evaluateCurve(curve: FBXCurveData | undefined, time: number, defaultValue: number, noExtrapolation?: boolean): number;
|
|
14182
|
+
export type Vec3 = [number, number, number];
|
|
14183
|
+
export type Quat = [number, number, number, number];
|
|
14184
|
+
/** Euler angles in degrees with an FBX rotation order (0=XYZ ... 5=ZYX; spheric falls back to XYZ) to a quaternion. */
|
|
14185
|
+
export function eulerToQuat(v: Vec3, order: number): Quat;
|
|
14186
|
+
/** Quaternion to Euler angles in degrees for an FBX rotation order (inverse of eulerToQuat). */
|
|
14187
|
+
export function quatToEuler(q: Quat, order: number): Vec3;
|
|
14188
|
+
/** Blend semantics of an animation layer, derived from its BlendMode and accumulation modes. */
|
|
14189
|
+
export interface FBXLayerBlend {
|
|
14190
|
+
/** Layer participates in blending (BlendMode Additive or Override Passthrough) */
|
|
14191
|
+
blended: boolean;
|
|
14192
|
+
/** Layer adds onto the result instead of replacing it (BlendMode Additive) */
|
|
14193
|
+
additive: boolean;
|
|
14194
|
+
/** Rotations compose as quaternions (RotationAccumulationMode ByLayer) */
|
|
14195
|
+
composeRotation: boolean;
|
|
14196
|
+
/** Scales compose multiplicatively (ScaleAccumulationMode Multiply) */
|
|
14197
|
+
composeScale: boolean;
|
|
14198
|
+
/** Layer weight in [0, 1] */
|
|
14199
|
+
weight: number;
|
|
14200
|
+
}
|
|
14201
|
+
/**
|
|
14202
|
+
* Combines one animation layer's value into the running result, exactly as the FBX SDK evaluator does.
|
|
14203
|
+
* `kind` selects the accumulation rule: "R" rotations (degrees, rotation order given), "S" scales, anything else linear.
|
|
14204
|
+
*/
|
|
14205
|
+
export function combineLayerValue(result: Vec3, value: Vec3, layer: FBXLayerBlend, kind: "T" | "R" | "S" | "other", rotationOrder: number): Vec3;
|
|
14206
|
+
|
|
12821
14207
|
}
|
|
14208
|
+
declare module "babylonjs-loaders/FBX/interpreter/animation" {
|
|
14209
|
+
import { FBXDocument } from "babylonjs-loaders/FBX/types/fbxTypes";
|
|
14210
|
+
import { FBXObjectMap } from "babylonjs-loaders/FBX/interpreter/connections";
|
|
14211
|
+
import { FBXCurveData, FBXLayerBlend } from "babylonjs-loaders/FBX/interpreter/animationCurve";
|
|
14212
|
+
export { FBX_TIME_UNIT } from "babylonjs-loaders/FBX/interpreter/animationCurve";
|
|
14213
|
+
export type { FBXCurveData, FBXExtrapolation, FBXExtrapolationMode, FBXInterpolationType, FBXKeyframe, FBXLayerBlend } from "babylonjs-loaders/FBX/interpreter/animationCurve";
|
|
14214
|
+
export { combineLayerValue, evaluateCurve, eulerToQuat, quatToEuler } from "babylonjs-loaders/FBX/interpreter/animationCurve";
|
|
12822
14215
|
/** An animation curve node (T/R/S for one bone) */
|
|
12823
14216
|
export interface FBXCurveNodeData {
|
|
12824
14217
|
/** Property type: "T" (translation), "R" (rotation), "S" (scale) */
|
|
@@ -12827,13 +14220,19 @@ export interface FBXCurveNodeData {
|
|
|
12827
14220
|
targetModelId: number;
|
|
12828
14221
|
/** Curves for each axis */
|
|
12829
14222
|
curves: FBXCurveData[];
|
|
14223
|
+
/** Index of the owning layer within the stack's layer list */
|
|
14224
|
+
layerIndex: number;
|
|
14225
|
+
/** Default channel values (`d|X`, `d|Y`, `d|Z`) used for channels without a curve */
|
|
14226
|
+
defaultValues?: [number, number, number];
|
|
12830
14227
|
}
|
|
12831
|
-
/**
|
|
14228
|
+
/** Non-transform animation curve node (property animation), evaluated by the loader when a Babylon mapping exists. */
|
|
12832
14229
|
export interface FBXUnsupportedCurveNodeData {
|
|
12833
14230
|
/** Raw AnimationCurveNode property type/name */
|
|
12834
14231
|
type: string;
|
|
12835
14232
|
/** CurveNode object ID */
|
|
12836
14233
|
id: number;
|
|
14234
|
+
/** Index of the owning layer within the stack's layer list */
|
|
14235
|
+
layerIndex: number;
|
|
12837
14236
|
/** Target object ID if the curve node is connected to an object/property */
|
|
12838
14237
|
targetId: number | null;
|
|
12839
14238
|
/** OP connection property name on the target, e.g. Visibility */
|
|
@@ -12872,6 +14271,10 @@ export interface FBXAnimationLayerData {
|
|
|
12872
14271
|
normalizedWeight: number;
|
|
12873
14272
|
/** Blend mode: 0=Additive, 1=Override, 2=OverridePassthrough */
|
|
12874
14273
|
blendMode: number;
|
|
14274
|
+
/** Resolved blend semantics used by the evaluator */
|
|
14275
|
+
blend: FBXLayerBlend;
|
|
14276
|
+
/** Animated layer weight (0-100), when the Weight property carries a curve */
|
|
14277
|
+
weightCurve?: FBXCurveData;
|
|
12875
14278
|
/** Curve nodes in this layer */
|
|
12876
14279
|
curveNodes: FBXCurveNodeData[];
|
|
12877
14280
|
/** Unsupported/non-TRS curve nodes preserved for diagnostics */
|
|
@@ -12879,6 +14282,14 @@ export interface FBXAnimationLayerData {
|
|
|
12879
14282
|
/** Recoverable layer diagnostics */
|
|
12880
14283
|
diagnostics: FBXAnimationDiagnostic[];
|
|
12881
14284
|
}
|
|
14285
|
+
/** Options for animation extraction. */
|
|
14286
|
+
export interface FBXAnimationExtractOptions {
|
|
14287
|
+
/**
|
|
14288
|
+
* Shift each clip so its first key sits at time 0 (default true). False keeps the times authored in the file, so
|
|
14289
|
+
* clips of one file stay aligned with each other and with the declared stack range.
|
|
14290
|
+
*/
|
|
14291
|
+
rebaseKeyframes?: boolean;
|
|
14292
|
+
}
|
|
12882
14293
|
/** One animation clip (AnimationStack) */
|
|
12883
14294
|
export interface FBXAnimationStackData {
|
|
12884
14295
|
/** Animation name */
|
|
@@ -12901,13 +14312,7 @@ export interface FBXAnimationStackData {
|
|
|
12901
14312
|
/**
|
|
12902
14313
|
* Extract all animation stacks from the FBX scene.
|
|
12903
14314
|
*/
|
|
12904
|
-
export function extractAnimations(objectMap: FBXObjectMap): FBXAnimationStackData[];
|
|
12905
|
-
/**
|
|
12906
|
-
* Determines whether a key sequence appears to be a uniformly frame-baked sampled curve.
|
|
12907
|
-
* @param keys - Keyframes to inspect
|
|
12908
|
-
* @returns true if the keys look like sampled frame data rather than authored interpolation
|
|
12909
|
-
*/
|
|
12910
|
-
export function isFrameBakedSampledCurve(keys: readonly FBXKeyframe[]): boolean;
|
|
14315
|
+
export function extractAnimations(objectMap: FBXObjectMap, doc?: FBXDocument, options?: FBXAnimationExtractOptions): FBXAnimationStackData[];
|
|
12911
14316
|
/**
|
|
12912
14317
|
* Samples an FBX animation curve at a specific time.
|
|
12913
14318
|
* @param curveData - Curve data to sample
|
|
@@ -12915,6 +14320,54 @@ export function isFrameBakedSampledCurve(keys: readonly FBXKeyframe[]): boolean;
|
|
|
12915
14320
|
* @returns The sampled value, or null when the curve has no keys
|
|
12916
14321
|
*/
|
|
12917
14322
|
export function sampleFBXCurveAtTime(curveData: FBXCurveData | undefined, time: number): number | null;
|
|
14323
|
+
/**
|
|
14324
|
+
* Pre-7000 files store animation in a top-level `Takes` block instead of AnimationStack/Layer/CurveNode objects:
|
|
14325
|
+
*
|
|
14326
|
+
* Takes: { Take: "name" { LocalTime: start, stop
|
|
14327
|
+
* Model: "Model::joint1" { Channel: "Transform" { Channel: "T" { Channel: "X" { Default, KeyVer, KeyCount, Key } } } } } }
|
|
14328
|
+
*
|
|
14329
|
+
* Each take becomes one animation stack with a single layer. Models are matched through the same legacy string ids
|
|
14330
|
+
* that the connection resolver synthesizes for 6.x objects.
|
|
14331
|
+
*/
|
|
14332
|
+
export function extractLegacyTakes(doc: FBXDocument, objectMap: FBXObjectMap, rebaseKeyframes?: boolean): FBXAnimationStackData[];
|
|
14333
|
+
/**
|
|
14334
|
+
* Evaluates one transform channel (T, R or S) of a target at `time`, blending every animation layer of the stack the
|
|
14335
|
+
* way the FBX SDK does: the first layer animating the channel replaces the static value, later layers are combined
|
|
14336
|
+
* according to their blend mode, weight and accumulation modes.
|
|
14337
|
+
* @param curveNodes - Curve nodes targeting this model (any layers, any types)
|
|
14338
|
+
* @param layers - Stack layers, in order
|
|
14339
|
+
* @param type - Channel to evaluate
|
|
14340
|
+
* @param staticValue - Value when nothing animates the channel
|
|
14341
|
+
* @param rotationOrder - Rotation order of the target (for rotation composition)
|
|
14342
|
+
* @param time - Time in seconds
|
|
14343
|
+
*/
|
|
14344
|
+
export function evaluateLayeredChannel(curveNodes: readonly FBXCurveNodeData[], layers: readonly FBXAnimationLayerData[], type: "T" | "R" | "S", staticValue: readonly [number, number, number], rotationOrder: number, time: number): [number, number, number];
|
|
14345
|
+
/** Curves of one animated property (or blend shape weight) contributed by one animation layer. */
|
|
14346
|
+
export interface FBXLayeredPropertySource {
|
|
14347
|
+
/** Index of the owning layer within the stack's layer list */
|
|
14348
|
+
layerIndex: number;
|
|
14349
|
+
/** Curves of the property, keyed by channel name (`d|X`, `d|DeformPercent`, ...) */
|
|
14350
|
+
curves: readonly FBXCurveData[];
|
|
14351
|
+
/** Default channel values stored on the curve node */
|
|
14352
|
+
defaultValues?: Record<string, number>;
|
|
14353
|
+
}
|
|
14354
|
+
/**
|
|
14355
|
+
* Evaluates an animated property through the animation layers: the base layer replaces the static value, every
|
|
14356
|
+
* further layer blends onto the running result according to its blend mode and (possibly animated) weight, like
|
|
14357
|
+
* `evaluateLayeredChannel` does for transforms.
|
|
14358
|
+
* @param sources - Per-layer curves of the property
|
|
14359
|
+
* @param layers - Stack layers, in order
|
|
14360
|
+
* @param channels - Channel names to evaluate, in output order
|
|
14361
|
+
* @param staticValue - Value per channel when nothing animates it
|
|
14362
|
+
* @param time - Time in seconds
|
|
14363
|
+
* @returns One value per channel
|
|
14364
|
+
*/
|
|
14365
|
+
export function evaluateLayeredProperty(sources: readonly FBXLayeredPropertySource[], layers: readonly FBXAnimationLayerData[], channels: readonly string[], staticValue: readonly number[], time: number): number[];
|
|
14366
|
+
/**
|
|
14367
|
+
* True when every curve of the given channel is inside a constant (stepped) segment at `time`, so a baked key at
|
|
14368
|
+
* that time should hold its value instead of interpolating towards the next sample.
|
|
14369
|
+
*/
|
|
14370
|
+
export function isChannelSteppedAt(curveNodes: readonly FBXCurveNodeData[], type: "T" | "R" | "S", time: number): boolean;
|
|
12918
14371
|
|
|
12919
14372
|
}
|
|
12920
14373
|
declare module "babylonjs-loaders/BVH/pure" {
|
|
@@ -15904,8 +17357,9 @@ declare namespace BABYLON.GLTF2 {
|
|
|
15904
17357
|
onLoading?(): void;
|
|
15905
17358
|
/**
|
|
15906
17359
|
* Called after the loader state changes to READY.
|
|
17360
|
+
* @returns a promise when the extension has asynchronous readiness work
|
|
15907
17361
|
*/
|
|
15908
|
-
onReady?(): void
|
|
17362
|
+
onReady?(): void | Promise<void>;
|
|
15909
17363
|
/**
|
|
15910
17364
|
* Define this method to modify the default behavior when loading scenes.
|
|
15911
17365
|
* @param context The context when loading the asset
|
|
@@ -16493,7 +17947,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
16493
17947
|
private _forEachExtensions;
|
|
16494
17948
|
private _applyExtensions;
|
|
16495
17949
|
private _extensionsOnLoading;
|
|
16496
|
-
private
|
|
17950
|
+
private _extensionsOnReadyAsync;
|
|
16497
17951
|
private _extensionsLoadSceneAsync;
|
|
16498
17952
|
private _extensionsLoadNodeAsync;
|
|
16499
17953
|
private _extensionsLoadCameraAsync;
|
|
@@ -17136,9 +18590,10 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
17136
18590
|
/**
|
|
17137
18591
|
* get a path-to-object converter for the given glTF tree
|
|
17138
18592
|
* @param gltf the glTF tree to use
|
|
18593
|
+
* @param configure optional callback for adding asset-local accessors to this converter
|
|
17139
18594
|
* @returns a path-to-object converter for the given glTF tree
|
|
17140
18595
|
*/
|
|
17141
|
-
export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
18596
|
+
export function GetPathToObjectConverter(gltf: BABYLON.GLTF2.Loader.IGLTF, configure?: (mapping: object) => void): BABYLON.GLTF2.Loader.Extensions.GLTFPathToObjectConverter<unknown, unknown, unknown>;
|
|
17142
18597
|
/**
|
|
17143
18598
|
* This function will return the object accessor for the given key in the object model
|
|
17144
18599
|
* If the key is not found, it will return undefined
|
|
@@ -17157,8 +18612,9 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
17157
18612
|
* Note that this will NOT change the typescript types. To do that you will need to change the interface itself (extending it in the module that uses it)
|
|
17158
18613
|
* @param key the key to add the object accessor at. For example /cameras/\{\}/perspective/aspectRatio
|
|
17159
18614
|
* @param accessor the object accessor to add
|
|
18615
|
+
* @param mapping object-model mapping to update; defaults to the process-wide mapping used as the template for new converters
|
|
17160
18616
|
*/
|
|
17161
|
-
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType
|
|
18617
|
+
export function AddObjectAccessorToKey<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any>(key: string, accessor: IObjectAccessor<GLTFTargetType, BabylonTargetType, BabylonValueType>, mapping?: object): void;
|
|
17162
18618
|
|
|
17163
18619
|
|
|
17164
18620
|
|
|
@@ -18114,6 +19570,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
18114
19570
|
* The name of this extension.
|
|
18115
19571
|
*/
|
|
18116
19572
|
readonly name = "KHR_node_selectability";
|
|
19573
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
19574
|
+
readonly order = 100;
|
|
18117
19575
|
/**
|
|
18118
19576
|
* Defines whether this extension is enabled.
|
|
18119
19577
|
*/
|
|
@@ -18181,6 +19639,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
18181
19639
|
* The name of this extension.
|
|
18182
19640
|
*/
|
|
18183
19641
|
readonly name = "KHR_node_hoverability";
|
|
19642
|
+
/** Applies node state before KHR_interactivity graphs start. */
|
|
19643
|
+
readonly order = 100;
|
|
18184
19644
|
/**
|
|
18185
19645
|
* Defines whether this extension is enabled.
|
|
18186
19646
|
*/
|
|
@@ -19721,12 +21181,74 @@ declare namespace BABYLON {
|
|
|
19721
21181
|
/**
|
|
19722
21182
|
* Defines options for the KHR_interactivity extension.
|
|
19723
21183
|
*/
|
|
19724
|
-
["KHR_interactivity"]: {
|
|
21184
|
+
["KHR_interactivity"]: {
|
|
21185
|
+
/**
|
|
21186
|
+
* Whether the selected default graph starts automatically after import.
|
|
21187
|
+
* Defaults to true.
|
|
21188
|
+
*/
|
|
21189
|
+
autoStart?: boolean;
|
|
21190
|
+
/**
|
|
21191
|
+
* Whether to retain only the canonical source model and executable
|
|
21192
|
+
* FlowGraph serialization without constructing runtime graphs.
|
|
21193
|
+
* Defaults to false.
|
|
21194
|
+
*/
|
|
21195
|
+
parseOnly?: boolean;
|
|
21196
|
+
/**
|
|
21197
|
+
* Whether to enforce the ratified graph validation rules.
|
|
21198
|
+
* Defaults to true. Set to false only for pre-ratification assets.
|
|
21199
|
+
*/
|
|
21200
|
+
strictValidation?: boolean;
|
|
21201
|
+
};
|
|
19725
21202
|
}
|
|
19726
21203
|
|
|
19727
21204
|
}
|
|
19728
21205
|
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
19729
21206
|
/**
|
|
21207
|
+
* Runtime projection of one canonical KHR_interactivity graph.
|
|
21208
|
+
*/
|
|
21209
|
+
export interface IKHRInteractivityGraphImportResult {
|
|
21210
|
+
/** Canonical source graph and diagnostics. */
|
|
21211
|
+
graph: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityGraphModel;
|
|
21212
|
+
/** Executable FlowGraph serialization when lowering succeeded. */
|
|
21213
|
+
serializedFlowGraph?: ISerializedFlowGraph;
|
|
21214
|
+
/** Runtime FlowGraph when runtime construction was requested. */
|
|
21215
|
+
flowGraph?: FlowGraph;
|
|
21216
|
+
/** Coordinator that owns the runtime FlowGraph. */
|
|
21217
|
+
coordinator?: FlowGraphCoordinator;
|
|
21218
|
+
/** Additional lowering/runtime diagnostics. */
|
|
21219
|
+
diagnostics: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDiagnostic[];
|
|
21220
|
+
}
|
|
21221
|
+
/**
|
|
21222
|
+
* Completed KHR_interactivity import result associated with a loaded scene.
|
|
21223
|
+
*/
|
|
21224
|
+
export interface IKHRInteractivityImportResult {
|
|
21225
|
+
/** Stable zero-based identity of this interactivity asset among assets appended to the scene. */
|
|
21226
|
+
assetIndex: number;
|
|
21227
|
+
/** Canonical, lossless source document. */
|
|
21228
|
+
document: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDocument;
|
|
21229
|
+
/** Graph import results in source order. */
|
|
21230
|
+
graphs: IKHRInteractivityGraphImportResult[];
|
|
21231
|
+
/** Shared path converter required by pointer blocks. */
|
|
21232
|
+
pathConverter: BABYLON.GLTF2.Loader.Extensions.CompositePathToObjectConverter<IObjectAccessor>;
|
|
21233
|
+
/** Live glTF loader data used by glTF data-provider blocks. */
|
|
21234
|
+
glTF: BABYLON.GLTF2.GLTFLoader["gltf"];
|
|
21235
|
+
/** Host resolver that supplies KHR reference semantics to executable graphs. */
|
|
21236
|
+
hostResolver: BABYLON.GLTF2.Loader.Extensions.InteractivityHostResolver;
|
|
21237
|
+
}
|
|
21238
|
+
/**
|
|
21239
|
+
* Gets the completed KHR_interactivity import result for a loaded scene.
|
|
21240
|
+
* @param scene scene loaded from the glTF asset
|
|
21241
|
+
* @returns the import result, or undefined when the scene has no KHR_interactivity data
|
|
21242
|
+
*/
|
|
21243
|
+
export function GetKHRInteractivityImportResult(scene: Scene): IKHRInteractivityImportResult | undefined;
|
|
21244
|
+
/**
|
|
21245
|
+
* Gets every completed KHR_interactivity import result appended to a loaded scene.
|
|
21246
|
+
* Results remain in asset load order and each result has a stable {@link IKHRInteractivityImportResult.assetIndex}.
|
|
21247
|
+
* @param scene scene containing the loaded glTF assets
|
|
21248
|
+
* @returns the scene's import results, or an empty array when it has no KHR_interactivity data
|
|
21249
|
+
*/
|
|
21250
|
+
export function GetKHRInteractivityImportResults(scene: Scene): readonly IKHRInteractivityImportResult[];
|
|
21251
|
+
/**
|
|
19730
21252
|
* Loader extension for KHR_interactivity
|
|
19731
21253
|
*/
|
|
19732
21254
|
export class KHR_interactivity implements BABYLON.GLTF2.IGLTFLoaderExtension {
|
|
@@ -19735,6 +21257,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
19735
21257
|
* The name of this extension.
|
|
19736
21258
|
*/
|
|
19737
21259
|
readonly name = "KHR_interactivity";
|
|
21260
|
+
/** Runs after extensions that contribute interactivity operations and object state. */
|
|
21261
|
+
readonly order = 200;
|
|
19738
21262
|
/**
|
|
19739
21263
|
* Defines whether this extension is enabled.
|
|
19740
21264
|
*/
|
|
@@ -19746,6 +21270,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
19746
21270
|
* @param _loader
|
|
19747
21271
|
*/
|
|
19748
21272
|
constructor(_loader: BABYLON.GLTF2.GLTFLoader);
|
|
21273
|
+
private _initializePathConverter;
|
|
19749
21274
|
dispose(): void;
|
|
19750
21275
|
onReady(): Promise<void>;
|
|
19751
21276
|
}
|
|
@@ -19753,7 +21278,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
19753
21278
|
* @internal
|
|
19754
21279
|
* populates the object model with the interactivity extension
|
|
19755
21280
|
*/
|
|
19756
|
-
export function _AddInteractivityObjectModel(scene: Scene): void;
|
|
21281
|
+
export function _AddInteractivityObjectModel(scene: Scene, targetFps: number, mapping: object): void;
|
|
19757
21282
|
/**
|
|
19758
21283
|
* @internal
|
|
19759
21284
|
* Registers KHR_interactivity runtime dependencies without changing the extension registry.
|
|
@@ -20625,6 +22150,37 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20625
22150
|
|
|
20626
22151
|
|
|
20627
22152
|
|
|
22153
|
+
}
|
|
22154
|
+
declare namespace BABYLON {
|
|
22155
|
+
|
|
22156
|
+
|
|
22157
|
+
}
|
|
22158
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
22159
|
+
type InteractivityNodeState = "hoverable" | "selectable";
|
|
22160
|
+
/**
|
|
22161
|
+
* Initializes authored and inherited selectability or hoverability state.
|
|
22162
|
+
* @param nodes all nodes in the glTF asset
|
|
22163
|
+
* @param state state kind to initialize
|
|
22164
|
+
* @param getAuthoredState reads the extension-authored local state
|
|
22165
|
+
*/
|
|
22166
|
+
export function InitializeInteractivityNodeState(nodes: readonly BABYLON.GLTF2.Loader.INode[], state: InteractivityNodeState, getAuthoredState: (node: BABYLON.GLTF2.Loader.INode) => boolean | undefined): void;
|
|
22167
|
+
/**
|
|
22168
|
+
* Gets the locally authored runtime state for a node.
|
|
22169
|
+
* @param node glTF node
|
|
22170
|
+
* @param state state kind
|
|
22171
|
+
* @returns local state, defaulting to true
|
|
22172
|
+
*/
|
|
22173
|
+
export function GetInteractivityNodeState(node: BABYLON.GLTF2.Loader.INode, state: InteractivityNodeState): boolean;
|
|
22174
|
+
/**
|
|
22175
|
+
* Updates local state and reapplies inherited state to the affected subtree.
|
|
22176
|
+
* @param node glTF node
|
|
22177
|
+
* @param state state kind
|
|
22178
|
+
* @param value new local state
|
|
22179
|
+
*/
|
|
22180
|
+
export function SetInteractivityNodeState(node: BABYLON.GLTF2.Loader.INode, state: InteractivityNodeState, value: boolean): void;
|
|
22181
|
+
|
|
22182
|
+
|
|
22183
|
+
|
|
20628
22184
|
}
|
|
20629
22185
|
declare namespace BABYLON {
|
|
20630
22186
|
|
|
@@ -20650,9 +22206,10 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20650
22206
|
decodeEventReference(reference: string): string | undefined;
|
|
20651
22207
|
/**
|
|
20652
22208
|
* @param reference the reference to decode
|
|
22209
|
+
* @param collection optional glTF root collection the reference must address
|
|
20653
22210
|
* @returns the index the reference denotes, or `undefined` when it is not an indexed JSON Pointer
|
|
20654
22211
|
*/
|
|
20655
|
-
decodeIndexReference(reference: string): number | undefined;
|
|
22212
|
+
decodeIndexReference(reference: string, collection?: string): number | undefined;
|
|
20656
22213
|
/**
|
|
20657
22214
|
* Maps a Babylon object loaded from the glTF back to a JSON Pointer addressing it.
|
|
20658
22215
|
*
|
|
@@ -20697,13 +22254,6 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20697
22254
|
value?: any;
|
|
20698
22255
|
}[];
|
|
20699
22256
|
}
|
|
20700
|
-
export var gltfTypeToBabylonType: {
|
|
20701
|
-
[key: string]: {
|
|
20702
|
-
length: number;
|
|
20703
|
-
flowGraphType: FlowGraphTypes;
|
|
20704
|
-
elementType: "number" | "boolean" | "string";
|
|
20705
|
-
};
|
|
20706
|
-
};
|
|
20707
22257
|
/**
|
|
20708
22258
|
* Parses a KHR_interactivity graph definition (the raw glTF JSON object) into
|
|
20709
22259
|
* the serialized FlowGraph form consumed by {@link ParseFlowGraphAsync}.
|
|
@@ -20713,9 +22263,11 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20713
22263
|
* {@link serializeToFlowGraph}.
|
|
20714
22264
|
*/
|
|
20715
22265
|
export class InteractivityGraphToFlowGraphParser {
|
|
20716
|
-
private _interactivityGraph;
|
|
20717
22266
|
private _gltf;
|
|
20718
22267
|
_animationTargetFps: number;
|
|
22268
|
+
private _graphIndex;
|
|
22269
|
+
private _supportedExtensions?;
|
|
22270
|
+
private _declarationModels?;
|
|
20719
22271
|
/**
|
|
20720
22272
|
* Note - the graph should be rejected if the same type is defined twice.
|
|
20721
22273
|
* We currently don't validate that.
|
|
@@ -20733,16 +22285,22 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20733
22285
|
* the last block) is not disturbed, then concatenated into the serialized graph.
|
|
20734
22286
|
*/
|
|
20735
22287
|
private _insertedBlocks;
|
|
20736
|
-
constructor(
|
|
22288
|
+
constructor(interactivityGraph: BABYLON.GLTF2.IKHRInteractivity_Graph, _gltf: BABYLON.GLTF2.Loader.IGLTF, _animationTargetFps?: number, _graphIndex?: number, _supportedExtensions?: ReadonlySet<string> | undefined, _declarationModels?: readonly BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDeclarationModel[] | undefined);
|
|
22289
|
+
private _interactivityGraph;
|
|
22290
|
+
private get _strictValidation();
|
|
22291
|
+
private _hasDefaultFlowInput;
|
|
22292
|
+
private _getAllowedDynamicValueSockets;
|
|
22293
|
+
private _getAllowedDynamicFlowSockets;
|
|
20737
22294
|
get arrays(): {
|
|
20738
22295
|
types: {
|
|
20739
22296
|
length: number;
|
|
20740
22297
|
flowGraphType: FlowGraphTypes;
|
|
20741
|
-
elementType: "number" | "boolean" | "string";
|
|
22298
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
20742
22299
|
}[];
|
|
20743
22300
|
mappings: {
|
|
20744
22301
|
flowGraphMapping: BABYLON.GLTF2.Loader.Extensions.IGLTFToFlowGraphMapping;
|
|
20745
22302
|
fullOperationName: string;
|
|
22303
|
+
declaration: BABYLON.GLTF2.Loader.Extensions.IKHRInteractivityDeclarationModel;
|
|
20746
22304
|
}[];
|
|
20747
22305
|
staticVariables: {
|
|
20748
22306
|
type: FlowGraphTypes;
|
|
@@ -20758,12 +22316,15 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20758
22316
|
private _parseDeclarations;
|
|
20759
22317
|
private _parseVariables;
|
|
20760
22318
|
private _parseVariable;
|
|
22319
|
+
private _normalizeStaticReference;
|
|
20761
22320
|
private _parseEvents;
|
|
20762
22321
|
private _parseNodes;
|
|
20763
22322
|
private _getEmptyBlock;
|
|
22323
|
+
private _createUnsupportedExtensionBlock;
|
|
20764
22324
|
private _parseNodeConfiguration;
|
|
20765
22325
|
private _parseNodeConnections;
|
|
20766
22326
|
private _createNewSocketConnection;
|
|
22327
|
+
private _isUnsupportedExtensionBlock;
|
|
20767
22328
|
/**
|
|
20768
22329
|
* Wires an upstream data output into a downstream data input through a runtime multiply block that
|
|
20769
22330
|
* scales the value by the animation target fps. This converts a KHR animation time (seconds),
|
|
@@ -20773,6 +22334,8 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20773
22334
|
* @param context the serialized flow graph context that stores literal socket values
|
|
20774
22335
|
* @param upstreamOutput the data output socket providing the time value (in seconds)
|
|
20775
22336
|
* @param downstreamInput the data input socket that expects the time in frames
|
|
22337
|
+
* @param nodeIndex source node receiving the converted value
|
|
22338
|
+
* @param declarationIndex source declaration used by the receiving node
|
|
20776
22339
|
*/
|
|
20777
22340
|
private _connectWithSecondsToFramesConversion;
|
|
20778
22341
|
private _connectFlowGraphNodes;
|
|
@@ -20794,6 +22357,125 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20794
22357
|
|
|
20795
22358
|
|
|
20796
22359
|
|
|
22360
|
+
}
|
|
22361
|
+
declare namespace BABYLON {
|
|
22362
|
+
|
|
22363
|
+
|
|
22364
|
+
}
|
|
22365
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
22366
|
+
/**
|
|
22367
|
+
* Ratified KHR_interactivity specification baseline used by this importer.
|
|
22368
|
+
*/
|
|
22369
|
+
export const KHR_INTERACTIVITY_SPECIFICATION_COMMIT = "f798712c5685bc9223a628140fba707db8889300";
|
|
22370
|
+
/**
|
|
22371
|
+
* Runtime representation of every ratified built-in KHR_interactivity type.
|
|
22372
|
+
*/
|
|
22373
|
+
export var gltfTypeToBabylonType: {
|
|
22374
|
+
[key: string]: {
|
|
22375
|
+
length: number;
|
|
22376
|
+
flowGraphType: FlowGraphTypes;
|
|
22377
|
+
elementType: "number" | "boolean" | "string" | "any";
|
|
22378
|
+
};
|
|
22379
|
+
};
|
|
22380
|
+
/**
|
|
22381
|
+
* Classification of a KHR_interactivity declaration.
|
|
22382
|
+
*/
|
|
22383
|
+
export type KHRInteractivityDeclarationSupport = "core" | "extension" | "unsupported-extension" | "unknown-core";
|
|
22384
|
+
/**
|
|
22385
|
+
* A structured KHR_interactivity import diagnostic.
|
|
22386
|
+
*/
|
|
22387
|
+
export interface IKHRInteractivityDiagnostic {
|
|
22388
|
+
/** JSON pointer identifying the source location. */
|
|
22389
|
+
path: string;
|
|
22390
|
+
/** Human-readable diagnostic text. */
|
|
22391
|
+
message: string;
|
|
22392
|
+
/** Diagnostic severity. */
|
|
22393
|
+
severity: "error" | "warning";
|
|
22394
|
+
}
|
|
22395
|
+
/**
|
|
22396
|
+
* Canonical declaration information retained during import.
|
|
22397
|
+
*/
|
|
22398
|
+
export interface IKHRInteractivityDeclarationModel {
|
|
22399
|
+
/** Declaration index in the source graph. */
|
|
22400
|
+
index: number;
|
|
22401
|
+
/** Full operation name, including the defining extension when present. */
|
|
22402
|
+
operation: string;
|
|
22403
|
+
/** Whether Babylon can execute the declaration. */
|
|
22404
|
+
support: KHRInteractivityDeclarationSupport;
|
|
22405
|
+
/** Exact source declaration. */
|
|
22406
|
+
source: BABYLON.GLTF2.IKHRInteractivity_Declaration;
|
|
22407
|
+
}
|
|
22408
|
+
/**
|
|
22409
|
+
* Canonical graph information retained during import.
|
|
22410
|
+
*/
|
|
22411
|
+
export interface IKHRInteractivityGraphModel {
|
|
22412
|
+
/** Graph index in the root extension. */
|
|
22413
|
+
index: number;
|
|
22414
|
+
/** Stable source path. */
|
|
22415
|
+
path: string;
|
|
22416
|
+
/** Human-readable graph name. */
|
|
22417
|
+
name: string;
|
|
22418
|
+
/** Exact source graph, including extension and extras payloads. */
|
|
22419
|
+
source: BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
22420
|
+
/** Executable graph with specification defaults and fallbacks applied. */
|
|
22421
|
+
effectiveSource: BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
22422
|
+
/** Canonical declarations in source order. */
|
|
22423
|
+
declarations: IKHRInteractivityDeclarationModel[];
|
|
22424
|
+
/** Validation diagnostics for this graph. */
|
|
22425
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
22426
|
+
/** Whether this graph is valid and can be lowered to FlowGraph. */
|
|
22427
|
+
valid: boolean;
|
|
22428
|
+
}
|
|
22429
|
+
/**
|
|
22430
|
+
* Lossless canonical representation of a KHR_interactivity root extension.
|
|
22431
|
+
*/
|
|
22432
|
+
export interface IKHRInteractivityDocument {
|
|
22433
|
+
/** Ratified specification revision used for validation. */
|
|
22434
|
+
specificationCommit: string;
|
|
22435
|
+
/** Exact source extension, including unknown extensions and extras. */
|
|
22436
|
+
source: BABYLON.GLTF2.IKHRInteractivity;
|
|
22437
|
+
/** Default graph index, or -1 when the source selection is invalid. */
|
|
22438
|
+
defaultGraphIndex: number;
|
|
22439
|
+
/** Canonical graph models in source order. */
|
|
22440
|
+
graphs: IKHRInteractivityGraphModel[];
|
|
22441
|
+
/** Root-level validation diagnostics. */
|
|
22442
|
+
diagnostics: IKHRInteractivityDiagnostic[];
|
|
22443
|
+
}
|
|
22444
|
+
/**
|
|
22445
|
+
* Creates a detached JSON copy of a KHR_interactivity graph.
|
|
22446
|
+
* @param graph source graph
|
|
22447
|
+
* @returns a lossless JSON copy
|
|
22448
|
+
*/
|
|
22449
|
+
export function CloneKHRInteractivityGraph(graph: BABYLON.GLTF2.IKHRInteractivity_Graph): BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
22450
|
+
/**
|
|
22451
|
+
* Creates the executable graph view with all ratified configuration defaults and fallback rules
|
|
22452
|
+
* applied without modifying the lossless source graph.
|
|
22453
|
+
* @param graph source graph
|
|
22454
|
+
* @param declarations canonical declarations
|
|
22455
|
+
* @param assetNodeCount number of glTF nodes in the containing asset
|
|
22456
|
+
* @returns normalized executable graph
|
|
22457
|
+
*/
|
|
22458
|
+
export function CreateEffectiveKHRInteractivityGraph(graph: BABYLON.GLTF2.IKHRInteractivity_Graph, declarations: readonly IKHRInteractivityDeclarationModel[], assetNodeCount?: number): BABYLON.GLTF2.IKHRInteractivity_Graph;
|
|
22459
|
+
/**
|
|
22460
|
+
* Creates and validates a canonical copy of one KHR_interactivity graph.
|
|
22461
|
+
* @param graph source graph
|
|
22462
|
+
* @param index graph index in the root extension
|
|
22463
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
22464
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
22465
|
+
* @returns the canonical graph model
|
|
22466
|
+
*/
|
|
22467
|
+
export function CreateKHRInteractivityGraphModel(graph: BABYLON.GLTF2.IKHRInteractivity_Graph | null | undefined, index?: number, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityGraphModel;
|
|
22468
|
+
/**
|
|
22469
|
+
* Creates an immutable canonical KHR_interactivity document and validates all graph-local references.
|
|
22470
|
+
* @param extension source extension object from the glTF document
|
|
22471
|
+
* @param supportedExtensions enabled extensions that may provide executable operations
|
|
22472
|
+
* @param assetNodeCount number of nodes in the containing glTF asset
|
|
22473
|
+
* @returns the canonical document
|
|
22474
|
+
*/
|
|
22475
|
+
export function CreateKHRInteractivityDocument(extension: BABYLON.GLTF2.IKHRInteractivity, supportedExtensions?: ReadonlySet<string>, assetNodeCount?: number): IKHRInteractivityDocument;
|
|
22476
|
+
|
|
22477
|
+
|
|
22478
|
+
|
|
20797
22479
|
}
|
|
20798
22480
|
declare namespace BABYLON {
|
|
20799
22481
|
|
|
@@ -20803,6 +22485,82 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20803
22485
|
|
|
20804
22486
|
|
|
20805
22487
|
|
|
22488
|
+
}
|
|
22489
|
+
declare namespace BABYLON {
|
|
22490
|
+
|
|
22491
|
+
|
|
22492
|
+
}
|
|
22493
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
22494
|
+
/**
|
|
22495
|
+
* Socket definition retained for an unsupported extension operation.
|
|
22496
|
+
*/
|
|
22497
|
+
export interface IFlowGraphUnsupportedInteractivitySocket {
|
|
22498
|
+
/** Socket name. */
|
|
22499
|
+
name: string;
|
|
22500
|
+
/** FlowGraph runtime type name. */
|
|
22501
|
+
type?: string;
|
|
22502
|
+
/** Exact KHR_interactivity type signature. */
|
|
22503
|
+
signature?: string;
|
|
22504
|
+
}
|
|
22505
|
+
/**
|
|
22506
|
+
* Configuration for an unsupported KHR_interactivity extension operation.
|
|
22507
|
+
*/
|
|
22508
|
+
export interface IFlowGraphUnsupportedInteractivityBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
22509
|
+
/** Full extension operation name. */
|
|
22510
|
+
operation: string;
|
|
22511
|
+
/** Input value sockets declared by the extension. */
|
|
22512
|
+
inputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
22513
|
+
/** Output value sockets declared by the extension. */
|
|
22514
|
+
outputValueSockets: IFlowGraphUnsupportedInteractivitySocket[];
|
|
22515
|
+
/** Input flow sockets used by the source graph. */
|
|
22516
|
+
inputFlowSockets: string[];
|
|
22517
|
+
/** Output flow sockets used by the source graph. */
|
|
22518
|
+
outputFlowSockets: string[];
|
|
22519
|
+
}
|
|
22520
|
+
/**
|
|
22521
|
+
* Inspectable runtime no-op for an operation owned by an unsupported glTF extension.
|
|
22522
|
+
*/
|
|
22523
|
+
export class FlowGraphUnsupportedInteractivityBlock extends FlowGraphExecutionBlock {
|
|
22524
|
+
config: IFlowGraphUnsupportedInteractivityBlockConfiguration;
|
|
22525
|
+
constructor(config: IFlowGraphUnsupportedInteractivityBlockConfiguration);
|
|
22526
|
+
/** @internal */
|
|
22527
|
+
_execute(_context: FlowGraphContext, _callingSignal: FlowGraphSignalConnection): void;
|
|
22528
|
+
/** @returns the serialized class name */
|
|
22529
|
+
getClassName(): string;
|
|
22530
|
+
}
|
|
22531
|
+
|
|
22532
|
+
|
|
22533
|
+
|
|
22534
|
+
}
|
|
22535
|
+
declare namespace BABYLON {
|
|
22536
|
+
|
|
22537
|
+
|
|
22538
|
+
}
|
|
22539
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
22540
|
+
/**
|
|
22541
|
+
* Resolves a runtime object to its owning glTF node reference.
|
|
22542
|
+
* @param context active FlowGraph context
|
|
22543
|
+
* @param value runtime object, usually a picked primitive
|
|
22544
|
+
* @returns the owning node reference or the null reference
|
|
22545
|
+
*/
|
|
22546
|
+
export function GetInteractivityObjectReference(context: FlowGraphContext, value: object | undefined): string;
|
|
22547
|
+
/**
|
|
22548
|
+
* Converts a runtime object into the opaque reference used by KHR_interactivity.
|
|
22549
|
+
*/
|
|
22550
|
+
export class FlowGraphObjectReferenceBlock extends FlowGraphBlock {
|
|
22551
|
+
/** Runtime object to encode. */
|
|
22552
|
+
readonly object: FlowGraphDataConnection<object | undefined>;
|
|
22553
|
+
/** Opaque KHR_interactivity reference. */
|
|
22554
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
22555
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
22556
|
+
/** @internal */
|
|
22557
|
+
_updateOutputs(context: FlowGraphContext): void;
|
|
22558
|
+
/** @returns the serialized class name */
|
|
22559
|
+
getClassName(): string;
|
|
22560
|
+
}
|
|
22561
|
+
|
|
22562
|
+
|
|
22563
|
+
|
|
20806
22564
|
}
|
|
20807
22565
|
declare namespace BABYLON {
|
|
20808
22566
|
|
|
@@ -20816,7 +22574,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20816
22574
|
/**
|
|
20817
22575
|
* the glTF object to provide data from
|
|
20818
22576
|
*/
|
|
20819
|
-
glTF
|
|
22577
|
+
glTF?: BABYLON.GLTF2.Loader.IGLTF;
|
|
20820
22578
|
}
|
|
20821
22579
|
/**
|
|
20822
22580
|
* a glTF-based FlowGraph block that provides arrays with babylon object, based on the glTF tree
|
|
@@ -20833,7 +22591,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20833
22591
|
* Corresponds directly to the glTF nodes array
|
|
20834
22592
|
*/
|
|
20835
22593
|
readonly nodes: FlowGraphDataConnection<TransformNode[]>;
|
|
20836
|
-
constructor(config
|
|
22594
|
+
constructor(config?: IFlowGraphGLTFDataProviderBlockConfiguration);
|
|
20837
22595
|
getClassName(): string;
|
|
20838
22596
|
}
|
|
20839
22597
|
|
|
@@ -20845,20 +22603,80 @@ declare namespace BABYLON {
|
|
|
20845
22603
|
|
|
20846
22604
|
}
|
|
20847
22605
|
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
20848
|
-
interface IGLTFToFlowGraphMappingObject {
|
|
20849
|
-
/**
|
|
20850
|
-
* The name of the property in the FlowGraph block.
|
|
20851
|
-
*/
|
|
20852
|
-
name: string;
|
|
20853
22606
|
/**
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
20860
|
-
|
|
20861
|
-
|
|
22607
|
+
* Configuration for a KHR event reference output.
|
|
22608
|
+
*/
|
|
22609
|
+
export interface IFlowGraphEventReferenceBlockConfiguration extends IFlowGraphBlockConfiguration {
|
|
22610
|
+
/** Stable key shared by equivalent event operations. */
|
|
22611
|
+
eventKey?: string;
|
|
22612
|
+
}
|
|
22613
|
+
/**
|
|
22614
|
+
* Produces the opaque reference associated with a KHR event operation.
|
|
22615
|
+
*/
|
|
22616
|
+
export class FlowGraphEventReferenceBlock extends FlowGraphExecutionBlock {
|
|
22617
|
+
config: IFlowGraphEventReferenceBlockConfiguration;
|
|
22618
|
+
private readonly _assetInverse;
|
|
22619
|
+
private readonly _selectionPointValue;
|
|
22620
|
+
private readonly _selectionRayOriginValue;
|
|
22621
|
+
/** Output flow activated after event values are captured. */
|
|
22622
|
+
readonly out: FlowGraphSignalConnection;
|
|
22623
|
+
/** Runtime node associated with the event. */
|
|
22624
|
+
readonly node: FlowGraphDataConnection<object | undefined>;
|
|
22625
|
+
/** Controller index associated with the event. */
|
|
22626
|
+
readonly controllerIndexInput: FlowGraphDataConnection<number>;
|
|
22627
|
+
/** Selection point associated with the event. */
|
|
22628
|
+
readonly selectionPointInput: FlowGraphDataConnection<Vector3>;
|
|
22629
|
+
/** Selection ray origin associated with the event. */
|
|
22630
|
+
readonly selectionRayOriginInput: FlowGraphDataConnection<Vector3>;
|
|
22631
|
+
/** Opaque node reference. */
|
|
22632
|
+
readonly nodeReference: FlowGraphDataConnection<string>;
|
|
22633
|
+
/** Retained controller index. */
|
|
22634
|
+
readonly controllerIndex: FlowGraphDataConnection<number>;
|
|
22635
|
+
/** Retained selection point. */
|
|
22636
|
+
readonly selectionPoint: FlowGraphDataConnection<Vector3>;
|
|
22637
|
+
/** Retained selection ray origin. */
|
|
22638
|
+
readonly selectionRayOrigin: FlowGraphDataConnection<Vector3>;
|
|
22639
|
+
/** Opaque event reference. */
|
|
22640
|
+
readonly value: FlowGraphDataConnection<string>;
|
|
22641
|
+
constructor(config: IFlowGraphEventReferenceBlockConfiguration);
|
|
22642
|
+
/** @internal */
|
|
22643
|
+
_execute(context: FlowGraphContext): void;
|
|
22644
|
+
/** @returns the serialized class name */
|
|
22645
|
+
getClassName(): string;
|
|
22646
|
+
}
|
|
22647
|
+
|
|
22648
|
+
|
|
22649
|
+
|
|
22650
|
+
}
|
|
22651
|
+
declare namespace BABYLON {
|
|
22652
|
+
|
|
22653
|
+
|
|
22654
|
+
}
|
|
22655
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
22656
|
+
/**
|
|
22657
|
+
* Describes how one KHR_interactivity configuration or socket property maps to FlowGraph.
|
|
22658
|
+
*
|
|
22659
|
+
* The same contract is used for fixed sockets, wildcard sockets, configuration validation,
|
|
22660
|
+
* defaulting, and multi-block routing during strict graph lowering.
|
|
22661
|
+
*/
|
|
22662
|
+
export interface IGLTFToFlowGraphMappingObject {
|
|
22663
|
+
/**
|
|
22664
|
+
* The name of the property in the FlowGraph block.
|
|
22665
|
+
*/
|
|
22666
|
+
name: string;
|
|
22667
|
+
/**
|
|
22668
|
+
* Whether this socket mapping exists only for pre-ratification compatibility input.
|
|
22669
|
+
*/
|
|
22670
|
+
compatibilityOnly?: boolean;
|
|
22671
|
+
/**
|
|
22672
|
+
* The type of the property in the glTF specs.
|
|
22673
|
+
* If not provided will be inferred.
|
|
22674
|
+
*/
|
|
22675
|
+
gltfType?: string;
|
|
22676
|
+
/**
|
|
22677
|
+
* The type of the property in the FlowGraph block.
|
|
22678
|
+
* If not defined it equals the glTF type.
|
|
22679
|
+
*/
|
|
20862
22680
|
flowGraphType?: string;
|
|
20863
22681
|
/**
|
|
20864
22682
|
* A function that transforms the data from the glTF to the FlowGraph block.
|
|
@@ -20882,7 +22700,7 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20882
22700
|
* This is used if we generate more than one block for a single glTF node.
|
|
20883
22701
|
* Defaults to the first block in the mapping.
|
|
20884
22702
|
*/
|
|
20885
|
-
toBlock?: FlowGraphBlockNames;
|
|
22703
|
+
toBlock?: FlowGraphBlockNames | string;
|
|
20886
22704
|
/**
|
|
20887
22705
|
* Used in configuration values. If defined, this will be the default value, if no value is provided.
|
|
20888
22706
|
*/
|
|
@@ -20896,6 +22714,75 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20896
22714
|
* be fed by a `pointer/get` (e.g. the read-only `maxTime` animation pointer).
|
|
20897
22715
|
*/
|
|
20898
22716
|
convertConnectedTimeToFrames?: boolean;
|
|
22717
|
+
/**
|
|
22718
|
+
* KHR configuration value type used by canonical validation.
|
|
22719
|
+
*/
|
|
22720
|
+
configurationType?: "bool" | "int" | "int[]" | "string";
|
|
22721
|
+
/**
|
|
22722
|
+
* Whether this configuration entry exists only for canonical validation.
|
|
22723
|
+
*/
|
|
22724
|
+
validationOnly?: boolean;
|
|
22725
|
+
/**
|
|
22726
|
+
* Whether an operation without a complete default configuration requires this property.
|
|
22727
|
+
*/
|
|
22728
|
+
required?: boolean;
|
|
22729
|
+
/**
|
|
22730
|
+
* Graph array referenced by an integer configuration value.
|
|
22731
|
+
*/
|
|
22732
|
+
indexSource?: "types" | "variables" | "events" | "nodes" | "assetNodes";
|
|
22733
|
+
/**
|
|
22734
|
+
* Minimum number of values required for an array configuration.
|
|
22735
|
+
*/
|
|
22736
|
+
minItems?: number;
|
|
22737
|
+
/**
|
|
22738
|
+
* Whether the configured indices generate required input value sockets.
|
|
22739
|
+
*/
|
|
22740
|
+
generatesInputValueSockets?: boolean;
|
|
22741
|
+
/**
|
|
22742
|
+
* Whether integer case values generate required input value sockets.
|
|
22743
|
+
*/
|
|
22744
|
+
generatesCaseInputValueSockets?: boolean;
|
|
22745
|
+
/**
|
|
22746
|
+
* Whether this string configuration generates JSON Pointer Template sockets.
|
|
22747
|
+
*/
|
|
22748
|
+
pointerTemplate?: boolean;
|
|
22749
|
+
/**
|
|
22750
|
+
* Whether an invalid value falls back to the operation's default configuration.
|
|
22751
|
+
*/
|
|
22752
|
+
invalidUsesDefault?: boolean;
|
|
22753
|
+
/**
|
|
22754
|
+
* Allowed KHR type signatures for a type-index configuration.
|
|
22755
|
+
*/
|
|
22756
|
+
allowedSignatures?: readonly ("bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom")[];
|
|
22757
|
+
/**
|
|
22758
|
+
* Input socket whose effective type determines this output socket type.
|
|
22759
|
+
*/
|
|
22760
|
+
typeSourceInput?: string;
|
|
22761
|
+
/** Inclusive minimum for an integer configuration value. */
|
|
22762
|
+
minimum?: number;
|
|
22763
|
+
/** Inclusive maximum for an integer configuration value. */
|
|
22764
|
+
maximum?: number;
|
|
22765
|
+
/**
|
|
22766
|
+
* Whether this configuration value generates numbered input flow sockets.
|
|
22767
|
+
*/
|
|
22768
|
+
generatesInputFlowSockets?: boolean;
|
|
22769
|
+
/**
|
|
22770
|
+
* Whether this configuration array generates output flow sockets.
|
|
22771
|
+
*/
|
|
22772
|
+
generatesOutputFlowSockets?: boolean;
|
|
22773
|
+
/**
|
|
22774
|
+
* Properties in the same group fall back to their defaults together when any member is
|
|
22775
|
+
* missing or invalid.
|
|
22776
|
+
*/
|
|
22777
|
+
configurationGroup?: string;
|
|
22778
|
+
/**
|
|
22779
|
+
* Whether duplicate array values are removed from the effective configuration.
|
|
22780
|
+
*/
|
|
22781
|
+
uniqueValues?: boolean;
|
|
22782
|
+
/**
|
|
22783
|
+
* Whether a string configuration value is a `debug/log` message template.
|
|
22784
|
+
*/
|
|
22785
|
+
debugLogTemplate?: boolean;
|
|
20899
22786
|
}
|
|
20900
22787
|
/**
|
|
20901
22788
|
* Description of how a KHR_interactivity declaration (op such as
|
|
@@ -20910,6 +22797,13 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
20910
22797
|
* When adding blocks defined in this module use the KHR_interactivity prefix.
|
|
20911
22798
|
*/
|
|
20912
22799
|
blocks: (FlowGraphBlockNames | string)[];
|
|
22800
|
+
/**
|
|
22801
|
+
* Exact value socket contract for an operation supplied by another extension.
|
|
22802
|
+
*/
|
|
22803
|
+
declarationSchema?: {
|
|
22804
|
+
inputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
22805
|
+
outputValueSockets: Record<string, "bool" | "float" | "float2" | "float3" | "float4" | "float2x2" | "float3x3" | "float4x4" | "int" | "ref" | "custom">;
|
|
22806
|
+
};
|
|
20913
22807
|
/**
|
|
20914
22808
|
* The inputs of the glTF node mapped to the FlowGraph block.
|
|
20915
22809
|
*/
|
|
@@ -21018,6 +22912,12 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
21018
22912
|
}
|
|
21019
22913
|
export function getMappingForFullOperationName(fullOperationName: string): IGLTFToFlowGraphMapping | undefined;
|
|
21020
22914
|
export function getMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration, returnNoOpIfNotAvailable?: boolean): IGLTFToFlowGraphMapping | undefined;
|
|
22915
|
+
/**
|
|
22916
|
+
* Creates the typed no-op mapping required for an unsupported extension declaration.
|
|
22917
|
+
* @param declaration unsupported extension declaration
|
|
22918
|
+
* @returns a mapping that preserves the declared value sockets
|
|
22919
|
+
*/
|
|
22920
|
+
export function getNoOpMappingForDeclaration(declaration: BABYLON.GLTF2.IKHRInteractivity_Declaration): IGLTFToFlowGraphMapping;
|
|
21021
22921
|
/**
|
|
21022
22922
|
* This function will add new mapping to glTF interactivity.
|
|
21023
22923
|
* Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
|
|
@@ -21026,6 +22926,22 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
21026
22926
|
* @param mapping The mapping object. See documentation or examples below.
|
|
21027
22927
|
*/
|
|
21028
22928
|
export function addNewInteractivityFlowGraphMapping(key: string, extension: string, mapping: IGLTFToFlowGraphMapping): void;
|
|
22929
|
+
/**
|
|
22930
|
+
* Result of parsing a ratified `debug/log` message template.
|
|
22931
|
+
*/
|
|
22932
|
+
export interface IDebugLogTemplateParseResult {
|
|
22933
|
+
/** Whether all literal braces are doubled and every parameter is well formed. */
|
|
22934
|
+
valid: boolean;
|
|
22935
|
+
/** Unique parameter socket ids in first-occurrence order. */
|
|
22936
|
+
sockets: string[];
|
|
22937
|
+
}
|
|
22938
|
+
/**
|
|
22939
|
+
* Parses a ratified `debug/log` message template.
|
|
22940
|
+
* Literal braces must be doubled; non-empty text inside a single brace pair defines a socket id.
|
|
22941
|
+
* @param message message template to parse
|
|
22942
|
+
* @returns template validity and its exact dynamic socket ids
|
|
22943
|
+
*/
|
|
22944
|
+
export function ParseDebugLogTemplate(message: string): IDebugLogTemplateParseResult;
|
|
21029
22945
|
export function getAllSupportedNativeNodeTypes(): string[];
|
|
21030
22946
|
/**
|
|
21031
22947
|
*
|
|
@@ -22283,7 +24199,7 @@ declare namespace BABYLON {
|
|
|
22283
24199
|
|
|
22284
24200
|
|
|
22285
24201
|
export const COMMAND_MAGIC = 1111774037;
|
|
22286
|
-
export const PROTOCOL_VERSION =
|
|
24202
|
+
export const PROTOCOL_VERSION = 5;
|
|
22287
24203
|
export const MISSING_OFFSET = 4294967295;
|
|
22288
24204
|
export enum Command {
|
|
22289
24205
|
Scene = 1,
|
|
@@ -22295,7 +24211,9 @@ declare namespace BABYLON {
|
|
|
22295
24211
|
Mesh = 7,
|
|
22296
24212
|
Instance = 8,
|
|
22297
24213
|
Animation = 9,
|
|
22298
|
-
AnalyticPrimitive = 10
|
|
24214
|
+
AnalyticPrimitive = 10,
|
|
24215
|
+
ThinInstances = 11,
|
|
24216
|
+
MorphTarget = 12
|
|
22299
24217
|
}
|
|
22300
24218
|
export enum AnalyticPrimitiveType {
|
|
22301
24219
|
Cube = 0,
|
|
@@ -22310,19 +24228,33 @@ declare namespace BABYLON {
|
|
|
22310
24228
|
}
|
|
22311
24229
|
export enum AnimationTarget {
|
|
22312
24230
|
Node = 0,
|
|
22313
|
-
Bone = 1
|
|
24231
|
+
Bone = 1,
|
|
24232
|
+
MorphTarget = 2
|
|
22314
24233
|
}
|
|
22315
24234
|
export enum AnimationProperty {
|
|
22316
24235
|
Position = 0,
|
|
22317
24236
|
RotationQuaternion = 1,
|
|
22318
24237
|
Scaling = 2,
|
|
22319
|
-
Matrix = 3
|
|
24238
|
+
Matrix = 3,
|
|
24239
|
+
Influence = 4
|
|
22320
24240
|
}
|
|
22321
24241
|
export enum MaterialFlags {
|
|
22322
24242
|
DoubleSided = 1,
|
|
22323
24243
|
Unlit = 2,
|
|
22324
24244
|
AlphaBlend = 4
|
|
22325
24245
|
}
|
|
24246
|
+
export enum TextureOutputChannel {
|
|
24247
|
+
R = 0,
|
|
24248
|
+
G = 1,
|
|
24249
|
+
B = 2,
|
|
24250
|
+
A = 3,
|
|
24251
|
+
RGB = 4
|
|
24252
|
+
}
|
|
24253
|
+
export enum USDTextureColorSpace {
|
|
24254
|
+
Auto = 0,
|
|
24255
|
+
Raw = 1,
|
|
24256
|
+
SRGB = 2
|
|
24257
|
+
}
|
|
22326
24258
|
export enum MeshFlags {
|
|
22327
24259
|
DoubleSided = 1,
|
|
22328
24260
|
LeftHanded = 2
|
|
@@ -23382,17 +25314,20 @@ declare namespace BABYLON {
|
|
|
23382
25314
|
/** Number of times a failed file download is retried before giving up. PlayCanvas default `2`. */
|
|
23383
25315
|
maxDownloadRetries?: number;
|
|
23384
25316
|
/**
|
|
23385
|
-
* GPU memory
|
|
23386
|
-
*
|
|
23387
|
-
*
|
|
23388
|
-
*
|
|
23389
|
-
*
|
|
25317
|
+
* Initial GPU/CPU memory estimate (in megabytes) for resident splats. It is converted to a splat count
|
|
25318
|
+
* using the per-splat cost (core data plus any baked SH and rotation/scale textures), combined with
|
|
25319
|
+
* {@link maxResidentSplats} by taking the smaller limit, then raised when necessary to fit the complete
|
|
25320
|
+
* coarse layer. The work buffer has a fixed lifetime capacity; construct a new stream to use another limit.
|
|
25321
|
+
* Finite non-positive values leave this limit unset; non-finite values are rejected.
|
|
23390
25322
|
*/
|
|
23391
25323
|
memoryBudgetMb?: number;
|
|
23392
25324
|
/**
|
|
23393
|
-
*
|
|
23394
|
-
*
|
|
23395
|
-
*
|
|
25325
|
+
* Initial maximum number of splats kept resident in the fixed-size work buffer. It is raised when necessary
|
|
25326
|
+
* to fit the complete coarse layer. When unset and the complete source size is known, streams retain the complete
|
|
25327
|
+
* source. Streams that defer finer metadata use a bounded device-tiered default with coarse-derived refinement
|
|
25328
|
+
* headroom.
|
|
25329
|
+
* Finite non-positive values leave this limit unset; non-finite or unsafe positive counts are rejected.
|
|
25330
|
+
* Positive fractional counts are floored to at least one splat before applying the coarse minimum.
|
|
23396
25331
|
*/
|
|
23397
25332
|
maxResidentSplats?: number;
|
|
23398
25333
|
/**
|
|
@@ -23422,10 +25357,10 @@ declare namespace BABYLON {
|
|
|
23422
25357
|
/**
|
|
23423
25358
|
* When true, higher-order spherical-harmonics carried by the SOG files (`shN`) are GPU-decoded into baked
|
|
23424
25359
|
* packed-u32 SH textures so the streamed splats render with view-dependent lighting (matching the non-stream
|
|
23425
|
-
* `.spz`/`.sog` path) instead of flat DC-only color.
|
|
23426
|
-
*
|
|
23427
|
-
*
|
|
23428
|
-
*
|
|
25360
|
+
* `.spz`/`.sog` path) instead of flat DC-only color. Streams with complete initial metadata use the maximum
|
|
25361
|
+
* source SH degree. Streams that defer finer metadata reserve the supported degree-4 layout before it is known,
|
|
25362
|
+
* even if the files ultimately carry no `shN`; lower-degree files neutral-fill the unused bands.
|
|
25363
|
+
* Defaults to `true`; set to `false` to force flat DC-only color and avoid the SH decode cost/texture memory.
|
|
23429
25364
|
*/
|
|
23430
25365
|
decodeSh?: boolean;
|
|
23431
25366
|
/**
|
|
@@ -23470,6 +25405,7 @@ declare namespace BABYLON {
|
|
|
23470
25405
|
private _hostBudgetAllocation;
|
|
23471
25406
|
private _frustumCulling;
|
|
23472
25407
|
private readonly _frustumPlanes;
|
|
25408
|
+
private readonly _cullCameraViewProj;
|
|
23473
25409
|
private readonly _cullViewProj;
|
|
23474
25410
|
private readonly _frustumScratch;
|
|
23475
25411
|
private _workBuffer;
|
|
@@ -23483,6 +25419,7 @@ declare namespace BABYLON {
|
|
|
23483
25419
|
private _residency;
|
|
23484
25420
|
private readonly _fileCounts;
|
|
23485
25421
|
private readonly _fileMeta;
|
|
25422
|
+
private readonly _baseFileIds;
|
|
23486
25423
|
private readonly _decodedFiles;
|
|
23487
25424
|
private readonly _loadingFiles;
|
|
23488
25425
|
private readonly _decodeQueue;
|
|
@@ -23490,6 +25427,7 @@ declare namespace BABYLON {
|
|
|
23490
25427
|
private readonly _cancelledDecodes;
|
|
23491
25428
|
private _evictionEnabled;
|
|
23492
25429
|
private _residentBudget;
|
|
25430
|
+
private _minimumResidentSplats;
|
|
23493
25431
|
private _maxResidentSplats;
|
|
23494
25432
|
private _memoryBudgetMb;
|
|
23495
25433
|
private _evictionCooldownFrames;
|
|
@@ -23501,6 +25439,7 @@ declare namespace BABYLON {
|
|
|
23501
25439
|
private _environmentFiles;
|
|
23502
25440
|
private _lodObserver;
|
|
23503
25441
|
private _baseLayerReady;
|
|
25442
|
+
private _metadataReady;
|
|
23504
25443
|
private _framesSinceLodUpdate;
|
|
23505
25444
|
private readonly _lastLodCamPositions;
|
|
23506
25445
|
private _lastLodSignature;
|
|
@@ -23623,10 +25562,19 @@ declare namespace BABYLON {
|
|
|
23623
25562
|
/**
|
|
23624
25563
|
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
23625
25564
|
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
23626
|
-
* taking the smaller limit
|
|
25565
|
+
* taking the smaller positive limit and raising it to {@link minimumResidentSplats}. With neither limit set,
|
|
25566
|
+
* the complete source size is retained when known; otherwise a bounded device-tiered default is used.
|
|
25567
|
+
* The fixed capacity is capped at the device texture limit. `0` means initial capacity has not been resolved.
|
|
23627
25568
|
* @experimental
|
|
23628
25569
|
*/
|
|
23629
25570
|
get residentSplatBudget(): number;
|
|
25571
|
+
/**
|
|
25572
|
+
* Minimum fixed work-buffer capacity required for the complete coarse representation: one invisible padding
|
|
25573
|
+
* splat, the included environment, and every unique whole coarse source file. It is `0` until the required
|
|
25574
|
+
* coarse metadata has resolved. Initial residency options below this value are raised to it.
|
|
25575
|
+
* @experimental
|
|
25576
|
+
*/
|
|
25577
|
+
get minimumResidentSplats(): number;
|
|
23630
25578
|
/**
|
|
23631
25579
|
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
23632
25580
|
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
@@ -23701,14 +25649,14 @@ declare namespace BABYLON {
|
|
|
23701
25649
|
set debugLodSource(value: GaussianSplattingStreamDebugLodSource);
|
|
23702
25650
|
dispose(doNotRecurse?: boolean): void;
|
|
23703
25651
|
/**
|
|
23704
|
-
* Disposes this stream
|
|
23705
|
-
*
|
|
25652
|
+
* Disposes this stream and, when hosted, compacts the host once to reclaim its tombstoned region's reserved
|
|
25653
|
+
* rows. Used on a definitive load failure / empty result — a discrete, one-off reclaim, versus a bare
|
|
23706
25654
|
* {@link dispose} that only tombstones so tearing down several parts doesn't rebuild the atlas repeatedly.
|
|
23707
25655
|
*/
|
|
23708
25656
|
private _disposeAndReclaim;
|
|
23709
25657
|
/**
|
|
23710
25658
|
* The world matrix that actually places this stream's splats, used to map the camera into the space the
|
|
23711
|
-
* node bounds live in (for LOD distance) and to build
|
|
25659
|
+
* node bounds live in (for LOD distance) and to build camera-local frusta (for frustum culling). Standalone:
|
|
23712
25660
|
* this controller mesh carries the transform. Hosted: this controller is a hidden, unplaced node — the splats
|
|
23713
25661
|
* are placed by the reserved part's proxy (SOG up-axis basis composed with the host's placement), so LOD and
|
|
23714
25662
|
* culling MUST use the proxy's world matrix or they compute distances/frustum tests in the wrong space
|
|
@@ -23776,9 +25724,9 @@ declare namespace BABYLON {
|
|
|
23776
25724
|
*/
|
|
23777
25725
|
private _collectLodEntries;
|
|
23778
25726
|
/**
|
|
23779
|
-
* Streams the scene
|
|
23780
|
-
*
|
|
23781
|
-
*
|
|
25727
|
+
* Streams the scene. Large streams fetch only required coarse metadata before allocating and decoding the
|
|
25728
|
+
* complete coarse layer; finer metadata starts afterwards so it cannot occupy the download queue ahead of
|
|
25729
|
+
* visible geometry. Small streams and streams containing only coarse files retain an exact all-file capacity upper bound.
|
|
23782
25730
|
*/
|
|
23783
25731
|
private _streamAllAsync;
|
|
23784
25732
|
/**
|
|
@@ -23791,26 +25739,47 @@ declare namespace BABYLON {
|
|
|
23791
25739
|
*/
|
|
23792
25740
|
private _waitForCanBackupAsync;
|
|
23793
25741
|
/**
|
|
23794
|
-
* Resolves the
|
|
23795
|
-
*
|
|
23796
|
-
*
|
|
23797
|
-
*
|
|
25742
|
+
* Resolves the fixed initial work-buffer capacity. Explicit count/MB limits are combined by taking the smaller
|
|
25743
|
+
* and then raised to the complete coarse minimum. Without an explicit limit, a known complete source retains
|
|
25744
|
+
* legacy full residency. When finer metadata is deferred and the complete size is unknown, the device-tiered
|
|
25745
|
+
* memory estimate is given at least one largest-coarse-file of headroom so one replacement file can refine
|
|
25746
|
+
* while all coarse fallback files remain pinned.
|
|
25747
|
+
* @param fullCapacity exact complete source capacity, or null when unavailable
|
|
25748
|
+
* @param largestBaseFileCount largest whole coarse source file, used as modest replacement headroom
|
|
25749
|
+
* @returns the fixed initial work-buffer capacity
|
|
23798
25750
|
*/
|
|
23799
25751
|
private _resolveResidentBudget;
|
|
25752
|
+
/**
|
|
25753
|
+
* Returns the estimated combined GPU/CPU bytes occupied by one resident splat.
|
|
25754
|
+
* @returns estimated bytes per resident splat
|
|
25755
|
+
*/
|
|
25756
|
+
private _bytesPerResidentSplat;
|
|
23800
25757
|
/**
|
|
23801
25758
|
* Collects the unique set of source file indices referenced by any LOD of any leaf, sorted ascending.
|
|
23802
25759
|
* @returns sorted unique file indices
|
|
23803
25760
|
*/
|
|
23804
25761
|
private _collectAllFileIds;
|
|
25762
|
+
/**
|
|
25763
|
+
* Collects unique whole source files required by the coarsest entry of every valid leaf.
|
|
25764
|
+
* @returns sorted unique coarse file indices
|
|
25765
|
+
*/
|
|
25766
|
+
private _collectBaseFileIds;
|
|
25767
|
+
/**
|
|
25768
|
+
* Resolves the immutable minimum initial capacity from padding, environment, and unique whole coarse files.
|
|
25769
|
+
* @param baseFileIds unique coarse source file indices
|
|
25770
|
+
* @param environmentCount included environment splat count
|
|
25771
|
+
*/
|
|
25772
|
+
private _resolveMinimumResidentSplats;
|
|
23805
25773
|
/**
|
|
23806
25774
|
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
23807
25775
|
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
23808
25776
|
*/
|
|
23809
25777
|
private _resolveLod0SplatCount;
|
|
23810
25778
|
/**
|
|
23811
|
-
* Fetches the environment bundle and
|
|
23812
|
-
* each file's parsed metadata for the later on-demand decode.
|
|
25779
|
+
* Fetches the environment bundle and the supplied referenced files' metadata to learn splat counts, caching
|
|
25780
|
+
* each file's parsed metadata for the later on-demand decode. File metadata fetches run in parallel.
|
|
23813
25781
|
* @param fileIds file indices to fetch metadata for
|
|
25782
|
+
* @param includeEnvironment whether to fetch the optional environment bundle in this phase
|
|
23814
25783
|
* @returns the environment splat count (0 when there is no environment)
|
|
23815
25784
|
*/
|
|
23816
25785
|
private _gatherCountsAsync;
|
|
@@ -23878,6 +25847,7 @@ declare namespace BABYLON {
|
|
|
23878
25847
|
* Concurrent or repeat requests for the same file are ignored. If the file is cancelled mid-flight
|
|
23879
25848
|
* (because every node that wanted it retargeted), the decode bails cooperatively at the next checkpoint.
|
|
23880
25849
|
* @param fileId file index to decode
|
|
25850
|
+
* @returns whether the file was decoded and published successfully
|
|
23881
25851
|
*/
|
|
23882
25852
|
private _decodeFileAsync;
|
|
23883
25853
|
/**
|
|
@@ -24042,6 +26012,22 @@ declare namespace BABYLON {
|
|
|
24042
26012
|
* @returns whether any node's in-frustum state changed
|
|
24043
26013
|
*/
|
|
24044
26014
|
private _updateNodeFrustum;
|
|
26015
|
+
/**
|
|
26016
|
+
* Normalizes an initial residency option, preserving finite non-positive values as an unset limit.
|
|
26017
|
+
* @param value option value
|
|
26018
|
+
* @param name option name used in errors
|
|
26019
|
+
* @param integer whether the normalized value must be an integer splat count
|
|
26020
|
+
* @returns normalized value
|
|
26021
|
+
*/
|
|
26022
|
+
private static _NormalizeResidentLimit;
|
|
26023
|
+
/**
|
|
26024
|
+
* Adds trusted non-negative integer counts without allowing unsafe capacity arithmetic.
|
|
26025
|
+
* @param left first count
|
|
26026
|
+
* @param right second count
|
|
26027
|
+
* @param label capacity name used in errors
|
|
26028
|
+
* @returns the safe integer sum
|
|
26029
|
+
*/
|
|
26030
|
+
private static _SafeAddCounts;
|
|
24045
26031
|
/**
|
|
24046
26032
|
* Reads the splat count from SOG metadata, coerced to a finite non-negative integer (metadata is untrusted, so
|
|
24047
26033
|
* `count` / `shape[0]` may be a string or malformed — a non-numeric value must not leak into count arithmetic).
|
|
@@ -24964,12 +26950,83 @@ declare namespace BABYLON {
|
|
|
24964
26950
|
* Defines options for the FBX loader.
|
|
24965
26951
|
*/
|
|
24966
26952
|
export interface FBXFileLoaderOptions {
|
|
26953
|
+
/**
|
|
26954
|
+
* Bundle of defaults for the options that change what the loaded scene looks like.
|
|
26955
|
+
* - "compatible" (default): the behaviour of the loader as first shipped: StandardMaterial for every material,
|
|
26956
|
+
* one Babylon geometry per model, curve geometry skipped, constraints recorded as metadata only, clips rebased
|
|
26957
|
+
* to start at frame 0, cameras and lights placed in world space.
|
|
26958
|
+
* - "full": everything the loader can do: PBRMaterial for physically based shaders, geometry shared between
|
|
26959
|
+
* instances, curves as lines meshes, constraints solved at runtime, authored clip times, cameras and lights
|
|
26960
|
+
* parented to their nodes so they animate.
|
|
26961
|
+
* An option set explicitly always wins over the preset.
|
|
26962
|
+
*/
|
|
26963
|
+
preset?: "compatible" | "full";
|
|
24967
26964
|
/**
|
|
24968
26965
|
* Source convention for tangent-space normal maps connected through FBX normal-map slots.
|
|
24969
26966
|
* FBX does not standardize this convention, so the loader defaults to the glTF/USD-style Y-up convention.
|
|
24970
26967
|
* Set to "y-down" for assets authored with inverted green/Y normal maps.
|
|
24971
26968
|
*/
|
|
24972
26969
|
normalMapCoordinateSystem?: FBXNormalMapCoordinateSystem;
|
|
26970
|
+
/**
|
|
26971
|
+
* Which Babylon material to build.
|
|
26972
|
+
* - "standard" (default, "full" preset: "auto"): always StandardMaterial (PBR parameters are approximated).
|
|
26973
|
+
* - "auto": PBRMaterial for physically based FBX materials (Standard Surface, Arnold, 3ds Max Physical,
|
|
26974
|
+
* 3ds Max PBR, glTF, OpenPBR, Stingray PBS) and StandardMaterial for classic Lambert/Phong materials.
|
|
26975
|
+
* - "pbr": always PBRMaterial (Lambert/Phong parameters are converted).
|
|
26976
|
+
*/
|
|
26977
|
+
materials?: "auto" | "standard" | "pbr";
|
|
26978
|
+
/**
|
|
26979
|
+
* Unit conversion applied at the root of the loaded hierarchy.
|
|
26980
|
+
* - "preserve" (default): keep the file's units (1 Babylon unit = 1 FBX unit).
|
|
26981
|
+
* - "meters": scale so that 1 Babylon unit is 1 meter, using the file's UnitScaleFactor.
|
|
26982
|
+
* - a number: centimeters per Babylon unit (100 = meters, 1 = centimeters, 2.54 = inches).
|
|
26983
|
+
*/
|
|
26984
|
+
unitScale?: "preserve" | "meters" | number;
|
|
26985
|
+
/**
|
|
26986
|
+
* Share vertex data between models that reference the same FBX geometry (default false, "full" preset: true).
|
|
26987
|
+
* Skinned meshes are never shared.
|
|
26988
|
+
*/
|
|
26989
|
+
shareGeometry?: boolean;
|
|
26990
|
+
/**
|
|
26991
|
+
* Called for every recoverable issue found while loading (unsupported features, malformed data that was
|
|
26992
|
+
* skipped, approximations). The same list is stored on the root node's metadata as `fbxDiagnostics`.
|
|
26993
|
+
*/
|
|
26994
|
+
onWarning?: (warning: FBXLoaderWarning) => void;
|
|
26995
|
+
/**
|
|
26996
|
+
* Segments per knot span when tessellating NURBS surfaces. Zero or undefined uses the subdivision stored in
|
|
26997
|
+
* the file (usually 4), capped at 16.
|
|
26998
|
+
*/
|
|
26999
|
+
nurbsSubdivision?: number;
|
|
27000
|
+
/** How curve geometry (Line, NurbsCurve) is imported: skipped (default) or as lines meshes ("full" preset). */
|
|
27001
|
+
curves?: "lines" | "skip";
|
|
27002
|
+
/**
|
|
27003
|
+
* Constraints (aim, parent, position, rotation, scale): "metadata" (default) only records them on the nodes,
|
|
27004
|
+
* "apply" ("full" preset) attaches an `FBXConstraintBehavior` to each constrained node so it is solved before
|
|
27005
|
+
* every render. IK chains are always metadata only.
|
|
27006
|
+
*/
|
|
27007
|
+
constraints?: "apply" | "metadata";
|
|
27008
|
+
/**
|
|
27009
|
+
* Shift every clip so its first keyframe sits at frame 0 (default true). With false ("full" preset) keys keep
|
|
27010
|
+
* the times authored in the file, so clips of one file stay aligned with each other and with their declared
|
|
27011
|
+
* ranges.
|
|
27012
|
+
*/
|
|
27013
|
+
rebaseAnimations?: boolean;
|
|
27014
|
+
/**
|
|
27015
|
+
* Parent cameras and lights to their FBX node so they follow its animation (default false, "full" preset:
|
|
27016
|
+
* true). Otherwise they are created at the node's world position and orientation, unparented.
|
|
27017
|
+
*/
|
|
27018
|
+
attachCamerasAndLights?: boolean;
|
|
27019
|
+
}
|
|
27020
|
+
/** A recoverable issue reported while loading an FBX file. */
|
|
27021
|
+
export interface FBXLoaderWarning {
|
|
27022
|
+
/** Which part of the loader reported the issue */
|
|
27023
|
+
source: "scene" | "model" | "geometry" | "skin" | "rig" | "animation" | "blendShape" | "camera" | "light";
|
|
27024
|
+
/** Human readable description */
|
|
27025
|
+
message: string;
|
|
27026
|
+
/** Name of the affected object, when known */
|
|
27027
|
+
objectName?: string;
|
|
27028
|
+
/** Structured details from the interpreter, when any */
|
|
27029
|
+
details?: unknown;
|
|
24973
27030
|
}
|
|
24974
27031
|
/**
|
|
24975
27032
|
* FBX file loader plugin for Babylon.js.
|
|
@@ -24992,6 +27049,22 @@ declare namespace BABYLON {
|
|
|
24992
27049
|
private readonly _bindRestBones;
|
|
24993
27050
|
private readonly _sourceBonesBySkeleton;
|
|
24994
27051
|
private readonly _scaleCompensationHelpersBySkeleton;
|
|
27052
|
+
/** Frame rate of the file being loaded (GlobalSettings TimeMode); animation is baked at this rate. */
|
|
27053
|
+
private _frameRate;
|
|
27054
|
+
/** Layers of the animation stack currently being converted; used by the transform samplers. */
|
|
27055
|
+
private _activeLayers;
|
|
27056
|
+
/** Parent model per model id, for inherit-mode aware sampling. */
|
|
27057
|
+
private _parentModelById;
|
|
27058
|
+
/** Curve nodes per model id for the stack currently being converted. */
|
|
27059
|
+
private _curveNodesByModelId;
|
|
27060
|
+
/** Helper nodes inserted above models whose InheritType is not RSrs. */
|
|
27061
|
+
private _inheritScaleHelpers;
|
|
27062
|
+
/** First mesh built per (geometry, geometric transform), for geometry sharing between instances. */
|
|
27063
|
+
private _meshByGeometryKey;
|
|
27064
|
+
/** Instance mesh -> source mesh whose geometry it shares. */
|
|
27065
|
+
private _instanceSource;
|
|
27066
|
+
/** Property curve nodes that were mapped onto Babylon animations; their "not evaluated" diagnostics are dropped. */
|
|
27067
|
+
private _evaluatedCurveNodeIds;
|
|
24995
27068
|
/**
|
|
24996
27069
|
* Creates a new FBX loader.
|
|
24997
27070
|
* @param options - Options controlling FBX loading behavior
|
|
@@ -25034,6 +27107,11 @@ declare namespace BABYLON {
|
|
|
25034
27107
|
* @returns A promise containing the loaded asset container
|
|
25035
27108
|
*/
|
|
25036
27109
|
loadAssetContainerAsync(scene: Scene, data: unknown, rootUrl: string, _onProgress?: (event: ISceneLoaderProgressEvent) => void, _fileName?: string): Promise<AssetContainer>;
|
|
27110
|
+
/**
|
|
27111
|
+
* Parses and interprets the file. Parsing is synchronous, so no progress events are emitted: the scene loader's
|
|
27112
|
+
* progress callback reports download bytes and must not be fed synthetic counts.
|
|
27113
|
+
*/
|
|
27114
|
+
private _parseAndInterpret;
|
|
25037
27115
|
private _parse;
|
|
25038
27116
|
private _parseFromArrayBuffer;
|
|
25039
27117
|
private _buildScene;
|
|
@@ -25045,6 +27123,15 @@ declare namespace BABYLON {
|
|
|
25045
27123
|
private _linkSkeletonsToTransformNodes;
|
|
25046
27124
|
private static _modelSubtreeMatchesNameFilter;
|
|
25047
27125
|
private static _applyModelMetadata;
|
|
27126
|
+
/**
|
|
27127
|
+
* Wires a LodGroup's children as Babylon LOD levels: the first child holds the highest detail; every further
|
|
27128
|
+
* child replaces it beyond the group's threshold distance (or screen coverage when thresholds are percentages).
|
|
27129
|
+
* Each child's display mode is honoured first: level 1 (show) stays visible outside the LOD chain, level 2
|
|
27130
|
+
* (hide) is disabled, and only level 0 (use LOD) children take part in the distance switching.
|
|
27131
|
+
*/
|
|
27132
|
+
private static _applyLodGroup;
|
|
27133
|
+
/** Builds a lines mesh from Line or tessellated NurbsCurve geometry, applying the model's geometric transform. */
|
|
27134
|
+
private _createLinesMesh;
|
|
25048
27135
|
private _createMesh;
|
|
25049
27136
|
/**
|
|
25050
27137
|
* Apply multi-material to a mesh by creating sub-meshes grouped by material index.
|
|
@@ -25068,6 +27155,11 @@ declare namespace BABYLON {
|
|
|
25068
27155
|
*/
|
|
25069
27156
|
private _buildSkinningData;
|
|
25070
27157
|
private _createMaterial;
|
|
27158
|
+
private _createPbrMaterial;
|
|
27159
|
+
/** Alpha of a classic Lambert/Phong material: Opacity when present, otherwise 1 - TransparentColor * TransparencyFactor. */
|
|
27160
|
+
private static _alphaFromClassicTransparency;
|
|
27161
|
+
private static _applyTextureSettings;
|
|
27162
|
+
private _createStandardMaterial;
|
|
25071
27163
|
private _configureNormalTexture;
|
|
25072
27164
|
private _getNormalMapTangentHandednessScale;
|
|
25073
27165
|
private static _isSupportedMaterialTextureSlot;
|
|
@@ -25091,11 +27183,27 @@ declare namespace BABYLON {
|
|
|
25091
27183
|
private _createCamera;
|
|
25092
27184
|
private _createLight;
|
|
25093
27185
|
private _createSkeleton;
|
|
27186
|
+
private _rigBoneModelIds;
|
|
27187
|
+
private _isRigBone;
|
|
25094
27188
|
private _getSourceBone;
|
|
25095
27189
|
private _getScaleCompensationHelper;
|
|
25096
27190
|
private static _computeFBXAbsoluteMatrices;
|
|
27191
|
+
/**
|
|
27192
|
+
* Effective ("inherit") scale of every bone, following the FBX SDK: the local scale for RSrs bones, and for
|
|
27193
|
+
* RrSs / Rrs bones the local scale multiplied by the scale of the bone's inherit-scale node (the parent for RrSs,
|
|
27194
|
+
* the parent's inherit-scale node for Rrs). Bones are ordered parents first.
|
|
27195
|
+
*/
|
|
27196
|
+
private static _computeBoneInheritScales;
|
|
27197
|
+
private static _getBoneInheritScaleNode;
|
|
27198
|
+
/** Scale a bone inherits into its own scale (RrSs chains), or unit scale. */
|
|
27199
|
+
private static _getBoneInheritedScale;
|
|
25097
27200
|
private static _computeFBXRuntimeLocalMatrix;
|
|
25098
27201
|
private static _applyParentScaleCompensation;
|
|
27202
|
+
/**
|
|
27203
|
+
* Splits a bone's FBX local matrix into a helper (which cancels the parent scale and carries the translation,
|
|
27204
|
+
* so the translation still follows the parent scale as the SDK does) and the bone's own rotation/scale. For RrSs
|
|
27205
|
+
* bones the inherited scale is folded into the bone scale.
|
|
27206
|
+
*/
|
|
25099
27207
|
private static _splitParentScaleCompensatedLocalMatrix;
|
|
25100
27208
|
private static _safeInverseScale;
|
|
25101
27209
|
private static _getInverseScaleVector;
|
|
@@ -25112,13 +27220,8 @@ declare namespace BABYLON {
|
|
|
25112
27220
|
* In row-vector convention: v' = v * M
|
|
25113
27221
|
*/
|
|
25114
27222
|
private static _computeFBXLocalMatrix;
|
|
25115
|
-
|
|
25116
|
-
* Apply the FBX transform chain to a Babylon TransformNode or Mesh.
|
|
25117
|
-
* Decomposes the full local matrix into position/rotation/scale.
|
|
25118
|
-
*/
|
|
25119
|
-
private static _applyFBXTransform;
|
|
27223
|
+
private _applyRestTRS;
|
|
25120
27224
|
private static _computeFBXModelLocalMatrix;
|
|
25121
|
-
private static _getBoneReferenceWorldMatrix;
|
|
25122
27225
|
private static _applyMatrixToTransform;
|
|
25123
27226
|
private _createAnimationGroup;
|
|
25124
27227
|
private _buildInheritedRigBoneAnimations;
|
|
@@ -25128,9 +27231,61 @@ declare namespace BABYLON {
|
|
|
25128
27231
|
* Computes the full FBX transform matrix at each keyframe and decomposes into TRS.
|
|
25129
27232
|
*/
|
|
25130
27233
|
private _buildNodeAnimations;
|
|
27234
|
+
/**
|
|
27235
|
+
* Baked keys are interpolated linearly by Babylon. Between two frames an FBX cubic segment can deviate from that
|
|
27236
|
+
* line, so sample times are refined (midpoints inserted, up to two levels) wherever the interpolated transform
|
|
27237
|
+
* differs noticeably from the curve. Flat and linear segments stay at frame resolution.
|
|
27238
|
+
*/
|
|
27239
|
+
private static _refineSampleTimes;
|
|
27240
|
+
/**
|
|
27241
|
+
* Keys of a scalar property animated by one or more layers: the authored keys when a single layer drives it,
|
|
27242
|
+
* otherwise the frame grid evaluated through the layer stack.
|
|
27243
|
+
* @param sources - Per-layer curves of the property (each with at least one curve)
|
|
27244
|
+
* @param animStack - Stack being converted
|
|
27245
|
+
* @param mapValue - Conversion from the FBX value to the Babylon property value
|
|
27246
|
+
* @returns Animation keys
|
|
27247
|
+
*/
|
|
27248
|
+
private _layeredScalarKeys;
|
|
27249
|
+
/**
|
|
27250
|
+
* Maps an animated FBX property (anything other than node transforms and blend shape weights) onto the Babylon
|
|
27251
|
+
* property that carries it: mesh visibility, camera field of view and clip planes, light intensity, colour and
|
|
27252
|
+
* cone angles, and material colours, alpha, roughness and metalness. `group` holds the curve nodes of every
|
|
27253
|
+
* layer animating that property, in layer order; several layers are evaluated through the layer stack.
|
|
27254
|
+
*/
|
|
27255
|
+
private _buildPropertyAnimations;
|
|
27256
|
+
/** Records constraints on their nodes and, unless disabled, attaches the runtime behavior that solves them. */
|
|
27257
|
+
private _applyConstraints;
|
|
27258
|
+
/** Collects every recoverable issue the interpreter recorded, stores it on the root node and notifies the caller. */
|
|
27259
|
+
private _reportDiagnostics;
|
|
27260
|
+
/** Curve nodes affecting the inherit scale of a model: its own scale curves and those of its inherit-scale chain. */
|
|
27261
|
+
private _collectInheritScaleCurves;
|
|
25131
27262
|
private _isVector3KeysConstant;
|
|
27263
|
+
/** Samples the animated Lcl Translation / Rotation / Scaling of a model, blending all layers of the active stack. */
|
|
27264
|
+
private _sampleModelTRS;
|
|
27265
|
+
/**
|
|
27266
|
+
* Local position/rotation/scale of a model from FBX Lcl values. Without pivots and offsets the components map
|
|
27267
|
+
* directly (rotation = pre * lcl * post⁻¹), which keeps zero and negative scales exact. With pivots the full
|
|
27268
|
+
* matrix is built and decomposed.
|
|
27269
|
+
*/
|
|
27270
|
+
private static _computeLocalTRS;
|
|
27271
|
+
/** Applies inherit-mode adjustments to a local TRS (see _computeInheritAwareLocalMatrix). */
|
|
27272
|
+
private _adjustTRSForInheritMode;
|
|
25132
27273
|
private _sampleModelLocalMatrix;
|
|
25133
27274
|
private _sampleModelScale;
|
|
27275
|
+
/**
|
|
27276
|
+
* Effective scale of a model for inherit-mode math (`inherit_scale` in ufbx terms): its own local scale, multiplied
|
|
27277
|
+
* componentwise by the inherited scale when the model uses RrSs inheritance. `time` samples animation; undefined
|
|
27278
|
+
* uses the rest pose.
|
|
27279
|
+
*/
|
|
27280
|
+
private _getInheritScale;
|
|
27281
|
+
/** RrSs nodes inherit scale from their parent; Rrs nodes skip their immediate parent (chaining through Rrs parents). */
|
|
27282
|
+
private _getInheritScaleNode;
|
|
27283
|
+
/**
|
|
27284
|
+
* Local matrix of a model relative to its Babylon parent frame, accounting for inherit modes. For RSrs (the
|
|
27285
|
+
* default) this is the FBX local matrix. For RrSs / Rrs the node sits under a helper that removes the parent's
|
|
27286
|
+
* scale, so translation is pre-scaled by the parent scale and (for RrSs) scale accumulates componentwise.
|
|
27287
|
+
*/
|
|
27288
|
+
private _computeInheritAwareLocalMatrix;
|
|
25134
27289
|
/**
|
|
25135
27290
|
* Build matrix-baked bone animation from full FBX local transforms.
|
|
25136
27291
|
* The bind matrix carries the skinning offset, so animation curves drive
|
|
@@ -25165,6 +27320,189 @@ declare namespace BABYLON {
|
|
|
25165
27320
|
*/
|
|
25166
27321
|
|
|
25167
27322
|
|
|
27323
|
+
/**
|
|
27324
|
+
* Runtime evaluation of FBX constraints. An `FBXConstraintBehavior` is attached to each constrained node; all
|
|
27325
|
+
* behaviors of a scene register with one `FBXConstraintSolver`, which solves them in dependency order (a constraint
|
|
27326
|
+
* whose target or parent is driven by another constraint is solved after it) and reuses scratch objects, so solving
|
|
27327
|
+
* allocates nothing per frame.
|
|
27328
|
+
*
|
|
27329
|
+
* The solver brackets the scene's animation phase: before animations run it writes each node's unconstrained
|
|
27330
|
+
* transform back, after they ran it captures the result as the new unconstrained transform and solves. A partial
|
|
27331
|
+
* weight therefore always blends from what animation (or nothing) produced this frame, never from the previous
|
|
27332
|
+
* solve's output, so a 50% weight stays a 50% blend instead of converging on the target.
|
|
27333
|
+
*
|
|
27334
|
+
* All maths happen in FBX space, i.e. relative to the loader's root node, so the handedness conversion applied
|
|
27335
|
+
* at the root never enters the solve.
|
|
27336
|
+
*/
|
|
27337
|
+
/** Resolved target of a constraint. */
|
|
27338
|
+
export interface FBXConstraintBehaviorTarget {
|
|
27339
|
+
/** Target node */
|
|
27340
|
+
node: TransformNode;
|
|
27341
|
+
/** Normalized target weight (0..1) */
|
|
27342
|
+
weight: number;
|
|
27343
|
+
/** Offset matrix for parent constraints (in the target's space) */
|
|
27344
|
+
offset: Matrix;
|
|
27345
|
+
}
|
|
27346
|
+
/** Options resolved by the loader when creating the behavior. */
|
|
27347
|
+
export interface FBXConstraintBehaviorOptions {
|
|
27348
|
+
/** Root of the loaded asset; world matrices are made relative to it */
|
|
27349
|
+
root: TransformNode;
|
|
27350
|
+
/** Resolved targets of the constraint, in file order */
|
|
27351
|
+
targets: FBXConstraintBehaviorTarget[];
|
|
27352
|
+
/** World up object of an aim constraint, when it has one */
|
|
27353
|
+
upNode: Nullable<TransformNode>;
|
|
27354
|
+
/** Scene up axis in FBX space */
|
|
27355
|
+
sceneUp: Vector3;
|
|
27356
|
+
}
|
|
27357
|
+
/**
|
|
27358
|
+
* Solves every FBX constraint of a scene once per frame, in dependency order, from the scene's animation phase
|
|
27359
|
+
* observers (`beginFrame` before animations, `solve` after them). Created on demand by the first
|
|
27360
|
+
* `FBXConstraintBehavior` attached in the scene and removed with the last one.
|
|
27361
|
+
*/
|
|
27362
|
+
export class FBXConstraintSolver {
|
|
27363
|
+
private readonly _scene;
|
|
27364
|
+
private readonly _behaviors;
|
|
27365
|
+
private _ordered;
|
|
27366
|
+
private _cyclic;
|
|
27367
|
+
private _dirty;
|
|
27368
|
+
private _beforeAnimations;
|
|
27369
|
+
private _afterAnimations;
|
|
27370
|
+
private constructor();
|
|
27371
|
+
/**
|
|
27372
|
+
* Solver of a scene, if any constraint behavior is attached in it.
|
|
27373
|
+
* @param scene - Scene to look up
|
|
27374
|
+
* @returns The solver, or undefined
|
|
27375
|
+
*/
|
|
27376
|
+
static Get(scene: Scene): FBXConstraintSolver | undefined;
|
|
27377
|
+
/**
|
|
27378
|
+
* Solver of a scene, created when missing.
|
|
27379
|
+
* @param scene - Scene to look up
|
|
27380
|
+
* @returns The solver
|
|
27381
|
+
*/
|
|
27382
|
+
static GetOrCreate(scene: Scene): FBXConstraintSolver;
|
|
27383
|
+
/** Registered behaviors in solve order (a target's constraint before the constraints that read it). */
|
|
27384
|
+
get constraints(): readonly FBXConstraintBehavior[];
|
|
27385
|
+
/**
|
|
27386
|
+
* Behaviors that take part in a dependency cycle (A targets B while B targets A). They are solved after all
|
|
27387
|
+
* acyclic constraints, in registration order, so each sees the other's result from the previous solve.
|
|
27388
|
+
*/
|
|
27389
|
+
get cyclicConstraints(): readonly FBXConstraintBehavior[];
|
|
27390
|
+
/**
|
|
27391
|
+
* Adds a behavior to the solve set.
|
|
27392
|
+
* @param behavior - Behavior to add
|
|
27393
|
+
*/
|
|
27394
|
+
register(behavior: FBXConstraintBehavior): void;
|
|
27395
|
+
/**
|
|
27396
|
+
* Removes a behavior from the solve set; the solver disposes itself with the last one.
|
|
27397
|
+
* @param behavior - Behavior to remove
|
|
27398
|
+
*/
|
|
27399
|
+
unregister(behavior: FBXConstraintBehavior): void;
|
|
27400
|
+
/** Marks the solve order stale, e.g. after re-parenting a constrained node. */
|
|
27401
|
+
invalidateOrder(): void;
|
|
27402
|
+
/**
|
|
27403
|
+
* Start of a frame, before animations run: every constrained node gets its unconstrained transform back, so
|
|
27404
|
+
* that animation either overwrites it or leaves it untouched.
|
|
27405
|
+
*/
|
|
27406
|
+
beginFrame(): void;
|
|
27407
|
+
/**
|
|
27408
|
+
* End of the animation phase: takes every constrained node's current transform as its unconstrained value,
|
|
27409
|
+
* then solves every registered constraint once, in dependency order.
|
|
27410
|
+
*/
|
|
27411
|
+
solve(): void;
|
|
27412
|
+
private _ensureOrder;
|
|
27413
|
+
private static _IsAncestorOrSelf;
|
|
27414
|
+
}
|
|
27415
|
+
/** Babylon behavior evaluating an FBX aim, parent, position, rotation or scale constraint. */
|
|
27416
|
+
export class FBXConstraintBehavior implements Behavior<TransformNode> {
|
|
27417
|
+
/** Constraint data extracted from the file */
|
|
27418
|
+
readonly constraint: FBXConstraintData;
|
|
27419
|
+
private readonly _options;
|
|
27420
|
+
/** Behavior name (`fbxConstraint:` followed by the constraint name) */
|
|
27421
|
+
readonly name: string;
|
|
27422
|
+
/** Node the behavior is attached to */
|
|
27423
|
+
attachedNode: Nullable<TransformNode>;
|
|
27424
|
+
/** Set to false to pause the constraint without detaching it */
|
|
27425
|
+
enabled: boolean;
|
|
27426
|
+
private readonly _offsetTranslation;
|
|
27427
|
+
private readonly _offsetRotation;
|
|
27428
|
+
private readonly _offsetScale;
|
|
27429
|
+
private readonly _localBasisTransposed;
|
|
27430
|
+
/** Unconstrained transform of the current frame (what animation produced), blended towards the constraint's result. */
|
|
27431
|
+
private readonly _base;
|
|
27432
|
+
private _hasBase;
|
|
27433
|
+
/**
|
|
27434
|
+
* Creates the behavior.
|
|
27435
|
+
* @param constraint - Constraint data extracted from the file
|
|
27436
|
+
* @param _options - Resolved targets and scene information
|
|
27437
|
+
*/
|
|
27438
|
+
constructor(
|
|
27439
|
+
/** Constraint data extracted from the file */
|
|
27440
|
+
constraint: FBXConstraintData, _options: FBXConstraintBehaviorOptions);
|
|
27441
|
+
/** Nothing to initialize */
|
|
27442
|
+
init(): void;
|
|
27443
|
+
/**
|
|
27444
|
+
* Registers the behavior with the scene's solver, takes the node's current transform as the unconstrained
|
|
27445
|
+
* value and solves the constraint once.
|
|
27446
|
+
* @param target - Node to constrain
|
|
27447
|
+
*/
|
|
27448
|
+
attach(target: TransformNode): void;
|
|
27449
|
+
/** Unregisters the behavior; the node keeps its last solved transform. */
|
|
27450
|
+
detach(): void;
|
|
27451
|
+
/**
|
|
27452
|
+
* Takes the node's current transform as the unconstrained value the next solve blends from. The solver calls
|
|
27453
|
+
* this after the scene's animations ran; call it yourself after writing a transform by hand.
|
|
27454
|
+
*/
|
|
27455
|
+
captureBase(): void;
|
|
27456
|
+
/**
|
|
27457
|
+
* Writes the unconstrained transform back to the node. The solver calls this before the scene's animations
|
|
27458
|
+
* run, so a node nothing animates keeps its unconstrained value between frames instead of the solved one.
|
|
27459
|
+
*/
|
|
27460
|
+
restoreBase(): void;
|
|
27461
|
+
/**
|
|
27462
|
+
* Nodes whose world transform the solve reads: the targets, the up node and the constrained node's parent.
|
|
27463
|
+
* @returns The nodes, used by the solver to order constraints
|
|
27464
|
+
*/
|
|
27465
|
+
dependencyNodes(): Nullable<Node>[];
|
|
27466
|
+
/**
|
|
27467
|
+
* Solves the constraint from the captured unconstrained transform and writes the node's local transform.
|
|
27468
|
+
* Blends are relative to the value captured by `captureBase`, not to whatever the node holds now.
|
|
27469
|
+
*/
|
|
27470
|
+
evaluate(): void;
|
|
27471
|
+
/**
|
|
27472
|
+
* World matrix of a node relative to the asset root (FBX space).
|
|
27473
|
+
* @param node - node to evaluate
|
|
27474
|
+
* @param out - matrix receiving the result
|
|
27475
|
+
* @returns `out`
|
|
27476
|
+
*/
|
|
27477
|
+
private _fbxWorld;
|
|
27478
|
+
/**
|
|
27479
|
+
* Weighted blend of the targets' world transforms (relative to the root).
|
|
27480
|
+
* @param position - Receives the blended translation
|
|
27481
|
+
* @param rotation - Receives the blended rotation
|
|
27482
|
+
* @param scale - Receives the blended scale
|
|
27483
|
+
* @returns The total target weight, 0 when no target contributes
|
|
27484
|
+
*/
|
|
27485
|
+
private _blendTargets;
|
|
27486
|
+
private _applyWeighted;
|
|
27487
|
+
private _applyRotation;
|
|
27488
|
+
private _writePosition;
|
|
27489
|
+
private _writeScaling;
|
|
27490
|
+
private _solvePosition;
|
|
27491
|
+
private _solveRotation;
|
|
27492
|
+
private _solveScale;
|
|
27493
|
+
private _solveParent;
|
|
27494
|
+
private _solveAim;
|
|
27495
|
+
/**
|
|
27496
|
+
* Builds a rotation matrix whose rows are `first`, `second` made orthogonal to it, and their cross product.
|
|
27497
|
+
* @param first - primary axis
|
|
27498
|
+
* @param second - secondary axis
|
|
27499
|
+
* @param out - matrix receiving the basis
|
|
27500
|
+
* @returns false when the axes are parallel or degenerate (`out` is then unchanged)
|
|
27501
|
+
*/
|
|
27502
|
+
private static _OrthonormalBasisToRef;
|
|
27503
|
+
}
|
|
27504
|
+
|
|
27505
|
+
|
|
25168
27506
|
/**
|
|
25169
27507
|
* Intermediate representation for parsed FBX data.
|
|
25170
27508
|
* Both binary and ASCII parsers produce this same structure.
|
|
@@ -25179,6 +27517,11 @@ declare namespace BABYLON {
|
|
|
25179
27517
|
type: FBXPropertyType;
|
|
25180
27518
|
/** Parsed property value. */
|
|
25181
27519
|
value: FBXPropertyValue;
|
|
27520
|
+
/**
|
|
27521
|
+
* Exact decimal text of an int64 whose magnitude exceeds 2^53; `value` then holds the rounded double. Object
|
|
27522
|
+
* ids are the only int64 values where the last bits matter, and `resolveConnections` keys them by this text.
|
|
27523
|
+
*/
|
|
27524
|
+
raw?: string;
|
|
25182
27525
|
}
|
|
25183
27526
|
/** A node in the FBX document tree */
|
|
25184
27527
|
export interface FBXNode {
|
|
@@ -25205,11 +27548,22 @@ declare namespace BABYLON {
|
|
|
25205
27548
|
/** Extract a property value by index, with type narrowing */
|
|
25206
27549
|
export function getPropertyValue<T extends FBXPropertyValue>(node: FBXNode, index: number): T | undefined;
|
|
25207
27550
|
/**
|
|
25208
|
-
*
|
|
27551
|
+
* Validates an FBX object ID value: IDs are 64-bit integers, so anything non-numeric, non-finite or fractional is
|
|
27552
|
+
* rejected. IDs beyond 2^53 are carried losslessly through the property's `raw` text by `resolveConnections`.
|
|
25209
27553
|
* @param value - Parsed FBX object ID value
|
|
25210
|
-
* @returns The object ID, or undefined when the value
|
|
27554
|
+
* @returns The object ID, or undefined when the value cannot be an ID
|
|
25211
27555
|
*/
|
|
25212
27556
|
export function getSafeFBXObjectId(value: unknown): number | undefined;
|
|
27557
|
+
/** Typed array payload types produced by the parsers. */
|
|
27558
|
+
export type FBXArrayValue = Float32Array | Float64Array | Int32Array | Uint8Array;
|
|
27559
|
+
/**
|
|
27560
|
+
* Returns the array payload of a node.
|
|
27561
|
+
* FBX 7.x stores arrays as a single array property. FBX 6.x (and some 7.x ASCII exporters) store them as a run of
|
|
27562
|
+
* scalar properties, and a one-element array degenerates to a single scalar. All of these are coalesced here.
|
|
27563
|
+
* @param node - Node whose properties hold the array
|
|
27564
|
+
* @returns The array, or null when the node has no numeric payload
|
|
27565
|
+
*/
|
|
27566
|
+
export function getNodeArray(node: FBXNode | undefined | null): FBXArrayValue | null;
|
|
25213
27567
|
/** Get the numeric ID from a node (first property is typically the int64 UID) */
|
|
25214
27568
|
export function getNodeId(node: FBXNode): number | undefined;
|
|
25215
27569
|
/**
|
|
@@ -25337,25 +27691,9 @@ declare namespace BABYLON {
|
|
|
25337
27691
|
/** Recoverable skinning/bind diagnostics */
|
|
25338
27692
|
diagnostics: FBXSkinDiagnostic[];
|
|
25339
27693
|
}
|
|
25340
|
-
|
|
25341
|
-
* Extract all skin deformers from the FBX scene.
|
|
25342
|
-
* Returns skin data including bone hierarchy and vertex weights.
|
|
25343
|
-
*/
|
|
25344
|
-
export function extractSkins(objectMap: FBXObjectMap): FBXSkinData[];
|
|
27694
|
+
export function extractSkins(objectMap: FBXObjectMap, propertyTemplates?: FBXPropertyTemplateMap): FBXSkinData[];
|
|
25345
27695
|
export function isSkeletonModel(modelNode: FBXNode): boolean;
|
|
25346
|
-
export function extractBoneTransform(modelNode: FBXNode):
|
|
25347
|
-
translation: [number, number, number];
|
|
25348
|
-
rotation: [number, number, number];
|
|
25349
|
-
preRotation: [number, number, number];
|
|
25350
|
-
postRotation: [number, number, number];
|
|
25351
|
-
rotationPivot: [number, number, number];
|
|
25352
|
-
scalingPivot: [number, number, number];
|
|
25353
|
-
rotationOffset: [number, number, number];
|
|
25354
|
-
scalingOffset: [number, number, number];
|
|
25355
|
-
scale: [number, number, number];
|
|
25356
|
-
rotationOrder: number;
|
|
25357
|
-
inheritType: number;
|
|
25358
|
-
};
|
|
27696
|
+
export function extractBoneTransform(modelNode: FBXNode, template?: FBXPropertyTemplate): FBXNodeTransformData;
|
|
25359
27697
|
|
|
25360
27698
|
|
|
25361
27699
|
export type FBXSceneDiagnosticType = "unsupported-constraint" | "unsupported-helper" | "unsupported-deformer" | "unsupported-node-attribute" | "unsupported-pose" | "unsupported-layered-texture" | "connection-graph";
|
|
@@ -25414,6 +27752,160 @@ declare namespace BABYLON {
|
|
|
25414
27752
|
export function resolveVector2Property(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string, fallback: [number, number]): [number, number];
|
|
25415
27753
|
export function resolveVector3Property(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string, fallback: [number, number, number]): [number, number, number];
|
|
25416
27754
|
export function resolvePropertyValues(node: FBXNode, template: FBXPropertyTemplate | undefined, propertyName: string): FBXPropertyValue[] | undefined;
|
|
27755
|
+
/** A property from a Properties70 ("P") or Properties60 ("Property") block. */
|
|
27756
|
+
export interface FBXPropertyEntry {
|
|
27757
|
+
name: string;
|
|
27758
|
+
type: string;
|
|
27759
|
+
flags: string;
|
|
27760
|
+
values: FBXPropertyValue[];
|
|
27761
|
+
}
|
|
27762
|
+
/**
|
|
27763
|
+
* Lists the properties declared directly on an object, from both the 7.x and 6.x property blocks.
|
|
27764
|
+
* @param node - Object node
|
|
27765
|
+
* @returns Property entries in declaration order (empty when the node has no property block)
|
|
27766
|
+
*/
|
|
27767
|
+
export function getPropertyEntries(node: FBXNode | undefined): FBXPropertyEntry[];
|
|
27768
|
+
/** Value of a user property: scalars as-is, vectors and colours as number arrays. */
|
|
27769
|
+
export type FBXUserPropertyValue = string | number | boolean | number[];
|
|
27770
|
+
/**
|
|
27771
|
+
* User-defined properties of an object: those flagged "U" (user) in the property flags. Every DCC exports custom
|
|
27772
|
+
* attributes this way (Maya extra attributes, 3ds Max user properties, Blender custom properties).
|
|
27773
|
+
* @param node - Object node
|
|
27774
|
+
* @returns Map of property name to value, or undefined when the object has none
|
|
27775
|
+
*/
|
|
27776
|
+
export function extractUserProperties(node: FBXNode): Record<string, FBXUserPropertyValue> | undefined;
|
|
27777
|
+
export function userPropertyValue(values: FBXPropertyValue[], typeName?: string): FBXUserPropertyValue | undefined;
|
|
27778
|
+
|
|
27779
|
+
|
|
27780
|
+
/**
|
|
27781
|
+
* NURBS curves and surfaces, and polyline ("Line") geometry.
|
|
27782
|
+
*
|
|
27783
|
+
* The basis evaluation and tessellation follow the FBX SDK conventions as implemented by ufbx: knot spans are
|
|
27784
|
+
* subdivided uniformly, closed and periodic curves wrap their control points, and surfaces are tessellated into
|
|
27785
|
+
* quads (degenerate quads at poles become triangles) with welded positions along the wrapped edges.
|
|
27786
|
+
*/
|
|
27787
|
+
export type FBXNurbsTopology = "open" | "closed" | "periodic";
|
|
27788
|
+
/** Knot vector and derived data of one parametric direction. */
|
|
27789
|
+
export interface FBXNurbsBasis {
|
|
27790
|
+
order: number;
|
|
27791
|
+
topology: FBXNurbsTopology;
|
|
27792
|
+
knots: Float64Array;
|
|
27793
|
+
/** Parameter range that the curve is defined on */
|
|
27794
|
+
tMin: number;
|
|
27795
|
+
tMax: number;
|
|
27796
|
+
/** Distinct knot values inside [tMin, tMax], i.e. the boundaries of the non-empty spans */
|
|
27797
|
+
spans: Float64Array;
|
|
27798
|
+
/** False when the knot vector is too short or not monotonic */
|
|
27799
|
+
valid: boolean;
|
|
27800
|
+
}
|
|
27801
|
+
/** NURBS curve: homogeneous control points (x, y, z, w) and a basis. */
|
|
27802
|
+
export interface FBXNurbsCurveData {
|
|
27803
|
+
basis: FBXNurbsBasis;
|
|
27804
|
+
/** Control points as x,y,z,w */
|
|
27805
|
+
controlPoints: Float64Array;
|
|
27806
|
+
numControlPoints: number;
|
|
27807
|
+
}
|
|
27808
|
+
/** NURBS surface: control points laid out as `v * numU + u`. */
|
|
27809
|
+
export interface FBXNurbsSurfaceData {
|
|
27810
|
+
basisU: FBXNurbsBasis;
|
|
27811
|
+
basisV: FBXNurbsBasis;
|
|
27812
|
+
numU: number;
|
|
27813
|
+
numV: number;
|
|
27814
|
+
/** Control points as x,y,z,w */
|
|
27815
|
+
controlPoints: Float64Array;
|
|
27816
|
+
flipNormals: boolean;
|
|
27817
|
+
/** Span subdivision stored in the file (Step), 0 when absent */
|
|
27818
|
+
stepU: number;
|
|
27819
|
+
stepV: number;
|
|
27820
|
+
}
|
|
27821
|
+
/** Polyline geometry ready for a lines mesh: one or more open or closed point runs. */
|
|
27822
|
+
export interface FBXCurveGeometryData {
|
|
27823
|
+
id: number;
|
|
27824
|
+
name: string;
|
|
27825
|
+
kind: "line" | "nurbsCurve";
|
|
27826
|
+
/** Each polyline as x,y,z triples; closed runs repeat their first point at the end */
|
|
27827
|
+
polylines: Float64Array[];
|
|
27828
|
+
/** Display colour from the geometry's Color property */
|
|
27829
|
+
color: [number, number, number] | null;
|
|
27830
|
+
diagnostics: FBXGeometryDiagnostic[];
|
|
27831
|
+
}
|
|
27832
|
+
export function createNurbsBasis(order: number, form: string | undefined, knots: Float64Array): FBXNurbsBasis;
|
|
27833
|
+
/**
|
|
27834
|
+
* Evaluates the basis functions (and their derivatives) that are non-zero at `u`.
|
|
27835
|
+
* @returns index of the first influencing control point, or -1 when the basis cannot be evaluated
|
|
27836
|
+
*/
|
|
27837
|
+
export function evaluateNurbsBasis(basis: FBXNurbsBasis, u: number, weights: Float64Array, derivatives: Float64Array | null): number;
|
|
27838
|
+
/** Evaluates a curve point; `out` receives position (0..2) and derivative (3..5). */
|
|
27839
|
+
export function evaluateNurbsCurve(curve: FBXNurbsCurveData, u: number, out: Float64Array, weights: Float64Array, derivs: Float64Array): boolean;
|
|
27840
|
+
/** Evaluates a surface point; `out` receives position (0..2), du (3..5) and dv (6..8). */
|
|
27841
|
+
export function evaluateNurbsSurface(surface: FBXNurbsSurfaceData, u: number, v: number, out: Float64Array, scratch: {
|
|
27842
|
+
wu: Float64Array;
|
|
27843
|
+
wv: Float64Array;
|
|
27844
|
+
du: Float64Array;
|
|
27845
|
+
dv: Float64Array;
|
|
27846
|
+
}): boolean;
|
|
27847
|
+
/**
|
|
27848
|
+
* Tessellates a curve into a polyline with `subdivision` segments per knot span. Closed and periodic curves
|
|
27849
|
+
* end on a copy of their first point.
|
|
27850
|
+
*/
|
|
27851
|
+
export function tessellateNurbsCurve(curve: FBXNurbsCurveData, subdivision?: number): Float64Array | null;
|
|
27852
|
+
/** Span subdivision to use for a surface direction: an explicit override, else the file's Step, else 4. */
|
|
27853
|
+
export function resolveSpanSubdivision(fileStep: number, override: number | undefined): number;
|
|
27854
|
+
/**
|
|
27855
|
+
* Tessellates a surface into triangles. Positions on wrapped (closed/periodic) edges and at poles are welded
|
|
27856
|
+
* exactly like the FBX SDK does, so degenerate quads collapse into triangles.
|
|
27857
|
+
*/
|
|
27858
|
+
export function tessellateNurbsSurface(surface: FBXNurbsSurfaceData, subU: number, subV: number): {
|
|
27859
|
+
positions: Float64Array;
|
|
27860
|
+
indices: Uint32Array;
|
|
27861
|
+
normals: Float64Array;
|
|
27862
|
+
uvs: Float64Array;
|
|
27863
|
+
} | null;
|
|
27864
|
+
/** Reads a NurbsCurve geometry node. */
|
|
27865
|
+
export function extractNurbsCurve(node: FBXNode): FBXNurbsCurveData | null;
|
|
27866
|
+
/** Reads a NurbsSurface geometry node. */
|
|
27867
|
+
export function extractNurbsSurface(node: FBXNode): FBXNurbsSurfaceData | null;
|
|
27868
|
+
/** Tessellates a NurbsSurface geometry node into mesh geometry. */
|
|
27869
|
+
export function nurbsSurfaceToGeometry(node: FBXNode, geometryId: number, subdivisionOverride: number | undefined): FBXGeometryData | null;
|
|
27870
|
+
/** Reads a NurbsCurve geometry node into a tessellated polyline. */
|
|
27871
|
+
export function extractNurbsCurveGeometry(node: FBXNode, geometryId: number, subdivision?: number): FBXCurveGeometryData;
|
|
27872
|
+
/**
|
|
27873
|
+
* Reads a Line geometry node: Points plus PointsIndex where a negative index (~index) ends a segment, as in
|
|
27874
|
+
* polygon vertex indices.
|
|
27875
|
+
*/
|
|
27876
|
+
export function extractLineGeometry(node: FBXNode, geometryId: number): FBXCurveGeometryData;
|
|
27877
|
+
|
|
27878
|
+
|
|
27879
|
+
/** Transform properties resolved from an FBX Model, with template defaults applied. */
|
|
27880
|
+
export interface FBXNodeTransformData {
|
|
27881
|
+
translation: [number, number, number];
|
|
27882
|
+
rotation: [number, number, number];
|
|
27883
|
+
scale: [number, number, number];
|
|
27884
|
+
preRotation: [number, number, number];
|
|
27885
|
+
postRotation: [number, number, number];
|
|
27886
|
+
rotationPivot: [number, number, number];
|
|
27887
|
+
scalingPivot: [number, number, number];
|
|
27888
|
+
rotationOffset: [number, number, number];
|
|
27889
|
+
scalingOffset: [number, number, number];
|
|
27890
|
+
geometricTranslation: [number, number, number];
|
|
27891
|
+
geometricRotation: [number, number, number];
|
|
27892
|
+
geometricScaling: [number, number, number];
|
|
27893
|
+
/** Rotation order: 0=XYZ, 1=XZY, 2=YZX, 3=YXZ, 4=ZXY, 5=ZYX, 6=SphericXYZ */
|
|
27894
|
+
rotationOrder: number;
|
|
27895
|
+
/** FBX transform inheritance mode. 0=RrSs, 1=RSrs, 2=Rrs */
|
|
27896
|
+
inheritType: number;
|
|
27897
|
+
/** Whether the rotation space (rotation order, pre/post rotation) is active for this node */
|
|
27898
|
+
rotationActive: boolean;
|
|
27899
|
+
diagnostics: string[];
|
|
27900
|
+
}
|
|
27901
|
+
/**
|
|
27902
|
+
* Resolves the transform properties of a Model node the way the FBX SDK evaluates them.
|
|
27903
|
+
*
|
|
27904
|
+
* `RotationActive` gates the whole rotation space: when it is false (the FbxNode template default), the SDK
|
|
27905
|
+
* composes `Lcl Rotation` in plain XYZ order and ignores `RotationOrder`, `PreRotation` and `PostRotation`.
|
|
27906
|
+
* `RotationSpaceForLimitOnly` restricts the rotation space to limits, which has the same effect for us.
|
|
27907
|
+
*/
|
|
27908
|
+
export function extractNodeTransform(modelNode: FBXNode, template?: FBXPropertyTemplate): FBXNodeTransformData;
|
|
25417
27909
|
|
|
25418
27910
|
|
|
25419
27911
|
/** Parsed material data */
|
|
@@ -25423,6 +27915,10 @@ declare namespace BABYLON {
|
|
|
25423
27915
|
type: "Lambert" | "Phong";
|
|
25424
27916
|
properties: FBXMaterialProperties;
|
|
25425
27917
|
textures: FBXTextureRef[];
|
|
27918
|
+
/** Unified classic + PBR parameter model resolved from whichever shader flavour the file uses */
|
|
27919
|
+
model: FBXMaterialModel<FBXTextureRef>;
|
|
27920
|
+
/** User-defined properties */
|
|
27921
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
25426
27922
|
}
|
|
25427
27923
|
export interface FBXMaterialProperties {
|
|
25428
27924
|
diffuseColor?: [number, number, number];
|
|
@@ -25458,11 +27954,102 @@ declare namespace BABYLON {
|
|
|
25458
27954
|
uvSetIndex?: number;
|
|
25459
27955
|
/** Which named UV set this texture uses */
|
|
25460
27956
|
uvSetName?: string;
|
|
27957
|
+
/** WrapModeU: 0 = repeat, 1 = clamp */
|
|
27958
|
+
wrapU?: number;
|
|
27959
|
+
/** WrapModeV: 0 = repeat, 1 = clamp */
|
|
27960
|
+
wrapV?: number;
|
|
27961
|
+
/** Set when the texture came from a LayeredTexture (only the first layer is used) */
|
|
27962
|
+
layeredTextureId?: number;
|
|
25461
27963
|
}
|
|
25462
27964
|
/**
|
|
25463
27965
|
* Extract material data from an FBX Material node.
|
|
25464
27966
|
*/
|
|
25465
27967
|
export function extractMaterial(materialNode: FBXNode, materialId: number, objectMap: FBXObjectMap, templates?: FBXPropertyTemplateMap): FBXMaterialData;
|
|
27968
|
+
export function extractTextureRef(id: number, node: FBXNode, propertyName: string | undefined, objectMap: FBXObjectMap, template?: FBXPropertyTemplate): FBXTextureRef;
|
|
27969
|
+
|
|
27970
|
+
|
|
27971
|
+
/**
|
|
27972
|
+
* Unified material model.
|
|
27973
|
+
*
|
|
27974
|
+
* FBX materials come in many vendor flavours: the classic FbxSurfaceLambert / FbxSurfacePhong, Autodesk Standard
|
|
27975
|
+
* Surface (OSL), Arnold aiStandardSurface, 3ds Max Physical Material, 3ds Max PBR (metal/rough and spec/gloss),
|
|
27976
|
+
* the 3ds Max glTF material, OpenPBR, and Maya's Stingray PBS ShaderFX graph. Each stores its parameters under
|
|
27977
|
+
* different property names, sometimes behind a shader binding table.
|
|
27978
|
+
*
|
|
27979
|
+
* This module resolves any of them into two parameter sets, mirroring how the FBX SDK / ufbx expose materials:
|
|
27980
|
+
* `fbx` (the classic Lambert/Phong parameters) and `pbr` (a physically based parameter set), plus feature flags.
|
|
27981
|
+
*/
|
|
27982
|
+
export type FBXShaderType = "unknown" | "fbxLambert" | "fbxPhong" | "oslStandardSurface" | "arnoldStandardSurface" | "3dsMaxPhysicalMaterial" | "3dsMaxPbrMetalRough" | "3dsMaxPbrSpecGloss" | "gltfMaterial" | "openPbrMaterial" | "shaderFxGraph";
|
|
27983
|
+
/** One resolved material parameter: a constant value and/or a texture. */
|
|
27984
|
+
export interface FBXMaterialMap<TTexture> {
|
|
27985
|
+
/** Constant value (r,g,b,a for colours, x for scalars) */
|
|
27986
|
+
value?: number[];
|
|
27987
|
+
/** Number of meaningful components in `value` (1 for scalars, 3 or 4 for colours) */
|
|
27988
|
+
valueComponents: number;
|
|
27989
|
+
/** Texture bound to the parameter */
|
|
27990
|
+
texture?: TTexture;
|
|
27991
|
+
/** Whether the texture is enabled (some vendors carry an explicit toggle) */
|
|
27992
|
+
textureEnabled: boolean;
|
|
27993
|
+
}
|
|
27994
|
+
export type FBXFbxMapName = "diffuseFactor" | "diffuseColor" | "specularFactor" | "specularColor" | "specularExponent" | "reflectionFactor" | "reflectionColor" | "transparencyFactor" | "transparencyColor" | "emissionFactor" | "emissionColor" | "ambientFactor" | "ambientColor" | "normalMap" | "bump" | "bumpFactor" | "displacement" | "displacementFactor" | "vectorDisplacement" | "vectorDisplacementFactor";
|
|
27995
|
+
export type FBXPbrMapName = "baseFactor" | "baseColor" | "roughness" | "metalness" | "diffuseRoughness" | "specularFactor" | "specularColor" | "specularIor" | "specularAnisotropy" | "specularRotation" | "transmissionFactor" | "transmissionColor" | "transmissionDepth" | "transmissionScatter" | "transmissionScatterAnisotropy" | "transmissionDispersion" | "transmissionRoughness" | "transmissionExtraRoughness" | "transmissionPriority" | "transmissionEnableInAov" | "subsurfaceFactor" | "subsurfaceColor" | "subsurfaceRadius" | "subsurfaceScale" | "subsurfaceAnisotropy" | "subsurfaceTintColor" | "subsurfaceType" | "sheenFactor" | "sheenColor" | "sheenRoughness" | "coatFactor" | "coatColor" | "coatRoughness" | "coatIor" | "coatAnisotropy" | "coatRotation" | "coatNormal" | "coatAffectBaseColor" | "coatAffectBaseRoughness" | "thinFilmFactor" | "thinFilmThickness" | "thinFilmIor" | "emissionFactor" | "emissionColor" | "opacity" | "indirectDiffuse" | "indirectSpecular" | "normalMap" | "tangentMap" | "displacementMap" | "matteFactor" | "matteColor" | "ambientOcclusion" | "glossiness" | "coatGlossiness" | "transmissionGlossiness";
|
|
27996
|
+
export type FBXMaterialFeatureName = "pbr" | "metalness" | "diffuse" | "specular" | "emission" | "transmission" | "coat" | "sheen" | "opacity" | "ambientOcclusion" | "matte" | "unlit" | "ior" | "diffuseRoughness" | "transmissionRoughness" | "thinWalled" | "caustics" | "exitToBackground" | "internalReflections" | "doubleSided" | "roughnessAsGlossiness" | "coatRoughnessAsGlossiness" | "transmissionRoughnessAsGlossiness";
|
|
27997
|
+
export interface FBXMaterialModel<TTexture> {
|
|
27998
|
+
shaderType: FBXShaderType;
|
|
27999
|
+
/** Prefix material property names carry for this shader (e.g. "3dsMax|Parameters|") */
|
|
28000
|
+
shaderPropPrefix: string;
|
|
28001
|
+
fbx: Partial<Record<FBXFbxMapName, FBXMaterialMap<TTexture>>>;
|
|
28002
|
+
pbr: Partial<Record<FBXPbrMapName, FBXMaterialMap<TTexture>>>;
|
|
28003
|
+
features: Partial<Record<FBXMaterialFeatureName, {
|
|
28004
|
+
enabled: boolean;
|
|
28005
|
+
explicit: boolean;
|
|
28006
|
+
}>>;
|
|
28007
|
+
}
|
|
28008
|
+
/** Inputs needed to resolve a material, independent of the parse representation. */
|
|
28009
|
+
export interface FBXMaterialSource<TTexture> {
|
|
28010
|
+
/** "lambert", "phong", "unknown", ... as written in the file */
|
|
28011
|
+
shadingModelName: string;
|
|
28012
|
+
/** Property values by full property name (e.g. "DiffuseColor", "Maya|baseColor", "3dsMax|Parameters|roughness") */
|
|
28013
|
+
props: Map<string, {
|
|
28014
|
+
type: string;
|
|
28015
|
+
values: FBXPropertyValue[];
|
|
28016
|
+
}>;
|
|
28017
|
+
/** Textures connected to the material by property name (OP connection property) */
|
|
28018
|
+
texturesByProp: Map<string, TTexture>;
|
|
28019
|
+
/** Connected shader implementation, when any */
|
|
28020
|
+
shader?: {
|
|
28021
|
+
renderApi: string;
|
|
28022
|
+
/** shader semantic name -> material property names */
|
|
28023
|
+
bindings: Map<string, string[]>;
|
|
28024
|
+
};
|
|
28025
|
+
}
|
|
28026
|
+
/** Shader types whose parameters are physically based; the loader emits PBR materials for them by default. */
|
|
28027
|
+
export function isPbrShaderType(type: FBXShaderType): boolean;
|
|
28028
|
+
/** Detects the shader flavour of a material from its shading model name, connected shader and 3ds Max class ids. */
|
|
28029
|
+
export function detectShaderType<T>(source: FBXMaterialSource<T>): {
|
|
28030
|
+
shaderType: FBXShaderType;
|
|
28031
|
+
shaderPropPrefix: string;
|
|
28032
|
+
};
|
|
28033
|
+
/**
|
|
28034
|
+
* Resolves the unified material model from raw material data.
|
|
28035
|
+
*/
|
|
28036
|
+
export function resolveMaterialModel<T>(source: FBXMaterialSource<T>): FBXMaterialModel<T>;
|
|
28037
|
+
/** Colour (first three components) of a map, or undefined. */
|
|
28038
|
+
export function mapColor<T>(map: FBXMaterialMap<T> | undefined): [number, number, number] | undefined;
|
|
28039
|
+
/** Scalar (first component) of a map, or undefined. */
|
|
28040
|
+
export function mapScalar<T>(map: FBXMaterialMap<T> | undefined): number | undefined;
|
|
28041
|
+
|
|
28042
|
+
|
|
28043
|
+
/**
|
|
28044
|
+
* FBX 5.x (and older) documents store everything at the top level: one `Model` node per object with inline
|
|
28045
|
+
* geometry, materials, skin links, lights and cameras, and `Children` lists instead of connections. This module
|
|
28046
|
+
* rewrites such a document into the 6.x layout (`Objects`, `Connections`, `Takes`) so the rest of the importer
|
|
28047
|
+
* can treat both the same way. The rules follow the FBX SDK's legacy reader as implemented by ufbx.
|
|
28048
|
+
*/
|
|
28049
|
+
/** True for pre-6000 files: no `Objects` section but top-level `Model` nodes. */
|
|
28050
|
+
export function isLegacyDocument(doc: FBXDocument): boolean;
|
|
28051
|
+
/** Rewrites a legacy document into the 6.x object/connection layout. */
|
|
28052
|
+
export function upgradeLegacyDocument(doc: FBXDocument): FBXDocument;
|
|
25466
28053
|
|
|
25467
28054
|
|
|
25468
28055
|
/** A named UV set */
|
|
@@ -25475,7 +28062,7 @@ declare namespace BABYLON {
|
|
|
25475
28062
|
/** Recoverable geometry import issue. */
|
|
25476
28063
|
export interface FBXGeometryDiagnostic {
|
|
25477
28064
|
/** Diagnostic category. */
|
|
25478
|
-
type: "degenerate-polygon" | "triangulation-fallback" | "layer-index-out-of-bounds" | "layer-data-too-short";
|
|
28065
|
+
type: "degenerate-polygon" | "triangulation-fallback" | "layer-index-out-of-bounds" | "layer-data-too-short" | "nurbs-invalid" | "nurbs-trim-ignored" | "nurbs-deformer-ignored";
|
|
25479
28066
|
/** Human-readable diagnostic message. */
|
|
25480
28067
|
message: string;
|
|
25481
28068
|
/** Polygon index associated with the diagnostic, if applicable. */
|
|
@@ -25526,8 +28113,10 @@ declare namespace BABYLON {
|
|
|
25526
28113
|
id: number;
|
|
25527
28114
|
name: string;
|
|
25528
28115
|
subType: string;
|
|
25529
|
-
/** Geometry attached to this model (
|
|
28116
|
+
/** Geometry attached to this model (meshes and tessellated NURBS surfaces) */
|
|
25530
28117
|
geometry?: FBXGeometryData;
|
|
28118
|
+
/** Curve geometry attached to this model (Line and NurbsCurve) */
|
|
28119
|
+
curve?: FBXCurveGeometryData;
|
|
25531
28120
|
/** Materials assigned to this model */
|
|
25532
28121
|
materials: FBXMaterialData[];
|
|
25533
28122
|
/** Child models */
|
|
@@ -25559,18 +28148,68 @@ declare namespace BABYLON {
|
|
|
25559
28148
|
/** Whether backface culling is disabled ("CullingOff") */
|
|
25560
28149
|
cullingOff: boolean;
|
|
25561
28150
|
/** User-defined custom properties from Properties70 */
|
|
25562
|
-
customProperties?: Record<string,
|
|
28151
|
+
customProperties?: Record<string, FBXUserPropertyValue>;
|
|
28152
|
+
/** LOD group settings when this model is a LodGroup; children are the levels in order */
|
|
28153
|
+
lodGroup?: FBXLodGroupData;
|
|
28154
|
+
/** Display layer (CollectionExclusive) the model belongs to */
|
|
28155
|
+
displayLayer?: FBXDisplayLayerData;
|
|
25563
28156
|
/** Recoverable model import diagnostics */
|
|
25564
28157
|
diagnostics: string[];
|
|
25565
28158
|
}
|
|
28159
|
+
/** LOD group settings (NodeAttribute "LodGroup") */
|
|
28160
|
+
export interface FBXLodGroupData {
|
|
28161
|
+
/** Switch distance for level i+1 (level 0 has none). In scene units, or percent of screen when `relative`. */
|
|
28162
|
+
thresholds: number[];
|
|
28163
|
+
/** ThresholdsUsedAsPercentage */
|
|
28164
|
+
relative: boolean;
|
|
28165
|
+
/** DisplayLevels|LevelN: 0 use LOD, 1 show, 2 hide */
|
|
28166
|
+
displayLevels: number[];
|
|
28167
|
+
}
|
|
28168
|
+
/** Display layer (CollectionExclusive "DisplayLayer") */
|
|
28169
|
+
export interface FBXDisplayLayerData {
|
|
28170
|
+
id: number;
|
|
28171
|
+
name: string;
|
|
28172
|
+
show: boolean;
|
|
28173
|
+
freeze: boolean;
|
|
28174
|
+
color: [number, number, number];
|
|
28175
|
+
modelIds: number[];
|
|
28176
|
+
}
|
|
28177
|
+
/** One member of a selection set: a model, optionally with a component selection on its mesh */
|
|
28178
|
+
export interface FBXSelectionNodeData {
|
|
28179
|
+
modelId: number;
|
|
28180
|
+
/** IsTheNodeInSet: the whole node is selected (as opposed to only components) */
|
|
28181
|
+
includeNode: boolean;
|
|
28182
|
+
/** Selected control point indices (VertexIndexArray) */
|
|
28183
|
+
vertices?: number[];
|
|
28184
|
+
/** Selected edge indices (EdgeIndexArray) */
|
|
28185
|
+
edges?: number[];
|
|
28186
|
+
/** Selected polygon indices (PolygonIndexArray) */
|
|
28187
|
+
faces?: number[];
|
|
28188
|
+
}
|
|
28189
|
+
/** Selection set (Collection "SelectionSet") */
|
|
28190
|
+
export interface FBXSelectionSetData {
|
|
28191
|
+
id: number;
|
|
28192
|
+
name: string;
|
|
28193
|
+
members: FBXSelectionNodeData[];
|
|
28194
|
+
}
|
|
25566
28195
|
/** Camera data extracted from FBX */
|
|
25567
28196
|
export interface FBXCameraData {
|
|
25568
28197
|
/** Model ID this camera is attached to */
|
|
25569
28198
|
modelId: number;
|
|
28199
|
+
/** NodeAttribute object ID (animation curves target this) */
|
|
28200
|
+
attributeId: number;
|
|
25570
28201
|
/** Camera name */
|
|
25571
28202
|
name: string;
|
|
25572
|
-
/**
|
|
28203
|
+
/** Vertical field of view in degrees */
|
|
25573
28204
|
fieldOfView: number;
|
|
28205
|
+
/** Horizontal field of view in degrees */
|
|
28206
|
+
fieldOfViewX: number;
|
|
28207
|
+
/** ApertureMode: 0 horizontal and vertical, 1 horizontal, 2 vertical, 3 focal length */
|
|
28208
|
+
apertureMode: number;
|
|
28209
|
+
/** Aperture (film gate after gate fit) size in inches */
|
|
28210
|
+
apertureSizeInch: [number, number];
|
|
28211
|
+
/** Orthographic view size (width, height) in scene units */
|
|
28212
|
+
orthographicSize: [number, number];
|
|
25574
28213
|
/** Near clip plane */
|
|
25575
28214
|
nearPlane: number;
|
|
25576
28215
|
/** Far clip plane */
|
|
@@ -25589,6 +28228,8 @@ declare namespace BABYLON {
|
|
|
25589
28228
|
orthoZoom?: number;
|
|
25590
28229
|
/** Camera roll in degrees when present */
|
|
25591
28230
|
roll?: number;
|
|
28231
|
+
/** User-defined properties on the camera attribute */
|
|
28232
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
25592
28233
|
/** Known unsupported or unrecognized camera properties */
|
|
25593
28234
|
unknownProperties: string[];
|
|
25594
28235
|
/** Recoverable camera import diagnostics */
|
|
@@ -25598,6 +28239,8 @@ declare namespace BABYLON {
|
|
|
25598
28239
|
export interface FBXLightData {
|
|
25599
28240
|
/** Model ID this light is attached to */
|
|
25600
28241
|
modelId: number;
|
|
28242
|
+
/** NodeAttribute object ID (animation curves target this) */
|
|
28243
|
+
attributeId: number;
|
|
25601
28244
|
/** Light name */
|
|
25602
28245
|
name: string;
|
|
25603
28246
|
/** Light type: 0=Point, 1=Directional, 2=Spot */
|
|
@@ -25622,6 +28265,15 @@ declare namespace BABYLON {
|
|
|
25622
28265
|
enableFarAttenuation?: boolean;
|
|
25623
28266
|
/** Whether the source light requested shadow casting */
|
|
25624
28267
|
castShadows?: boolean;
|
|
28268
|
+
/** Near/far attenuation ranges in scene units (when enabled) */
|
|
28269
|
+
nearAttenuationStart?: number;
|
|
28270
|
+
nearAttenuationEnd?: number;
|
|
28271
|
+
farAttenuationStart?: number;
|
|
28272
|
+
farAttenuationEnd?: number;
|
|
28273
|
+
/** Area light shape: 0 rectangle, 1 sphere */
|
|
28274
|
+
areaLightShape?: number;
|
|
28275
|
+
/** User-defined properties on the light attribute */
|
|
28276
|
+
userProperties?: Record<string, FBXUserPropertyValue>;
|
|
25625
28277
|
/** Known unsupported or unrecognized light properties */
|
|
25626
28278
|
unknownProperties: string[];
|
|
25627
28279
|
/** Recoverable light import diagnostics */
|
|
@@ -25633,6 +28285,8 @@ declare namespace BABYLON {
|
|
|
25633
28285
|
rootModels: FBXModelData[];
|
|
25634
28286
|
/** All geometries in the scene */
|
|
25635
28287
|
geometries: FBXGeometryData[];
|
|
28288
|
+
/** All curve geometries (lines and tessellated NURBS curves) */
|
|
28289
|
+
curves: FBXCurveGeometryData[];
|
|
25636
28290
|
/** All materials in the scene */
|
|
25637
28291
|
materials: FBXMaterialData[];
|
|
25638
28292
|
/** Skin deformers (skeletons + vertex weights) */
|
|
@@ -25649,6 +28303,12 @@ declare namespace BABYLON {
|
|
|
25649
28303
|
lights: FBXLightData[];
|
|
25650
28304
|
/** Scene-level unsupported feature diagnostics */
|
|
25651
28305
|
diagnostics: FBXSceneDiagnostic[];
|
|
28306
|
+
/** Constraints (aim, parent, position, rotation, scale, IK) */
|
|
28307
|
+
constraints: FBXConstraintData[];
|
|
28308
|
+
/** Display layers */
|
|
28309
|
+
displayLayers: FBXDisplayLayerData[];
|
|
28310
|
+
/** Selection sets */
|
|
28311
|
+
selectionSets: FBXSelectionSetData[];
|
|
25652
28312
|
/** Global settings */
|
|
25653
28313
|
upAxis: number;
|
|
25654
28314
|
upAxisSign: number;
|
|
@@ -25657,11 +28317,89 @@ declare namespace BABYLON {
|
|
|
25657
28317
|
coordAxis: number;
|
|
25658
28318
|
coordAxisSign: number;
|
|
25659
28319
|
unitScaleFactor: number;
|
|
28320
|
+
/** Scene frame rate derived from GlobalSettings TimeMode / CustomFrameRate */
|
|
28321
|
+
frameRate: number;
|
|
25660
28322
|
}
|
|
25661
28323
|
/**
|
|
25662
28324
|
* Interpret a parsed FBX document into scene data.
|
|
25663
28325
|
*/
|
|
25664
|
-
|
|
28326
|
+
/** Options controlling how the document is interpreted. */
|
|
28327
|
+
export interface FBXInterpretOptions {
|
|
28328
|
+
/** Segments per knot span when tessellating NURBS surfaces; defaults to the Step stored in the file */
|
|
28329
|
+
nurbsSubdivision?: number;
|
|
28330
|
+
/** Shift every clip so its first key sits at time 0 (default true); false keeps the authored times */
|
|
28331
|
+
rebaseKeyframes?: boolean;
|
|
28332
|
+
}
|
|
28333
|
+
export function interpretFBX(doc: FBXDocument, options?: FBXInterpretOptions): FBXSceneData;
|
|
28334
|
+
|
|
28335
|
+
|
|
28336
|
+
export type FBXConstraintType = "aim" | "parent" | "position" | "rotation" | "scale" | "singleChainIK" | "unknown";
|
|
28337
|
+
export type Vec3 = [number, number, number];
|
|
28338
|
+
export type Bool3 = [boolean, boolean, boolean];
|
|
28339
|
+
/** One weighted target of a constraint. */
|
|
28340
|
+
export interface FBXConstraintTarget {
|
|
28341
|
+
/** Model id of the target node */
|
|
28342
|
+
modelId: number;
|
|
28343
|
+
/** Normalized weight (file value / 100, or as-is for IK pole targets) */
|
|
28344
|
+
weight: number;
|
|
28345
|
+
/** Parent constraint translation offset expressed in the target's space */
|
|
28346
|
+
offsetTranslation: Vec3;
|
|
28347
|
+
/** Parent constraint rotation offset in degrees, expressed in the target's space */
|
|
28348
|
+
offsetRotation: Vec3;
|
|
28349
|
+
/** Parent constraint scale offset expressed in the target's space */
|
|
28350
|
+
offsetScale: Vec3;
|
|
28351
|
+
}
|
|
28352
|
+
/** A constraint object of the file, with its targets and parameters resolved. */
|
|
28353
|
+
export interface FBXConstraintData {
|
|
28354
|
+
/** Constraint object id */
|
|
28355
|
+
id: number;
|
|
28356
|
+
/** Constraint name */
|
|
28357
|
+
name: string;
|
|
28358
|
+
/** Resolved constraint kind */
|
|
28359
|
+
type: FBXConstraintType;
|
|
28360
|
+
/** Constraint type name as written in the file (e.g. "Parent-Child") */
|
|
28361
|
+
typeName: string;
|
|
28362
|
+
/** Constrained model */
|
|
28363
|
+
nodeId?: number;
|
|
28364
|
+
/** Weighted targets in file order */
|
|
28365
|
+
targets: FBXConstraintTarget[];
|
|
28366
|
+
/** Global weight (file value / 100) */
|
|
28367
|
+
weight: number;
|
|
28368
|
+
/** False when the constraint is switched off in the file */
|
|
28369
|
+
active: boolean;
|
|
28370
|
+
/** Which translation axes the constraint drives */
|
|
28371
|
+
affectTranslation: Bool3;
|
|
28372
|
+
/** Which rotation axes the constraint drives */
|
|
28373
|
+
affectRotation: Bool3;
|
|
28374
|
+
/** Which scale axes the constraint drives */
|
|
28375
|
+
affectScale: Bool3;
|
|
28376
|
+
/** Translation offset of the constrained node */
|
|
28377
|
+
offsetTranslation: Vec3;
|
|
28378
|
+
/** Rotation offset of the constrained node, in degrees */
|
|
28379
|
+
offsetRotation: Vec3;
|
|
28380
|
+
/** Scale offset of the constrained node */
|
|
28381
|
+
offsetScale: Vec3;
|
|
28382
|
+
/** Aim: local axis that points at the target */
|
|
28383
|
+
aimVector: Vec3;
|
|
28384
|
+
/** Aim: local axis aligned with the up direction */
|
|
28385
|
+
upVector: Vec3;
|
|
28386
|
+
/** Aim: world up direction (world up modes 2 and 3) */
|
|
28387
|
+
worldUpVector: Vec3;
|
|
28388
|
+
/** Aim: 0 scene up, 1 aim up node, 2 align to node, 3 vector, 4 none */
|
|
28389
|
+
worldUpType: number;
|
|
28390
|
+
/** Aim: model id of the world up object (world up modes 1 and 2) */
|
|
28391
|
+
worldUpNodeId?: number;
|
|
28392
|
+
/** Single chain IK: model id of the first joint of the chain */
|
|
28393
|
+
ikFirstJointId?: number;
|
|
28394
|
+
/** Single chain IK: model id of the last joint of the chain */
|
|
28395
|
+
ikEndJointId?: number;
|
|
28396
|
+
/** Single chain IK: model id of the effector */
|
|
28397
|
+
ikEffectorId?: number;
|
|
28398
|
+
/** Single chain IK: pole vector */
|
|
28399
|
+
ikPoleVector: Vec3;
|
|
28400
|
+
}
|
|
28401
|
+
/** Reads every constraint object of the scene. */
|
|
28402
|
+
export function extractConstraints(objectMap: FBXObjectMap): FBXConstraintData[];
|
|
25665
28403
|
|
|
25666
28404
|
|
|
25667
28405
|
/** Connection type: OO = object-to-object, OP = object-to-property */
|
|
@@ -25684,7 +28422,7 @@ declare namespace BABYLON {
|
|
|
25684
28422
|
/** Object node. */
|
|
25685
28423
|
node: FBXNode;
|
|
25686
28424
|
/** Source of the object entry. */
|
|
25687
|
-
source: "Objects" | "legacySyntheticGeometry";
|
|
28425
|
+
source: "Objects" | "legacySyntheticGeometry" | "legacySyntheticAttribute" | "legacySyntheticBlendShape";
|
|
25688
28426
|
/** Legacy string object name, when applicable. */
|
|
25689
28427
|
legacyName?: string;
|
|
25690
28428
|
/** True if the object was synthesized for legacy compatibility. */
|
|
@@ -25805,7 +28543,23 @@ declare namespace BABYLON {
|
|
|
25805
28543
|
export function extractBlendShapes(objectMap: FBXObjectMap): FBXBlendShapeData[];
|
|
25806
28544
|
|
|
25807
28545
|
|
|
28546
|
+
/**
|
|
28547
|
+
* FBX animation curve model and evaluator.
|
|
28548
|
+
*
|
|
28549
|
+
* Keys carry cubic Bezier tangents expressed the way the FBX SDK stores them: a left and right tangent with a time
|
|
28550
|
+
* extent (dx, as a fraction of the segment scaled by the tangent weight) and a value extent (dy). Linear and constant
|
|
28551
|
+
* segments are represented the same way so that a single evaluator handles every case, including the weighted
|
|
28552
|
+
* tangents Maya and MotionBuilder write, TCB keys, and the pre/post extrapolation modes.
|
|
28553
|
+
*/
|
|
28554
|
+
/** FBX time units: 46186158000 ticks per second */
|
|
28555
|
+
export const FBX_TIME_UNIT = 46186158000;
|
|
25808
28556
|
export type FBXInterpolationType = "constant" | "linear" | "cubic";
|
|
28557
|
+
export type FBXExtrapolationMode = "constant" | "repeat" | "mirror" | "slope" | "repeatRelative";
|
|
28558
|
+
export interface FBXExtrapolation {
|
|
28559
|
+
mode: FBXExtrapolationMode;
|
|
28560
|
+
/** Number of repetitions, or -1 for infinite */
|
|
28561
|
+
repeatCount: number;
|
|
28562
|
+
}
|
|
25809
28563
|
/** A single keyframe */
|
|
25810
28564
|
export interface FBXKeyframe {
|
|
25811
28565
|
/** Time in seconds */
|
|
@@ -25816,9 +28570,15 @@ declare namespace BABYLON {
|
|
|
25816
28570
|
interpolation: FBXInterpolationType;
|
|
25817
28571
|
/** Constant interpolation variant */
|
|
25818
28572
|
constantMode?: "standard" | "next";
|
|
25819
|
-
/**
|
|
28573
|
+
/** Left (incoming) tangent: time extent in seconds and value extent */
|
|
28574
|
+
leftDx: number;
|
|
28575
|
+
leftDy: number;
|
|
28576
|
+
/** Right (outgoing) tangent: time extent in seconds and value extent */
|
|
28577
|
+
rightDx: number;
|
|
28578
|
+
rightDy: number;
|
|
28579
|
+
/** Cubic outgoing slope in value units per second (derived, kept for consumers that export hermite keys) */
|
|
25820
28580
|
rightSlope?: number;
|
|
25821
|
-
/** Cubic incoming slope for the next key, in value units per second */
|
|
28581
|
+
/** Cubic incoming slope for the next key, in value units per second (derived) */
|
|
25822
28582
|
nextLeftSlope?: number;
|
|
25823
28583
|
}
|
|
25824
28584
|
/** An animation curve (one axis of one property) */
|
|
@@ -25829,7 +28589,53 @@ declare namespace BABYLON {
|
|
|
25829
28589
|
keys: FBXKeyframe[];
|
|
25830
28590
|
/** True for baked sample curves that should be connected as linear samples */
|
|
25831
28591
|
isSampled?: boolean;
|
|
28592
|
+
preExtrapolation?: FBXExtrapolation;
|
|
28593
|
+
postExtrapolation?: FBXExtrapolation;
|
|
28594
|
+
}
|
|
28595
|
+
/** Raw key attribute data for one key, after run-length decoding. */
|
|
28596
|
+
export interface FBXKeyAttributes {
|
|
28597
|
+
flags: number;
|
|
28598
|
+
data: [number, number, number, number];
|
|
28599
|
+
}
|
|
28600
|
+
/**
|
|
28601
|
+
* Builds keyframes from parallel time/value arrays and their (run-length encoded) attributes, resolving every
|
|
28602
|
+
* tangent mode the FBX SDK writes: user, broken, auto (with clamp / progressive clamp / time-independent flags and
|
|
28603
|
+
* auto bias), TCB, weighted, linear and constant.
|
|
28604
|
+
*/
|
|
28605
|
+
export function buildKeyframes(times: ArrayLike<number>, values: ArrayLike<number>, attributes: (index: number) => FBXKeyAttributes): FBXKeyframe[];
|
|
28606
|
+
/** Auto tangent as the FBX SDK computes it, including clamping and auto bias. */
|
|
28607
|
+
export function solveAutoTangent(prevTime: number, time: number, nextTime: number, prevValue: number, value: number, nextValue: number, weightLeft: number, weightRight: number, autoBias: number, flags: number): number;
|
|
28608
|
+
/** Builds a keyframe list from explicit per-key slopes (legacy Takes and synthetic curves). */
|
|
28609
|
+
export function keyframesFromSlopes(times: number[], values: number[], interpolation: FBXInterpolationType[], constantNext: boolean[], leftSlope: number[], rightSlope: number[], leftWeight?: number[], rightWeight?: number[]): FBXKeyframe[];
|
|
28610
|
+
/** Reads a `Pre-Extrapolation` / `Post-Extrapolation` block: `Type` is a character code, `Repetition` a count. */
|
|
28611
|
+
export function parseExtrapolation(typeValue: unknown, repetitionValue: unknown): FBXExtrapolation;
|
|
28612
|
+
export function evaluateCurve(curve: FBXCurveData | undefined, time: number, defaultValue: number, noExtrapolation?: boolean): number;
|
|
28613
|
+
export type Vec3 = [number, number, number];
|
|
28614
|
+
export type Quat = [number, number, number, number];
|
|
28615
|
+
/** Euler angles in degrees with an FBX rotation order (0=XYZ ... 5=ZYX; spheric falls back to XYZ) to a quaternion. */
|
|
28616
|
+
export function eulerToQuat(v: Vec3, order: number): Quat;
|
|
28617
|
+
/** Quaternion to Euler angles in degrees for an FBX rotation order (inverse of eulerToQuat). */
|
|
28618
|
+
export function quatToEuler(q: Quat, order: number): Vec3;
|
|
28619
|
+
/** Blend semantics of an animation layer, derived from its BlendMode and accumulation modes. */
|
|
28620
|
+
export interface FBXLayerBlend {
|
|
28621
|
+
/** Layer participates in blending (BlendMode Additive or Override Passthrough) */
|
|
28622
|
+
blended: boolean;
|
|
28623
|
+
/** Layer adds onto the result instead of replacing it (BlendMode Additive) */
|
|
28624
|
+
additive: boolean;
|
|
28625
|
+
/** Rotations compose as quaternions (RotationAccumulationMode ByLayer) */
|
|
28626
|
+
composeRotation: boolean;
|
|
28627
|
+
/** Scales compose multiplicatively (ScaleAccumulationMode Multiply) */
|
|
28628
|
+
composeScale: boolean;
|
|
28629
|
+
/** Layer weight in [0, 1] */
|
|
28630
|
+
weight: number;
|
|
25832
28631
|
}
|
|
28632
|
+
/**
|
|
28633
|
+
* Combines one animation layer's value into the running result, exactly as the FBX SDK evaluator does.
|
|
28634
|
+
* `kind` selects the accumulation rule: "R" rotations (degrees, rotation order given), "S" scales, anything else linear.
|
|
28635
|
+
*/
|
|
28636
|
+
export function combineLayerValue(result: Vec3, value: Vec3, layer: FBXLayerBlend, kind: "T" | "R" | "S" | "other", rotationOrder: number): Vec3;
|
|
28637
|
+
|
|
28638
|
+
|
|
25833
28639
|
/** An animation curve node (T/R/S for one bone) */
|
|
25834
28640
|
export interface FBXCurveNodeData {
|
|
25835
28641
|
/** Property type: "T" (translation), "R" (rotation), "S" (scale) */
|
|
@@ -25838,13 +28644,19 @@ declare namespace BABYLON {
|
|
|
25838
28644
|
targetModelId: number;
|
|
25839
28645
|
/** Curves for each axis */
|
|
25840
28646
|
curves: FBXCurveData[];
|
|
28647
|
+
/** Index of the owning layer within the stack's layer list */
|
|
28648
|
+
layerIndex: number;
|
|
28649
|
+
/** Default channel values (`d|X`, `d|Y`, `d|Z`) used for channels without a curve */
|
|
28650
|
+
defaultValues?: [number, number, number];
|
|
25841
28651
|
}
|
|
25842
|
-
/**
|
|
28652
|
+
/** Non-transform animation curve node (property animation), evaluated by the loader when a Babylon mapping exists. */
|
|
25843
28653
|
export interface FBXUnsupportedCurveNodeData {
|
|
25844
28654
|
/** Raw AnimationCurveNode property type/name */
|
|
25845
28655
|
type: string;
|
|
25846
28656
|
/** CurveNode object ID */
|
|
25847
28657
|
id: number;
|
|
28658
|
+
/** Index of the owning layer within the stack's layer list */
|
|
28659
|
+
layerIndex: number;
|
|
25848
28660
|
/** Target object ID if the curve node is connected to an object/property */
|
|
25849
28661
|
targetId: number | null;
|
|
25850
28662
|
/** OP connection property name on the target, e.g. Visibility */
|
|
@@ -25883,6 +28695,10 @@ declare namespace BABYLON {
|
|
|
25883
28695
|
normalizedWeight: number;
|
|
25884
28696
|
/** Blend mode: 0=Additive, 1=Override, 2=OverridePassthrough */
|
|
25885
28697
|
blendMode: number;
|
|
28698
|
+
/** Resolved blend semantics used by the evaluator */
|
|
28699
|
+
blend: FBXLayerBlend;
|
|
28700
|
+
/** Animated layer weight (0-100), when the Weight property carries a curve */
|
|
28701
|
+
weightCurve?: FBXCurveData;
|
|
25886
28702
|
/** Curve nodes in this layer */
|
|
25887
28703
|
curveNodes: FBXCurveNodeData[];
|
|
25888
28704
|
/** Unsupported/non-TRS curve nodes preserved for diagnostics */
|
|
@@ -25890,6 +28706,14 @@ declare namespace BABYLON {
|
|
|
25890
28706
|
/** Recoverable layer diagnostics */
|
|
25891
28707
|
diagnostics: FBXAnimationDiagnostic[];
|
|
25892
28708
|
}
|
|
28709
|
+
/** Options for animation extraction. */
|
|
28710
|
+
export interface FBXAnimationExtractOptions {
|
|
28711
|
+
/**
|
|
28712
|
+
* Shift each clip so its first key sits at time 0 (default true). False keeps the times authored in the file, so
|
|
28713
|
+
* clips of one file stay aligned with each other and with the declared stack range.
|
|
28714
|
+
*/
|
|
28715
|
+
rebaseKeyframes?: boolean;
|
|
28716
|
+
}
|
|
25893
28717
|
/** One animation clip (AnimationStack) */
|
|
25894
28718
|
export interface FBXAnimationStackData {
|
|
25895
28719
|
/** Animation name */
|
|
@@ -25912,13 +28736,7 @@ declare namespace BABYLON {
|
|
|
25912
28736
|
/**
|
|
25913
28737
|
* Extract all animation stacks from the FBX scene.
|
|
25914
28738
|
*/
|
|
25915
|
-
export function extractAnimations(objectMap: FBXObjectMap): FBXAnimationStackData[];
|
|
25916
|
-
/**
|
|
25917
|
-
* Determines whether a key sequence appears to be a uniformly frame-baked sampled curve.
|
|
25918
|
-
* @param keys - Keyframes to inspect
|
|
25919
|
-
* @returns true if the keys look like sampled frame data rather than authored interpolation
|
|
25920
|
-
*/
|
|
25921
|
-
export function isFrameBakedSampledCurve(keys: readonly FBXKeyframe[]): boolean;
|
|
28739
|
+
export function extractAnimations(objectMap: FBXObjectMap, doc?: FBXDocument, options?: FBXAnimationExtractOptions): FBXAnimationStackData[];
|
|
25922
28740
|
/**
|
|
25923
28741
|
* Samples an FBX animation curve at a specific time.
|
|
25924
28742
|
* @param curveData - Curve data to sample
|
|
@@ -25926,6 +28744,54 @@ declare namespace BABYLON {
|
|
|
25926
28744
|
* @returns The sampled value, or null when the curve has no keys
|
|
25927
28745
|
*/
|
|
25928
28746
|
export function sampleFBXCurveAtTime(curveData: FBXCurveData | undefined, time: number): number | null;
|
|
28747
|
+
/**
|
|
28748
|
+
* Pre-7000 files store animation in a top-level `Takes` block instead of AnimationStack/Layer/CurveNode objects:
|
|
28749
|
+
*
|
|
28750
|
+
* Takes: { Take: "name" { LocalTime: start, stop
|
|
28751
|
+
* Model: "Model::joint1" { Channel: "Transform" { Channel: "T" { Channel: "X" { Default, KeyVer, KeyCount, Key } } } } } }
|
|
28752
|
+
*
|
|
28753
|
+
* Each take becomes one animation stack with a single layer. Models are matched through the same legacy string ids
|
|
28754
|
+
* that the connection resolver synthesizes for 6.x objects.
|
|
28755
|
+
*/
|
|
28756
|
+
export function extractLegacyTakes(doc: FBXDocument, objectMap: FBXObjectMap, rebaseKeyframes?: boolean): FBXAnimationStackData[];
|
|
28757
|
+
/**
|
|
28758
|
+
* Evaluates one transform channel (T, R or S) of a target at `time`, blending every animation layer of the stack the
|
|
28759
|
+
* way the FBX SDK does: the first layer animating the channel replaces the static value, later layers are combined
|
|
28760
|
+
* according to their blend mode, weight and accumulation modes.
|
|
28761
|
+
* @param curveNodes - Curve nodes targeting this model (any layers, any types)
|
|
28762
|
+
* @param layers - Stack layers, in order
|
|
28763
|
+
* @param type - Channel to evaluate
|
|
28764
|
+
* @param staticValue - Value when nothing animates the channel
|
|
28765
|
+
* @param rotationOrder - Rotation order of the target (for rotation composition)
|
|
28766
|
+
* @param time - Time in seconds
|
|
28767
|
+
*/
|
|
28768
|
+
export function evaluateLayeredChannel(curveNodes: readonly FBXCurveNodeData[], layers: readonly FBXAnimationLayerData[], type: "T" | "R" | "S", staticValue: readonly [number, number, number], rotationOrder: number, time: number): [number, number, number];
|
|
28769
|
+
/** Curves of one animated property (or blend shape weight) contributed by one animation layer. */
|
|
28770
|
+
export interface FBXLayeredPropertySource {
|
|
28771
|
+
/** Index of the owning layer within the stack's layer list */
|
|
28772
|
+
layerIndex: number;
|
|
28773
|
+
/** Curves of the property, keyed by channel name (`d|X`, `d|DeformPercent`, ...) */
|
|
28774
|
+
curves: readonly FBXCurveData[];
|
|
28775
|
+
/** Default channel values stored on the curve node */
|
|
28776
|
+
defaultValues?: Record<string, number>;
|
|
28777
|
+
}
|
|
28778
|
+
/**
|
|
28779
|
+
* Evaluates an animated property through the animation layers: the base layer replaces the static value, every
|
|
28780
|
+
* further layer blends onto the running result according to its blend mode and (possibly animated) weight, like
|
|
28781
|
+
* `evaluateLayeredChannel` does for transforms.
|
|
28782
|
+
* @param sources - Per-layer curves of the property
|
|
28783
|
+
* @param layers - Stack layers, in order
|
|
28784
|
+
* @param channels - Channel names to evaluate, in output order
|
|
28785
|
+
* @param staticValue - Value per channel when nothing animates it
|
|
28786
|
+
* @param time - Time in seconds
|
|
28787
|
+
* @returns One value per channel
|
|
28788
|
+
*/
|
|
28789
|
+
export function evaluateLayeredProperty(sources: readonly FBXLayeredPropertySource[], layers: readonly FBXAnimationLayerData[], channels: readonly string[], staticValue: readonly number[], time: number): number[];
|
|
28790
|
+
/**
|
|
28791
|
+
* True when every curve of the given channel is inside a constant (stepped) segment at `time`, so a baked key at
|
|
28792
|
+
* that time should hold its value instead of interpolating towards the next sample.
|
|
28793
|
+
*/
|
|
28794
|
+
export function isChannelSteppedAt(curveNodes: readonly FBXCurveNodeData[], type: "T" | "R" | "S", time: number): boolean;
|
|
25929
28795
|
|
|
25930
28796
|
|
|
25931
28797
|
/** Pure barrel — re-exports only side-effect-free modules */
|