@babylonjs/serializers 5.0.0-rc.7 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/OBJ/index.d.ts +1 -1
  2. package/OBJ/index.js +1 -1
  3. package/OBJ/objSerializer.d.ts +21 -21
  4. package/OBJ/objSerializer.js +174 -174
  5. package/OBJ/objSerializer.js.map +1 -1
  6. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +41 -41
  7. package/glTF/2.0/Extensions/KHR_lights_punctual.js +189 -189
  8. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  9. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +24 -24
  10. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +90 -90
  11. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  12. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +24 -24
  13. package/glTF/2.0/Extensions/KHR_materials_sheen.js +73 -73
  14. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  15. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +20 -20
  16. package/glTF/2.0/Extensions/KHR_materials_unlit.js +51 -51
  17. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  18. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +30 -30
  19. package/glTF/2.0/Extensions/KHR_texture_transform.js +137 -137
  20. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  21. package/glTF/2.0/Extensions/index.d.ts +5 -5
  22. package/glTF/2.0/Extensions/index.js +5 -5
  23. package/glTF/2.0/glTFAnimation.d.ts +206 -205
  24. package/glTF/2.0/glTFAnimation.js +852 -852
  25. package/glTF/2.0/glTFAnimation.js.map +1 -1
  26. package/glTF/2.0/glTFData.d.ts +19 -19
  27. package/glTF/2.0/glTFData.js +52 -52
  28. package/glTF/2.0/glTFExporter.d.ts +456 -455
  29. package/glTF/2.0/glTFExporter.js +1975 -1972
  30. package/glTF/2.0/glTFExporter.js.map +1 -1
  31. package/glTF/2.0/glTFExporterExtension.d.ts +74 -74
  32. package/glTF/2.0/glTFExporterExtension.js +3 -3
  33. package/glTF/2.0/glTFExporterExtension.js.map +1 -1
  34. package/glTF/2.0/glTFMaterialExporter.d.ts +208 -207
  35. package/glTF/2.0/glTFMaterialExporter.js +1114 -1114
  36. package/glTF/2.0/glTFMaterialExporter.js.map +1 -1
  37. package/glTF/2.0/glTFSerializer.d.ts +60 -60
  38. package/glTF/2.0/glTFSerializer.js +62 -62
  39. package/glTF/2.0/glTFSerializer.js.map +1 -1
  40. package/glTF/2.0/glTFUtilities.d.ts +99 -97
  41. package/glTF/2.0/glTFUtilities.js +196 -196
  42. package/glTF/2.0/glTFUtilities.js.map +1 -1
  43. package/glTF/2.0/index.d.ts +8 -8
  44. package/glTF/2.0/index.js +9 -8
  45. package/glTF/2.0/index.js.map +1 -1
  46. package/glTF/2.0/shaders/textureTransform.fragment.d.ts +5 -5
  47. package/glTF/2.0/shaders/textureTransform.fragment.js +8 -8
  48. package/glTF/glTFFileExporter.d.ts +20 -20
  49. package/glTF/glTFFileExporter.js +3 -3
  50. package/glTF/index.d.ts +2 -2
  51. package/glTF/index.js +3 -2
  52. package/glTF/index.js.map +1 -1
  53. package/index.d.ts +3 -3
  54. package/index.js +4 -3
  55. package/index.js.map +1 -1
  56. package/legacy/legacy-glTF2Serializer.d.ts +2 -2
  57. package/legacy/legacy-glTF2Serializer.js +44 -43
  58. package/legacy/legacy-glTF2Serializer.js.map +1 -1
  59. package/legacy/legacy-objSerializer.d.ts +1 -1
  60. package/legacy/legacy-objSerializer.js +13 -12
  61. package/legacy/legacy-objSerializer.js.map +1 -1
  62. package/legacy/legacy-stlSerializer.d.ts +1 -1
  63. package/legacy/legacy-stlSerializer.js +13 -12
  64. package/legacy/legacy-stlSerializer.js.map +1 -1
  65. package/legacy/legacy.d.ts +4 -4
  66. package/legacy/legacy.js +6 -5
  67. package/legacy/legacy.js.map +1 -1
  68. package/license.md +71 -0
  69. package/package.json +25 -6
  70. package/stl/index.d.ts +1 -1
  71. package/stl/index.js +1 -1
  72. package/stl/stlSerializer.d.ts +17 -17
  73. package/stl/stlSerializer.js +107 -107
  74. package/stl/stlSerializer.js.map +1 -1
