babylonjs-serializers 5.49.0 → 5.49.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.glTF2Serializer.js +19 -17
- package/babylon.glTF2Serializer.js.map +1 -1
- package/babylon.glTF2Serializer.min.js +1 -1
- package/babylon.glTF2Serializer.min.js.map +1 -1
- package/babylonjs.serializers.js +19 -17
- package/babylonjs.serializers.js.map +1 -1
- package/babylonjs.serializers.min.js +1 -1
- package/babylonjs.serializers.min.js.map +1 -1
- package/package.json +3 -3
package/babylonjs.serializers.js
CHANGED
|
@@ -4536,30 +4536,32 @@ var _Exporter = /** @class */ (function () {
|
|
|
4536
4536
|
var bone = boneIndexMap[boneIndex];
|
|
4537
4537
|
inverseBindMatrices.push(bone.getInvertedAbsoluteTransform());
|
|
4538
4538
|
var transformNode = bone.getTransformNode();
|
|
4539
|
-
if (transformNode) {
|
|
4539
|
+
if (transformNode && nodeMap[transformNode.uniqueId] !== null && nodeMap[transformNode.uniqueId] !== undefined) {
|
|
4540
4540
|
skin.joints.push(nodeMap[transformNode.uniqueId]);
|
|
4541
4541
|
}
|
|
4542
4542
|
else {
|
|
4543
4543
|
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn("Exporting a bone without a linked transform node is currently unsupported");
|
|
4544
4544
|
}
|
|
4545
4545
|
}
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4546
|
+
if (skin.joints.length > 0) {
|
|
4547
|
+
// create buffer view for inverse bind matrices
|
|
4548
|
+
var byteStride = 64; // 4 x 4 matrix of 32 bit float
|
|
4549
|
+
var byteLength = inverseBindMatrices.length * byteStride;
|
|
4550
|
+
var bufferViewOffset = binaryWriter.getByteOffset();
|
|
4551
|
+
var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._CreateBufferView(0, bufferViewOffset, byteLength, undefined, "InverseBindMatrices" + " - " + skeleton.name);
|
|
4552
|
+
this._bufferViews.push(bufferView);
|
|
4553
|
+
var bufferViewIndex = this._bufferViews.length - 1;
|
|
4554
|
+
var bindMatrixAccessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._CreateAccessor(bufferViewIndex, "InverseBindMatrices" + " - " + skeleton.name, "MAT4" /* AccessorType.MAT4 */, 5126 /* AccessorComponentType.FLOAT */, inverseBindMatrices.length, null, null, null);
|
|
4555
|
+
var inverseBindAccessorIndex = this._accessors.push(bindMatrixAccessor) - 1;
|
|
4556
|
+
skin.inverseBindMatrices = inverseBindAccessorIndex;
|
|
4557
|
+
this._skins.push(skin);
|
|
4558
|
+
skinMap[skeleton.uniqueId] = this._skins.length - 1;
|
|
4559
|
+
inverseBindMatrices.forEach(function (mat) {
|
|
4560
|
+
mat.m.forEach(function (cell) {
|
|
4561
|
+
binaryWriter.setFloat32(cell);
|
|
4562
|
+
});
|
|
4561
4563
|
});
|
|
4562
|
-
}
|
|
4564
|
+
}
|
|
4563
4565
|
}
|
|
4564
4566
|
return promiseChain.then(function () {
|
|
4565
4567
|
return skinMap;
|