@babylonjs/serializers
Advanced tools
Comparing version 4.0.0-alpha.22 to 4.0.0-alpha.24
export * from "./KHR_texture_transform"; | ||
export * from "./KHR_lights_punctual"; |
export * from "./KHR_texture_transform"; | ||
export * from "./KHR_lights_punctual"; | ||
//# sourceMappingURL=index.js.map |
import { AnimationSamplerInterpolation, AnimationChannelTargetPath, AccessorType, IAnimation, INode, IBufferView, IAccessor } from "babylonjs-gltf2interface"; | ||
import { Node } from "@babylonjs/core/node"; | ||
import { Nullable } from "@babylonjs/core/types"; | ||
@@ -71,3 +72,3 @@ import { Animation } from "@babylonjs/core/Animations/animation"; | ||
* Create node animations from the transform node animations | ||
* @param babylonTransformNode | ||
* @param babylonNode | ||
* @param runtimeGLTFAnimation | ||
@@ -82,3 +83,3 @@ * @param idleGLTFAnimations | ||
*/ | ||
static _CreateNodeAnimationFromTransformNodeAnimations(babylonTransformNode: TransformNode, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: { | ||
static _CreateNodeAnimationFromNodeAnimations(babylonNode: Node, runtimeGLTFAnimation: IAnimation, idleGLTFAnimations: IAnimation[], nodeMap: { | ||
[key: number]: number; | ||
@@ -85,0 +86,0 @@ }, nodes: INode[], binaryWriter: _BinaryWriter, bufferViews: IBufferView[], accessors: IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void; |
import { Vector3, Quaternion } from "@babylonjs/core/Maths/math"; | ||
import { Tools } from "@babylonjs/core/Misc/tools"; | ||
import { Animation } from "@babylonjs/core/Animations/animation"; | ||
import { TransformNode } from "@babylonjs/core/Meshes/transformNode"; | ||
import { Mesh } from "@babylonjs/core/Meshes/mesh"; | ||
@@ -115,3 +116,3 @@ import { _GLTFUtilities } from "./glTFUtilities"; | ||
* Create node animations from the transform node animations | ||
* @param babylonTransformNode | ||
* @param babylonNode | ||
* @param runtimeGLTFAnimation | ||
@@ -126,17 +127,19 @@ * @param idleGLTFAnimations | ||
*/ | ||
_GLTFAnimation._CreateNodeAnimationFromTransformNodeAnimations = function (babylonTransformNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) { | ||
_GLTFAnimation._CreateNodeAnimationFromNodeAnimations = function (babylonNode, runtimeGLTFAnimation, idleGLTFAnimations, nodeMap, nodes, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationSampleRate) { | ||
var glTFAnimation; | ||
if (babylonTransformNode.animations) { | ||
for (var _i = 0, _a = babylonTransformNode.animations; _i < _a.length; _i++) { | ||
var animation = _a[_i]; | ||
var animationInfo = _GLTFAnimation._DeduceAnimationInfo(animation); | ||
if (animationInfo) { | ||
glTFAnimation = { | ||
name: animation.name, | ||
samplers: [], | ||
channels: [] | ||
}; | ||
_GLTFAnimation.AddAnimation("" + animation.name, animation.hasRunningRuntimeAnimations ? runtimeGLTFAnimation : glTFAnimation, babylonTransformNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate); | ||
if (glTFAnimation.samplers.length && glTFAnimation.channels.length) { | ||
idleGLTFAnimations.push(glTFAnimation); | ||
if (babylonNode instanceof TransformNode) { | ||
if (babylonNode.animations) { | ||
for (var _i = 0, _a = babylonNode.animations; _i < _a.length; _i++) { | ||
var animation = _a[_i]; | ||
var animationInfo = _GLTFAnimation._DeduceAnimationInfo(animation); | ||
if (animationInfo) { | ||
glTFAnimation = { | ||
name: animation.name, | ||
samplers: [], | ||
channels: [] | ||
}; | ||
_GLTFAnimation.AddAnimation("" + animation.name, animation.hasRunningRuntimeAnimations ? runtimeGLTFAnimation : glTFAnimation, babylonNode, animation, animationInfo.dataAccessorType, animationInfo.animationChannelTargetPath, nodeMap, binaryWriter, bufferViews, accessors, convertToRightHandedSystem, animationInfo.useQuaternion, animationSampleRate); | ||
if (glTFAnimation.samplers.length && glTFAnimation.channels.length) { | ||
idleGLTFAnimations.push(glTFAnimation); | ||
} | ||
} | ||
@@ -143,0 +146,0 @@ } |
@@ -1,4 +0,5 @@ | ||
import { IBufferView, IAccessor, IMaterial, ITexture, IImage, ISampler, ImageMimeType, IMeshPrimitive } from "babylonjs-gltf2interface"; | ||
import { IBufferView, IAccessor, INode, IMaterial, ITexture, IImage, ISampler, ImageMimeType, IMeshPrimitive, IGLTF } from "babylonjs-gltf2interface"; | ||
import { FloatArray, Nullable } from "@babylonjs/core/types"; | ||
import { Vector3, Vector4 } from "@babylonjs/core/Maths/math"; | ||
import { Node } from "@babylonjs/core/node"; | ||
import { SubMesh } from "@babylonjs/core/Meshes/subMesh"; | ||
@@ -19,2 +20,6 @@ import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture"; | ||
/** | ||
* Stores the glTF to export | ||
*/ | ||
_glTF: IGLTF; | ||
/** | ||
* Stores all generated buffer views, which represents views into the main glTF buffer data | ||
@@ -32,6 +37,2 @@ */ | ||
/** | ||
* Stores the glTF asset information, which represents the glTF version and this file generator | ||
*/ | ||
private _asset; | ||
/** | ||
* Stores all the generated glTF scenes, which stores multiple node hierarchies | ||
@@ -77,3 +78,3 @@ */ | ||
*/ | ||
private _babylonScene; | ||
_babylonScene: Scene; | ||
/** | ||
@@ -96,3 +97,3 @@ * Stores a map of the image data, where the key is the file name and the value | ||
*/ | ||
private _convertToRightHandedSystem; | ||
_convertToRightHandedSystem: boolean; | ||
/** | ||
@@ -103,10 +104,8 @@ * Baked animation sample rate | ||
/** | ||
* Callback which specifies if a transform node should be exported or not | ||
* Callback which specifies if a node should be exported or not | ||
*/ | ||
private _shouldExportTransformNode; | ||
private _shouldExportNode; | ||
private _localEngine; | ||
_glTFMaterialExporter: _GLTFMaterialExporter; | ||
private _extensions; | ||
private _extensionsUsed; | ||
private _extensionsRequired; | ||
private static _ExtensionNames; | ||
@@ -117,2 +116,5 @@ private static _ExtensionFactories; | ||
_extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Nullable<Promise<IMeshPrimitive>>; | ||
_extensionsPostExportNodeAsync(context: string, node: INode, babylonNode: Node): Nullable<Promise<INode>>; | ||
private _forEachExtensions; | ||
private _extensionsOnExporting; | ||
/** | ||
@@ -293,3 +295,3 @@ * Load glTF serializer extensions | ||
* @param nodes Babylon transform nodes | ||
* @param shouldExportTransformNode Callback specifying if a transform node should be exported | ||
* @param shouldExportNode Callback specifying if a transform node should be exported | ||
* @param binaryWriter Buffer to write binary data to | ||
@@ -296,0 +298,0 @@ * @returns Node mapping of unique id to index |
@@ -1,2 +0,3 @@ | ||
import { ImageMimeType, IMeshPrimitive } from "babylonjs-gltf2interface"; | ||
import { ImageMimeType, IMeshPrimitive, INode } from "babylonjs-gltf2interface"; | ||
import { Node } from "@babylonjs/core/node"; | ||
import { Nullable } from "@babylonjs/core/types"; | ||
@@ -29,4 +30,17 @@ import { Texture } from "@babylonjs/core/Materials/Textures/texture"; | ||
* @param binaryWriter glTF serializer binary writer instance | ||
* @returns nullable IMeshPrimitive promise | ||
*/ | ||
postExportMeshPrimitiveAsync?(context: string, meshPrimitive: IMeshPrimitive, babylonSubMesh: SubMesh, binaryWriter: _BinaryWriter): Nullable<Promise<IMeshPrimitive>>; | ||
/** | ||
* Define this method to modify the default behavior when exporting a node | ||
* @param context The context when exporting the node | ||
* @param node glTF node | ||
* @param babylonNode BabylonJS node | ||
* @returns nullable INode promise | ||
*/ | ||
postExportNodeAsync?(context: string, node: INode, babylonNode: Node): Nullable<Promise<INode>>; | ||
/** | ||
* Called after the exporter state changes to EXPORTING | ||
*/ | ||
onExporting?(): void; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { TransformNode } from "@babylonjs/core/Meshes/transformNode"; | ||
import { Node } from "@babylonjs/core/node"; | ||
import { Scene } from "@babylonjs/core/scene"; | ||
@@ -9,7 +9,7 @@ import { GLTFData } from "./glTFData"; | ||
/** | ||
* Function which indicates whether a babylon mesh should be exported or not | ||
* @param transformNode source Babylon transform node. It is used to check whether it should be exported to glTF or not | ||
* @returns boolean, which indicates whether the mesh should be exported (true) or not (false) | ||
* Function which indicates whether a babylon node should be exported or not | ||
* @param node source Babylon node. It is used to check whether it should be exported to glTF or not | ||
* @returns boolean, which indicates whether the node should be exported (true) or not (false) | ||
*/ | ||
shouldExportTransformNode?(transformNode: TransformNode): boolean; | ||
shouldExportNode?(node: Node): boolean; | ||
/** | ||
@@ -16,0 +16,0 @@ * The sample rate to bake animation curves |
@@ -7,3 +7,3 @@ { | ||
"description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.", | ||
"version": "4.0.0-alpha.22", | ||
"version": "4.0.0-alpha.24", | ||
"repository": { | ||
@@ -18,2 +18,5 @@ "type": "git", | ||
"glTF/2.0/Extensions/index.js.map", | ||
"glTF/2.0/Extensions/KHR_lights_punctual.d.ts", | ||
"glTF/2.0/Extensions/KHR_lights_punctual.js", | ||
"glTF/2.0/Extensions/KHR_lights_punctual.js.map", | ||
"glTF/2.0/Extensions/KHR_texture_transform.d.ts", | ||
@@ -85,4 +88,4 @@ "glTF/2.0/Extensions/KHR_texture_transform.js", | ||
"dependencies": { | ||
"@babylonjs/core": "4.0.0-alpha.22", | ||
"babylonjs-gltf2interface": "4.0.0-alpha.22", | ||
"@babylonjs/core": "4.0.0-alpha.24", | ||
"babylonjs-gltf2interface": "4.0.0-alpha.24", | ||
"tslib": "^1.9.3" | ||
@@ -89,0 +92,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
604442
62
5012
+ Added@babylonjs/core@4.0.0-alpha.24(transitive)
+ Addedbabylonjs-gltf2interface@4.0.0-alpha.24(transitive)
- Removed@babylonjs/core@4.0.0-alpha.22(transitive)
- Removedbabylonjs-gltf2interface@4.0.0-alpha.22(transitive)