@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/FBX/fbxConstraintBehavior.d.ts +188 -0
- package/FBX/fbxConstraintBehavior.js +532 -0
- package/FBX/fbxConstraintBehavior.js.map +1 -0
- package/FBX/fbxFileLoader.pure.d.ts +175 -6
- package/FBX/fbxFileLoader.pure.js +1521 -286
- package/FBX/fbxFileLoader.pure.js.map +1 -1
- package/FBX/index.d.ts +4 -1
- package/FBX/index.js +1 -0
- package/FBX/index.js.map +1 -1
- package/FBX/interpreter/animation.d.ts +73 -33
- package/FBX/interpreter/animation.js +620 -223
- package/FBX/interpreter/animation.js.map +1 -1
- package/FBX/interpreter/animationCurve.d.ts +91 -0
- package/FBX/interpreter/animationCurve.js +623 -0
- package/FBX/interpreter/animationCurve.js.map +1 -0
- package/FBX/interpreter/blendShapes.js +9 -18
- package/FBX/interpreter/blendShapes.js.map +1 -1
- package/FBX/interpreter/connections.d.ts +1 -1
- package/FBX/interpreter/connections.js +173 -34
- package/FBX/interpreter/connections.js.map +1 -1
- package/FBX/interpreter/constraints.d.ts +68 -0
- package/FBX/interpreter/constraints.js +143 -0
- package/FBX/interpreter/constraints.js.map +1 -0
- package/FBX/interpreter/fbxInterpreter.d.ts +89 -4
- package/FBX/interpreter/fbxInterpreter.js +474 -122
- package/FBX/interpreter/fbxInterpreter.js.map +1 -1
- package/FBX/interpreter/geometry.d.ts +1 -1
- package/FBX/interpreter/geometry.js +150 -92
- package/FBX/interpreter/geometry.js.map +1 -1
- package/FBX/interpreter/legacyDocument.d.ts +11 -0
- package/FBX/interpreter/legacyDocument.js +425 -0
- package/FBX/interpreter/legacyDocument.js.map +1 -0
- package/FBX/interpreter/materialModel.d.ts +71 -0
- package/FBX/interpreter/materialModel.js +622 -0
- package/FBX/interpreter/materialModel.js.map +1 -0
- package/FBX/interpreter/materials.d.ts +13 -1
- package/FBX/interpreter/materials.js +88 -5
- package/FBX/interpreter/materials.js.map +1 -1
- package/FBX/interpreter/nodeTransform.d.ts +32 -0
- package/FBX/interpreter/nodeTransform.js +54 -0
- package/FBX/interpreter/nodeTransform.js.map +1 -0
- package/FBX/interpreter/nurbs.d.ts +99 -0
- package/FBX/interpreter/nurbs.js +627 -0
- package/FBX/interpreter/nurbs.js.map +1 -0
- package/FBX/interpreter/propertyTemplates.d.ts +23 -0
- package/FBX/interpreter/propertyTemplates.js +109 -2
- package/FBX/interpreter/propertyTemplates.js.map +1 -1
- package/FBX/interpreter/rig.js +16 -0
- package/FBX/interpreter/rig.js.map +1 -1
- package/FBX/interpreter/sceneDiagnostics.js +28 -3
- package/FBX/interpreter/sceneDiagnostics.js.map +1 -1
- package/FBX/interpreter/skeleton.d.ts +4 -18
- package/FBX/interpreter/skeleton.js +16 -94
- package/FBX/interpreter/skeleton.js.map +1 -1
- package/FBX/parsers/fbxAsciiParser.js +119 -9
- package/FBX/parsers/fbxAsciiParser.js.map +1 -1
- package/FBX/parsers/fbxBinaryParser.js +74 -22
- package/FBX/parsers/fbxBinaryParser.js.map +1 -1
- package/FBX/pure.d.ts +1 -0
- package/FBX/pure.js +1 -0
- package/FBX/pure.js.map +1 -1
- package/FBX/types/fbxTypes.d.ts +18 -2
- package/FBX/types/fbxTypes.js +40 -12
- package/FBX/types/fbxTypes.js.map +1 -1
- package/SPLAT/gaussianSplattingStream.d.ts +79 -25
- package/SPLAT/gaussianSplattingStream.js +320 -95
- package/SPLAT/gaussianSplattingStream.js.map +1 -1
- package/USD/usdCommandProtocol.d.ts +20 -4
- package/USD/usdCommandProtocol.js +25 -3
- package/USD/usdCommandProtocol.js.map +1 -1
- package/USD/usdFileLoader.pure.js +2 -0
- package/USD/usdFileLoader.pure.js.map +1 -1
- package/USD/usdSceneMaterializer.js +430 -92
- package/USD/usdSceneMaterializer.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +110 -3
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +468 -74
- package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.d.ts +47 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js +68 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +2 -2
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.d.ts +24 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js +38 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.d.ts +41 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js +63 -0
- package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +5 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.js +5 -0
- package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.d.ts +112 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js +773 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +18 -10
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +299 -54
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.d.ts +2 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js +7 -2
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.d.ts +24 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js +89 -0
- package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js.map +1 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.d.ts +5 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.js +5 -0
- package/glTF/2.0/Extensions/KHR_interactivity/pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.pure.d.ts +55 -1
- package/glTF/2.0/Extensions/KHR_interactivity.pure.js +124 -76
- package/glTF/2.0/Extensions/KHR_interactivity.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_interactivity.types.d.ts +18 -1
- package/glTF/2.0/Extensions/KHR_interactivity.types.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.d.ts +2 -0
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js +114 -56
- package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js.map +1 -1
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.d.ts +2 -0
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.js +80 -35
- package/glTF/2.0/Extensions/KHR_node_selectability.pure.js.map +1 -1
- package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js +3 -2
- package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js.map +1 -1
- package/glTF/2.0/Extensions/objectModelMapping.d.ts +4 -2
- package/glTF/2.0/Extensions/objectModelMapping.js +33 -4
- package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -1
- package/glTF/2.0/glTFLoader.pure.d.ts +1 -1
- package/glTF/2.0/glTFLoader.pure.js +9 -4
- package/glTF/2.0/glTFLoader.pure.js.map +1 -1
- package/glTF/2.0/glTFLoaderExtension.d.ts +2 -1
- package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
- package/package.json +3 -3
package/FBX/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { FBXFileLoader } from "./fbxFileLoader.js";
|
|
2
|
-
export type { FBXFileLoaderOptions, FBXNormalMapCoordinateSystem } from "./fbxFileLoader.js";
|
|
2
|
+
export type { FBXFileLoaderOptions, FBXNormalMapCoordinateSystem, FBXLoaderWarning } from "./fbxFileLoader.js";
|
|
3
3
|
export { FBXFileLoaderMetadata } from "./fbxFileLoader.metadata.js";
|
|
4
|
+
export { FBXConstraintBehavior, FBXConstraintSolver } from "./fbxConstraintBehavior.js";
|
|
5
|
+
export type { FBXConstraintBehaviorOptions, FBXConstraintBehaviorTarget } from "./fbxConstraintBehavior.js";
|
|
6
|
+
export type { FBXConstraintData, FBXConstraintTarget, FBXConstraintType } from "./interpreter/constraints.js";
|
package/FBX/index.js
CHANGED
package/FBX/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/loaders/src/FBX/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export { FBXFileLoader } from \"./fbxFileLoader\";\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/loaders/src/FBX/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { FBXFileLoader } from \"./fbxFileLoader\";\nexport type { FBXFileLoaderOptions, FBXNormalMapCoordinateSystem, FBXLoaderWarning } from \"./fbxFileLoader\";\nexport { FBXFileLoaderMetadata } from \"./fbxFileLoader.metadata\";\nexport { FBXConstraintBehavior, FBXConstraintSolver } from \"./fbxConstraintBehavior\";\nexport type { FBXConstraintBehaviorOptions, FBXConstraintBehaviorTarget } from \"./fbxConstraintBehavior\";\nexport type { FBXConstraintData, FBXConstraintTarget, FBXConstraintType } from \"./interpreter/constraints\";\n"]}
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
+
import { type FBXDocument } from "../types/fbxTypes.js";
|
|
1
2
|
import { type FBXObjectMap } from "./connections.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
time: number;
|
|
7
|
-
/** Value at this keyframe */
|
|
8
|
-
value: number;
|
|
9
|
-
/** Interpolation used from this key to the next key */
|
|
10
|
-
interpolation: FBXInterpolationType;
|
|
11
|
-
/** Constant interpolation variant */
|
|
12
|
-
constantMode?: "standard" | "next";
|
|
13
|
-
/** Cubic outgoing slope in value units per second */
|
|
14
|
-
rightSlope?: number;
|
|
15
|
-
/** Cubic incoming slope for the next key, in value units per second */
|
|
16
|
-
nextLeftSlope?: number;
|
|
17
|
-
}
|
|
18
|
-
/** An animation curve (one axis of one property) */
|
|
19
|
-
export interface FBXCurveData {
|
|
20
|
-
/** Channel: "d|X", "d|Y", "d|Z" */
|
|
21
|
-
channel: string;
|
|
22
|
-
/** Keyframes */
|
|
23
|
-
keys: FBXKeyframe[];
|
|
24
|
-
/** True for baked sample curves that should be connected as linear samples */
|
|
25
|
-
isSampled?: boolean;
|
|
26
|
-
}
|
|
3
|
+
import { type FBXCurveData, type FBXLayerBlend } from "./animationCurve.js";
|
|
4
|
+
export { FBX_TIME_UNIT } from "./animationCurve.js";
|
|
5
|
+
export type { FBXCurveData, FBXExtrapolation, FBXExtrapolationMode, FBXInterpolationType, FBXKeyframe, FBXLayerBlend } from "./animationCurve.js";
|
|
6
|
+
export { combineLayerValue, evaluateCurve, eulerToQuat, quatToEuler } from "./animationCurve.js";
|
|
27
7
|
/** An animation curve node (T/R/S for one bone) */
|
|
28
8
|
export interface FBXCurveNodeData {
|
|
29
9
|
/** Property type: "T" (translation), "R" (rotation), "S" (scale) */
|
|
@@ -32,13 +12,19 @@ export interface FBXCurveNodeData {
|
|
|
32
12
|
targetModelId: number;
|
|
33
13
|
/** Curves for each axis */
|
|
34
14
|
curves: FBXCurveData[];
|
|
15
|
+
/** Index of the owning layer within the stack's layer list */
|
|
16
|
+
layerIndex: number;
|
|
17
|
+
/** Default channel values (`d|X`, `d|Y`, `d|Z`) used for channels without a curve */
|
|
18
|
+
defaultValues?: [number, number, number];
|
|
35
19
|
}
|
|
36
|
-
/**
|
|
20
|
+
/** Non-transform animation curve node (property animation), evaluated by the loader when a Babylon mapping exists. */
|
|
37
21
|
export interface FBXUnsupportedCurveNodeData {
|
|
38
22
|
/** Raw AnimationCurveNode property type/name */
|
|
39
23
|
type: string;
|
|
40
24
|
/** CurveNode object ID */
|
|
41
25
|
id: number;
|
|
26
|
+
/** Index of the owning layer within the stack's layer list */
|
|
27
|
+
layerIndex: number;
|
|
42
28
|
/** Target object ID if the curve node is connected to an object/property */
|
|
43
29
|
targetId: number | null;
|
|
44
30
|
/** OP connection property name on the target, e.g. Visibility */
|
|
@@ -77,6 +63,10 @@ export interface FBXAnimationLayerData {
|
|
|
77
63
|
normalizedWeight: number;
|
|
78
64
|
/** Blend mode: 0=Additive, 1=Override, 2=OverridePassthrough */
|
|
79
65
|
blendMode: number;
|
|
66
|
+
/** Resolved blend semantics used by the evaluator */
|
|
67
|
+
blend: FBXLayerBlend;
|
|
68
|
+
/** Animated layer weight (0-100), when the Weight property carries a curve */
|
|
69
|
+
weightCurve?: FBXCurveData;
|
|
80
70
|
/** Curve nodes in this layer */
|
|
81
71
|
curveNodes: FBXCurveNodeData[];
|
|
82
72
|
/** Unsupported/non-TRS curve nodes preserved for diagnostics */
|
|
@@ -84,6 +74,14 @@ export interface FBXAnimationLayerData {
|
|
|
84
74
|
/** Recoverable layer diagnostics */
|
|
85
75
|
diagnostics: FBXAnimationDiagnostic[];
|
|
86
76
|
}
|
|
77
|
+
/** Options for animation extraction. */
|
|
78
|
+
export interface FBXAnimationExtractOptions {
|
|
79
|
+
/**
|
|
80
|
+
* Shift each clip so its first key sits at time 0 (default true). False keeps the times authored in the file, so
|
|
81
|
+
* clips of one file stay aligned with each other and with the declared stack range.
|
|
82
|
+
*/
|
|
83
|
+
rebaseKeyframes?: boolean;
|
|
84
|
+
}
|
|
87
85
|
/** One animation clip (AnimationStack) */
|
|
88
86
|
export interface FBXAnimationStackData {
|
|
89
87
|
/** Animation name */
|
|
@@ -106,13 +104,7 @@ export interface FBXAnimationStackData {
|
|
|
106
104
|
/**
|
|
107
105
|
* Extract all animation stacks from the FBX scene.
|
|
108
106
|
*/
|
|
109
|
-
export declare function extractAnimations(objectMap: FBXObjectMap): FBXAnimationStackData[];
|
|
110
|
-
/**
|
|
111
|
-
* Determines whether a key sequence appears to be a uniformly frame-baked sampled curve.
|
|
112
|
-
* @param keys - Keyframes to inspect
|
|
113
|
-
* @returns true if the keys look like sampled frame data rather than authored interpolation
|
|
114
|
-
*/
|
|
115
|
-
export declare function isFrameBakedSampledCurve(keys: readonly FBXKeyframe[]): boolean;
|
|
107
|
+
export declare function extractAnimations(objectMap: FBXObjectMap, doc?: FBXDocument, options?: FBXAnimationExtractOptions): FBXAnimationStackData[];
|
|
116
108
|
/**
|
|
117
109
|
* Samples an FBX animation curve at a specific time.
|
|
118
110
|
* @param curveData - Curve data to sample
|
|
@@ -120,3 +112,51 @@ export declare function isFrameBakedSampledCurve(keys: readonly FBXKeyframe[]):
|
|
|
120
112
|
* @returns The sampled value, or null when the curve has no keys
|
|
121
113
|
*/
|
|
122
114
|
export declare function sampleFBXCurveAtTime(curveData: FBXCurveData | undefined, time: number): number | null;
|
|
115
|
+
/**
|
|
116
|
+
* Pre-7000 files store animation in a top-level `Takes` block instead of AnimationStack/Layer/CurveNode objects:
|
|
117
|
+
*
|
|
118
|
+
* Takes: { Take: "name" { LocalTime: start, stop
|
|
119
|
+
* Model: "Model::joint1" { Channel: "Transform" { Channel: "T" { Channel: "X" { Default, KeyVer, KeyCount, Key } } } } } }
|
|
120
|
+
*
|
|
121
|
+
* Each take becomes one animation stack with a single layer. Models are matched through the same legacy string ids
|
|
122
|
+
* that the connection resolver synthesizes for 6.x objects.
|
|
123
|
+
*/
|
|
124
|
+
export declare function extractLegacyTakes(doc: FBXDocument, objectMap: FBXObjectMap, rebaseKeyframes?: boolean): FBXAnimationStackData[];
|
|
125
|
+
/**
|
|
126
|
+
* Evaluates one transform channel (T, R or S) of a target at `time`, blending every animation layer of the stack the
|
|
127
|
+
* way the FBX SDK does: the first layer animating the channel replaces the static value, later layers are combined
|
|
128
|
+
* according to their blend mode, weight and accumulation modes.
|
|
129
|
+
* @param curveNodes - Curve nodes targeting this model (any layers, any types)
|
|
130
|
+
* @param layers - Stack layers, in order
|
|
131
|
+
* @param type - Channel to evaluate
|
|
132
|
+
* @param staticValue - Value when nothing animates the channel
|
|
133
|
+
* @param rotationOrder - Rotation order of the target (for rotation composition)
|
|
134
|
+
* @param time - Time in seconds
|
|
135
|
+
*/
|
|
136
|
+
export declare function evaluateLayeredChannel(curveNodes: readonly FBXCurveNodeData[], layers: readonly FBXAnimationLayerData[], type: "T" | "R" | "S", staticValue: readonly [number, number, number], rotationOrder: number, time: number): [number, number, number];
|
|
137
|
+
/** Curves of one animated property (or blend shape weight) contributed by one animation layer. */
|
|
138
|
+
export interface FBXLayeredPropertySource {
|
|
139
|
+
/** Index of the owning layer within the stack's layer list */
|
|
140
|
+
layerIndex: number;
|
|
141
|
+
/** Curves of the property, keyed by channel name (`d|X`, `d|DeformPercent`, ...) */
|
|
142
|
+
curves: readonly FBXCurveData[];
|
|
143
|
+
/** Default channel values stored on the curve node */
|
|
144
|
+
defaultValues?: Record<string, number>;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Evaluates an animated property through the animation layers: the base layer replaces the static value, every
|
|
148
|
+
* further layer blends onto the running result according to its blend mode and (possibly animated) weight, like
|
|
149
|
+
* `evaluateLayeredChannel` does for transforms.
|
|
150
|
+
* @param sources - Per-layer curves of the property
|
|
151
|
+
* @param layers - Stack layers, in order
|
|
152
|
+
* @param channels - Channel names to evaluate, in output order
|
|
153
|
+
* @param staticValue - Value per channel when nothing animates it
|
|
154
|
+
* @param time - Time in seconds
|
|
155
|
+
* @returns One value per channel
|
|
156
|
+
*/
|
|
157
|
+
export declare function evaluateLayeredProperty(sources: readonly FBXLayeredPropertySource[], layers: readonly FBXAnimationLayerData[], channels: readonly string[], staticValue: readonly number[], time: number): number[];
|
|
158
|
+
/**
|
|
159
|
+
* True when every curve of the given channel is inside a constant (stepped) segment at `time`, so a baked key at
|
|
160
|
+
* that time should hold its value instead of interpolating towards the next sample.
|
|
161
|
+
*/
|
|
162
|
+
export declare function isChannelSteppedAt(curveNodes: readonly FBXCurveNodeData[], type: "T" | "R" | "S", time: number): boolean;
|