@@ -1,205 +1,206 @@
1
- import { AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType, IAnimation, INode, IBufferView, IAccessor } from "babylonjs-gltf2interface";
2
- import { Node } from "@babylonjs/core/node.js";
3
- import { Nullable } from "@babylonjs/core/types.js";
4
- import { Animation } from "@babylonjs/core/Animations/animation.js";
5
- import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
6
- import { Scene } from "@babylonjs/core/scene.js";
7
- import { _BinaryWriter } from "./glTFExporter";
8
- /**
9
- * @hidden
10
- * Interface to store animation data.
11
- */
12
- export interface _IAnimationData {
13
- /**
14
- * Keyframe data.
15
- */
16
- inputs: number[];
17
- /**
18
- * Value data.
19
- */
20
- outputs: number[][];
21
- /**
22
- * Animation interpolation data.
23
- */
24
- samplerInterpolation: AnimationSamplerInterpolation;
25
- /**
26
- * Minimum keyframe value.
27
- */
28
- inputsMin: number;
29
- /**
30
- * Maximum keyframe value.
31
- */
32
- inputsMax: number;
33
- }
34
- /**
35
- * @hidden
36
- */
37
- export interface _IAnimationInfo {
38
- /**
39
- * The target channel for the animation
40
- */
41
- animationChannelTargetPath: AnimationChannelTargetPath;
42
- /**
43
- * The glTF accessor type for the data.
44
- */
45
- dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
46
- /**
47
- * Specifies if quaternions should be used.
48
- */
49
- useQuaternion: boolean;
50
- }
51
- /**
52
- * @hidden
53
- * Utility class for generating glTF animation data from BabylonJS.
54
- */
55
- export declare class _GLTFAnimation {
56
- /**
57
- * @ignore
58
- *
59
- * Creates glTF channel animation from BabylonJS animation.
60
- * @param babylonTransformNode - BabylonJS mesh.
61
- * @param animation - animation.
62
- * @param animationChannelTargetPath - The target animation channel.
63
- * @param convertToRightHandedSystem - Specifies if the values should be converted to right-handed.
64
- * @param useQuaternion - Specifies if quaternions are used.
65
- * @returns nullable IAnimationData
66
- */
67
- static _CreateNodeAnimation(babylonTransformNode: TransformNode, animation: Animation, animationChannelTargetPath: AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
68
- private static _DeduceAnimationInfo;
69
- /**
70
- * @ignore
71
- * Create node animations from the transform node animations
72
- * @param babylonNode
73
- * @param runtimeGLTFAnimation
74
- * @param idleGLTFAnimations
75
- * @param nodeMap
76
- * @param nodes
77
- * @param binaryWriter
78
- * @param bufferViews
79
- * @param accessors
80
- * @param convertToRightHandedSystem
81
- * @param animationSampleRate
82
- */
83
- static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
84
- [key: number]: number;
85
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
86
- /**
87
- * @ignore
88
- * Create individual morph animations from the mesh's morph target animation tracks
89
- * @param babylonNode
90
- * @param runtimeGLTFAnimation
91
- * @param idleGLTFAnimations
92
- * @param nodeMap
93
- * @param nodes
94
- * @param binaryWriter
95
- * @param bufferViews
96
- * @param accessors
97
- * @param convertToRightHandedSystem
98
- * @param animationSampleRate
99
- */
100
- static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
101
- [key: number]: number;
102
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
103
- /**
104
- * @ignore
105
- * Create node and morph animations from the animation groups
106
- * @param babylonScene
107
- * @param glTFAnimations
108
- * @param nodeMap
109
- * @param nodes
110
- * @param binaryWriter
111
- * @param bufferViews
112
- * @param accessors
113
- * @param convertToRightHandedSystemMap
114
- * @param animationSampleRate
115
- */
116
- static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: {
117
- [key: number]: number;
118
- }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystemMap: {
119
- [nodeId: number]: boolean;
120
- }, animationSampleRate: number): void;
121
- private static _AddAnimation;
122
- /**
123
- * Create a baked animation
124
- * @param babylonTransformNode BabylonJS mesh
125
- * @param animation BabylonJS animation corresponding to the BabylonJS mesh
126
- * @param animationChannelTargetPath animation target channel
127
- * @param minFrame minimum animation frame
128
- * @param maxFrame maximum animation frame
129
- * @param fps frames per second of the animation
130
- * @param sampleRate
131
- * @param inputs input key frames of the animation
132
- * @param outputs output key frame data of the animation
133
- * @param minMaxFrames
134
- * @param minMaxFrames.min
135
- * @param minMaxFrames.max
136
- * @param convertToRightHandedSystem converts the values to right-handed
137
- * @param useQuaternion specifies if quaternions should be used
138
- */
139
- private static _CreateBakedAnimation;
140
- private static _ConvertFactorToVector3OrQuaternion;
141
- private static _SetInterpolatedValue;
142
- /**
143
- * Creates linear animation from the animation key frames
144
- * @param babylonTransformNode BabylonJS mesh
145
- * @param animation BabylonJS animation
146
- * @param animationChannelTargetPath The target animation channel
147
- * @param frameDelta The difference between the last and first frame of the animation
148
- * @param inputs Array to store the key frame times
149
- * @param outputs Array to store the key frame data
150
- * @param convertToRightHandedSystem Specifies if the position data should be converted to right handed
151
- * @param useQuaternion Specifies if quaternions are used in the animation
152
- */
153
- private static _CreateLinearOrStepAnimation;
154
- /**
155
- * Creates cubic spline animation from the animation key frames
156
- * @param babylonTransformNode BabylonJS mesh
157
- * @param animation BabylonJS animation
158
- * @param animationChannelTargetPath The target animation channel
159
- * @param frameDelta The difference between the last and first frame of the animation
160
- * @param inputs Array to store the key frame times
161
- * @param outputs Array to store the key frame data
162
- * @param convertToRightHandedSystem Specifies if the position data should be converted to right handed
163
- * @param useQuaternion Specifies if quaternions are used in the animation
164
- */
165
- private static _CreateCubicSplineAnimation;
166
- private static _GetBasePositionRotationOrScale;
167
- /**
168
- * Adds a key frame value
169
- * @param keyFrame
170
- * @param animation
171
- * @param outputs
172
- * @param animationChannelTargetPath
173
- * @param babylonTransformNode
174
- * @param convertToRightHandedSystem
175
- * @param useQuaternion
176
- */
177
- private static _AddKeyframeValue;
178
- /**
179
- * Determine the interpolation based on the key frames
180
- * @param keyFrames
181
- * @param animationChannelTargetPath
182
- * @param useQuaternion
183
- */
184
- private static _DeduceInterpolation;
185
- /**
186
- * Adds an input tangent or output tangent to the output data
187
- * If an input tangent or output tangent is missing, it uses the zero vector or zero quaternion
188
- * @param babylonTransformNode
189
- * @param tangentType Specifies which type of tangent to handle (inTangent or outTangent)
190
- * @param outputs The animation data by keyframe
191
- * @param animationChannelTargetPath The target animation channel
192
- * @param interpolation The interpolation type
193
- * @param keyFrame The key frame with the animation data
194
- * @param frameDelta Time difference between two frames used to scale the tangent by the frame delta
195
- * @param useQuaternion Specifies if quaternions are used
196
- * @param convertToRightHandedSystem Specifies if the values should be converted to right-handed
197
- */
198
- private static _AddSplineTangent;
199
- /**
200
- * Get the minimum and maximum key frames' frame values
201
- * @param keyFrames animation key frames
202
- * @returns the minimum and maximum key frame value
203
- */
204
- private static _CalculateMinMaxKeyFrames;
205
- }
1
+ import type { IAnimation, INode, IBufferView, IAccessor } from "babylonjs-gltf2interface/.js";
2
+ import { AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType } from "babylonjs-gltf2interface/.js";
3
+ import type { Node } from "@babylonjs/core/node.js";
4
+ import type { Nullable } from "@babylonjs/core/types.js";
5
+ import { Animation } from "@babylonjs/core/Animations/animation.js";
6
+ import { TransformNode } from "@babylonjs/core/Meshes/transformNode.js";
7
+ import type { Scene } from "@babylonjs/core/scene.js";
8
+ import type { _BinaryWriter } from "./glTFExporter";
9
+ /**
10
+ * @hidden
11
+ * Interface to store animation data.
12
+ */
13
+ export interface _IAnimationData {
14
+ /**
15
+ * Keyframe data.
16
+ */
17
+ inputs: number[];
18
+ /**
19
+ * Value data.
20
+ */
21
+ outputs: number[][];
22
+ /**
23
+ * Animation interpolation data.
24
+ */
25
+ samplerInterpolation: AnimationSamplerInterpolation;
26
+ /**
27
+ * Minimum keyframe value.
28
+ */
29
+ inputsMin: number;
30
+ /**
31
+ * Maximum keyframe value.
32
+ */
33
+ inputsMax: number;
34
+ }
35
+ /**
36
+ * @hidden
37
+ */
38
+ export interface _IAnimationInfo {
39
+ /**
40
+ * The target channel for the animation
41
+ */
42
+ animationChannelTargetPath: AnimationChannelTargetPath;
43
+ /**
44
+ * The glTF accessor type for the data.
45
+ */
46
+ dataAccessorType: AccessorType.VEC3 | AccessorType.VEC4 | AccessorType.SCALAR;
47
+ /**
48
+ * Specifies if quaternions should be used.
49
+ */
50
+ useQuaternion: boolean;
51
+ }
52
+ /**
53
+ * @hidden
54
+ * Utility class for generating glTF animation data from BabylonJS.
55
+ */
56
+ export declare class _GLTFAnimation {
57
+ /**
58
+ * @ignore
59
+ *
60
+ * Creates glTF channel animation from BabylonJS animation.
61
+ * @param babylonTransformNode - BabylonJS mesh.
62
+ * @param animation - animation.
63
+ * @param animationChannelTargetPath - The target animation channel.
64
+ * @param convertToRightHandedSystem - Specifies if the values should be converted to right-handed.
65
+ * @param useQuaternion - Specifies if quaternions are used.
66
+ * @returns nullable IAnimationData
67
+ */
68
+ static _CreateNodeAnimation(babylonTransformNode: TransformNode, animation: Animation, animationChannelTargetPath: AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): Nullable<_IAnimationData>;
69
+ private static _DeduceAnimationInfo;
70
+ /**
71
+ * @ignore
72
+ * Create node animations from the transform node animations
73
+ * @param babylonNode
74
+ * @param runtimeGLTFAnimation
75
+ * @param idleGLTFAnimations
76
+ * @param nodeMap
77
+ * @param nodes
78
+ * @param binaryWriter
79
+ * @param bufferViews
80
+ * @param accessors
81
+ * @param convertToRightHandedSystem
82
+ * @param animationSampleRate
83
+ */
84
+ static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
85
+ [key: number]: number;
86
+ }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
87
+ /**
88
+ * @ignore
89
+ * Create individual morph animations from the mesh's morph target animation tracks
90
+ * @param babylonNode
91
+ * @param runtimeGLTFAnimation
92
+ * @param idleGLTFAnimations
93
+ * @param nodeMap
94
+ * @param nodes
95
+ * @param binaryWriter
96
+ * @param bufferViews
97
+ * @param accessors
98
+ * @param convertToRightHandedSystem
99
+ * @param animationSampleRate
100
+ */
101
+ static _CreateMorphTargetAnimationFromMorphTargetAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: {
102
+ [key: number]: number;
103
+ }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
104
+ /**
105
+ * @ignore
106
+ * Create node and morph animations from the animation groups
107
+ * @param babylonScene
108
+ * @param glTFAnimations
109
+ * @param nodeMap
110
+ * @param nodes
111
+ * @param binaryWriter
112
+ * @param bufferViews
113
+ * @param accessors
114
+ * @param convertToRightHandedSystemMap
115
+ * @param animationSampleRate
116
+ */
117
+ static _CreateNodeAndMorphAnimationFromAnimationGroups(babylonScene: Scene, glTFAnimations: IAnimation[], nodeMap: {
118
+ [key: number]: number;
119
+ }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystemMap: {
120
+ [nodeId: number]: boolean;
121
+ }, animationSampleRate: number): void;
122
+ private static _AddAnimation;
123
+ /**
124
+ * Create a baked animation
125
+ * @param babylonTransformNode BabylonJS mesh
126
+ * @param animation BabylonJS animation corresponding to the BabylonJS mesh
127
+ * @param animationChannelTargetPath animation target channel
128
+ * @param minFrame minimum animation frame
129
+ * @param maxFrame maximum animation frame
130
+ * @param fps frames per second of the animation
131
+ * @param sampleRate
132
+ * @param inputs input key frames of the animation
133
+ * @param outputs output key frame data of the animation
134
+ * @param minMaxFrames
135
+ * @param minMaxFrames.min
136
+ * @param minMaxFrames.max
137
+ * @param convertToRightHandedSystem converts the values to right-handed
138
+ * @param useQuaternion specifies if quaternions should be used
139
+ */
140
+ private static _CreateBakedAnimation;
141
+ private static _ConvertFactorToVector3OrQuaternion;
142
+ private static _SetInterpolatedValue;
143
+ /**
144
+ * Creates linear animation from the animation key frames
145
+ * @param babylonTransformNode BabylonJS mesh
146
+ * @param animation BabylonJS animation
147
+ * @param animationChannelTargetPath The target animation channel
148
+ * @param frameDelta The difference between the last and first frame of the animation
149
+ * @param inputs Array to store the key frame times
150
+ * @param outputs Array to store the key frame data
151
+ * @param convertToRightHandedSystem Specifies if the position data should be converted to right handed
152
+ * @param useQuaternion Specifies if quaternions are used in the animation
153
+ */
154
+ private static _CreateLinearOrStepAnimation;
155
+ /**
156
+ * Creates cubic spline animation from the animation key frames
157
+ * @param babylonTransformNode BabylonJS mesh
158
+ * @param animation BabylonJS animation
159
+ * @param animationChannelTargetPath The target animation channel
160
+ * @param frameDelta The difference between the last and first frame of the animation
161
+ * @param inputs Array to store the key frame times
162
+ * @param outputs Array to store the key frame data
163
+ * @param convertToRightHandedSystem Specifies if the position data should be converted to right handed
164
+ * @param useQuaternion Specifies if quaternions are used in the animation
165
+ */
166
+ private static _CreateCubicSplineAnimation;
167
+ private static _GetBasePositionRotationOrScale;
168
+ /**
169
+ * Adds a key frame value
170
+ * @param keyFrame
171
+ * @param animation
172
+ * @param outputs
173
+ * @param animationChannelTargetPath
174
+ * @param babylonTransformNode
175
+ * @param convertToRightHandedSystem
176
+ * @param useQuaternion
177
+ */
178
+ private static _AddKeyframeValue;
179
+ /**
180
+ * Determine the interpolation based on the key frames
181
+ * @param keyFrames
182
+ * @param animationChannelTargetPath
183
+ * @param useQuaternion
184
+ */
185
+ private static _DeduceInterpolation;
186
+ /**
187
+ * Adds an input tangent or output tangent to the output data
188
+ * If an input tangent or output tangent is missing, it uses the zero vector or zero quaternion
189
+ * @param babylonTransformNode
190
+ * @param tangentType Specifies which type of tangent to handle (inTangent or outTangent)
191
+ * @param outputs The animation data by keyframe
192
+ * @param animationChannelTargetPath The target animation channel
193
+ * @param interpolation The interpolation type
194
+ * @param keyFrame The key frame with the animation data
195
+ * @param frameDelta Time difference between two frames used to scale the tangent by the frame delta
196
+ * @param useQuaternion Specifies if quaternions are used
197
+ * @param convertToRightHandedSystem Specifies if the values should be converted to right-handed
198
+ */
199
+ private static _AddSplineTangent;
200
+ /**
201
+ * Get the minimum and maximum key frames' frame values
202
+ * @param keyFrames animation key frames
203
+ * @returns the minimum and maximum key frame value
204
+ */
205
+ private static _CalculateMinMaxKeyFrames;
206
+ }