|
@@ -179840,17 +179840,18 @@ var AssetContainer = /** @class */ (function (_super) {
|
|
return rootMesh;
|
|
return rootMesh;
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
- * Merge animations from this asset container into a scene
|
|
|
|
|
|
+ * Merge animations (direct and animation groups) from this asset container into a scene
|
|
* @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
|
|
* @param scene is the instance of BABYLON.Scene to append to (default: last created scene)
|
|
* @param animatables set of animatables to retarget to a node from the scene
|
|
* @param animatables set of animatables to retarget to a node from the scene
|
|
* @param targetConverter defines a function used to convert animation targets from the asset container to the scene (default: search node by name)
|
|
* @param targetConverter defines a function used to convert animation targets from the asset container to the scene (default: search node by name)
|
|
|
|
+ * @returns an array of the new AnimationGroup added to the scene (empty array if none)
|
|
*/
|
|
*/
|
|
AssetContainer.prototype.mergeAnimationsTo = function (scene, animatables, targetConverter) {
|
|
AssetContainer.prototype.mergeAnimationsTo = function (scene, animatables, targetConverter) {
|
|
if (scene === void 0) { scene = _Engines_engineStore__WEBPACK_IMPORTED_MODULE_4__["EngineStore"].LastCreatedScene; }
|
|
if (scene === void 0) { scene = _Engines_engineStore__WEBPACK_IMPORTED_MODULE_4__["EngineStore"].LastCreatedScene; }
|
|
if (targetConverter === void 0) { targetConverter = null; }
|
|
if (targetConverter === void 0) { targetConverter = null; }
|
|
if (!scene) {
|
|
if (!scene) {
|
|
_Misc_logger__WEBPACK_IMPORTED_MODULE_3__["Logger"].Error("No scene available to merge animations to");
|
|
_Misc_logger__WEBPACK_IMPORTED_MODULE_3__["Logger"].Error("No scene available to merge animations to");
|
|
- return;
|
|
|
|
|
|
+ return [];
|
|
}
|
|
}
|
|
var _targetConverter = targetConverter ? targetConverter : function (target) {
|
|
var _targetConverter = targetConverter ? targetConverter : function (target) {
|
|
var node = null;
|
|
var node = null;
|
|
@@ -179904,10 +179905,11 @@ var AssetContainer = /** @class */ (function (_super) {
|
|
nodeInScene.animations = nodeInScene.animations.concat(nodeInAC.animations);
|
|
nodeInScene.animations = nodeInScene.animations.concat(nodeInAC.animations);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ var newAnimationGroups = new Array();
|
|
// Copy new animation groups
|
|
// Copy new animation groups
|
|
this.animationGroups.slice().forEach(function (animationGroupInAC) {
|
|
this.animationGroups.slice().forEach(function (animationGroupInAC) {
|
|
// Clone the animation group and all its animatables
|
|
// Clone the animation group and all its animatables
|
|
- animationGroupInAC.clone(animationGroupInAC.name, _targetConverter);
|
|
|
|
|
|
+ newAnimationGroups.push(animationGroupInAC.clone(animationGroupInAC.name, _targetConverter));
|
|
// Remove animatables related to the asset container
|
|
// Remove animatables related to the asset container
|
|
animationGroupInAC.animatables.forEach(function (animatable) {
|
|
animationGroupInAC.animatables.forEach(function (animatable) {
|
|
animatable.stop();
|
|
animatable.stop();
|
|
@@ -179923,6 +179925,7 @@ var AssetContainer = /** @class */ (function (_super) {
|
|
scene.stopAnimation(animatable.target);
|
|
scene.stopAnimation(animatable.target);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ return newAnimationGroups;
|
|
};
|
|
};
|
|
return AssetContainer;
|
|
return AssetContainer;
|
|
}(_abstractScene__WEBPACK_IMPORTED_MODULE_1__["AbstractScene"]));
|
|
}(_abstractScene__WEBPACK_IMPORTED_MODULE_1__["AbstractScene"]));
|