babylonjs-loaders 5.5.6 → 5.7.0

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.
@@ -4214,8 +4214,14 @@ var GLTFLoader = /** @class */ (function () {
4214
4214
  // transform, which effectively ignores the transform of the skinned mesh, as per spec.
4215
4215
  var mesh = ArrayItem.Get("".concat(context, "/mesh"), this._gltf.meshes, node.mesh);
4216
4216
  promises.push(this._loadMeshAsync("/meshes/".concat(mesh.index), node, mesh, function (babylonTransformNode) {
4217
- // Duplicate the metadata from the skin node to the skinned mesh in case any loader extension added metadata.
4218
- babylonTransformNode.metadata = node._babylonTransformNodeForSkin.metadata;
4217
+ var babylonTransformNodeForSkin = node._babylonTransformNodeForSkin;
4218
+ // Add a reference to the skinned mesh from the transform node.
4219
+ var gltf = babylonTransformNodeForSkin.metadata.gltf;
4220
+ gltf.skinnedMesh = babylonTransformNode;
4221
+ babylonTransformNode.onDisposeObservable.addOnce(function () {
4222
+ // Delete the reference when the skinned mesh is disposed.
4223
+ delete gltf.skinnedMesh;
4224
+ });
4219
4225
  var skin = ArrayItem.Get("".concat(context, "/skin"), _this._gltf.skins, node.skin);
4220
4226
  promises.push(_this._loadSkinAsync("/skins/".concat(skin.index), node, skin, function (babylonSkeleton) {
4221
4227
  _this._forEachPrimitive(node, function (babylonMesh) {