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
|
@@ -4330,30 +4330,32 @@ var _Exporter = /** @class */ (function () {
|
|
|
4330
4330
|
var bone = boneIndexMap[boneIndex];
|
|
4331
4331
|
inverseBindMatrices.push(bone.getInvertedAbsoluteTransform());
|
|
4332
4332
|
var transformNode = bone.getTransformNode();
|
|
4333
|
-
if (transformNode) {
|
|
4333
|
+
if (transformNode && nodeMap[transformNode.uniqueId] !== null && nodeMap[transformNode.uniqueId] !== undefined) {
|
|
4334
4334
|
skin.joints.push(nodeMap[transformNode.uniqueId]);
|
|
4335
4335
|
}
|
|
4336
4336
|
else {
|
|
4337
4337
|
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn("Exporting a bone without a linked transform node is currently unsupported");
|
|
4338
4338
|
}
|
|
4339
4339
|
}
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4340
|
+
if (skin.joints.length > 0) {
|
|
4341
|
+
// create buffer view for inverse bind matrices
|
|
4342
|
+
var byteStride = 64; // 4 x 4 matrix of 32 bit float
|
|
4343
|
+
var byteLength = inverseBindMatrices.length * byteStride;
|
|
4344
|
+
var bufferViewOffset = binaryWriter.getByteOffset();
|
|
4345
|
+
var bufferView = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._CreateBufferView(0, bufferViewOffset, byteLength, undefined, "InverseBindMatrices" + " - " + skeleton.name);
|
|
4346
|
+
this._bufferViews.push(bufferView);
|
|
4347
|
+
var bufferViewIndex = this._bufferViews.length - 1;
|
|
4348
|
+
var bindMatrixAccessor = _glTFUtilities__WEBPACK_IMPORTED_MODULE_3__._GLTFUtilities._CreateAccessor(bufferViewIndex, "InverseBindMatrices" + " - " + skeleton.name, "MAT4" /* AccessorType.MAT4 */, 5126 /* AccessorComponentType.FLOAT */, inverseBindMatrices.length, null, null, null);
|
|
4349
|
+
var inverseBindAccessorIndex = this._accessors.push(bindMatrixAccessor) - 1;
|
|
4350
|
+
skin.inverseBindMatrices = inverseBindAccessorIndex;
|
|
4351
|
+
this._skins.push(skin);
|
|
4352
|
+
skinMap[skeleton.uniqueId] = this._skins.length - 1;
|
|
4353
|
+
inverseBindMatrices.forEach(function (mat) {
|
|
4354
|
+
mat.m.forEach(function (cell) {
|
|
4355
|
+
binaryWriter.setFloat32(cell);
|
|
4356
|
+
});
|
|
4355
4357
|
});
|
|
4356
|
-
}
|
|
4358
|
+
}
|
|
4357
4359
|
}
|
|
4358
4360
|
return promiseChain.then(function () {
|
|
4359
4361
|
return skinMap;
|