|
@@ -2134,10 +2134,12 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
else if (primitive.targets.length !== node._numMorphTargets) {
|
|
|
throw new Error(context + ": Primitives do not have the same number of targets");
|
|
|
}
|
|
|
+ var targetNames = mesh.extras ? mesh.extras.targetNames : null;
|
|
|
babylonMesh.morphTargetManager = new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["MorphTargetManager"](babylonMesh.getScene());
|
|
|
for (var index = 0; index < primitive.targets.length; index++) {
|
|
|
var weight = node.weights ? node.weights[index] : mesh.weights ? mesh.weights[index] : 0;
|
|
|
- babylonMesh.morphTargetManager.addTarget(new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"]("morphTarget" + index, weight, babylonMesh.getScene()));
|
|
|
+ var name_4 = targetNames ? targetNames[index] : "morphTarget" + index;
|
|
|
+ babylonMesh.morphTargetManager.addTarget(new babylonjs_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__["MorphTarget"](name_4, weight, babylonMesh.getScene()));
|
|
|
// TODO: tell the target whether it has positions, normals, tangents
|
|
|
}
|
|
|
};
|
|
@@ -3283,8 +3285,8 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
};
|
|
|
GLTFLoader.prototype._forEachExtensions = function (action) {
|
|
|
for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
|
|
|
- var name_4 = _a[_i];
|
|
|
- var extension = this._extensions[name_4];
|
|
|
+ var name_5 = _a[_i];
|
|
|
+ var extension = this._extensions[name_5];
|
|
|
if (extension.enabled) {
|
|
|
action(extension);
|
|
|
}
|
|
@@ -3292,10 +3294,10 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
};
|
|
|
GLTFLoader.prototype._applyExtensions = function (property, functionName, actionAsync) {
|
|
|
for (var _i = 0, _a = GLTFLoader._ExtensionNames; _i < _a.length; _i++) {
|
|
|
- var name_5 = _a[_i];
|
|
|
- var extension = this._extensions[name_5];
|
|
|
+ var name_6 = _a[_i];
|
|
|
+ var extension = this._extensions[name_6];
|
|
|
if (extension.enabled) {
|
|
|
- var id = name_5 + "." + functionName;
|
|
|
+ var id = name_6 + "." + functionName;
|
|
|
var loaderProperty = property;
|
|
|
loaderProperty._activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions || {};
|
|
|
var activeLoaderExtensionFunctions = loaderProperty._activeLoaderExtensionFunctions;
|