This commit is contained in:
Robert Long 2020-10-05 15:59:34 -07:00
Родитель b890808909
Коммит 53b3b4aa14
2 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -38,7 +38,11 @@ export default class KitPieceNode extends EditorNodeMixin(Model) {
if (clip !== undefined && node.model && node.model.animations) {
// DEPRECATED: Old loop-animation component stored the clip name rather than the clip index
node.activeClipIndices = [node.model.animations.findIndex(animation => animation.name === clip)];
const clipIndex = node.model.animations.findIndex(animation => animation.name === clip);
if (clipIndex !== -1) {
node.activeClipIndices = [clipIndex];
}
} else {
node.activeClipIndices = activeClipIndices;
}

Просмотреть файл

@ -58,7 +58,11 @@ export default class ModelNode extends EditorNodeMixin(Model) {
if (clip !== undefined && node.model && node.model.animations) {
// DEPRECATED: Old loop-animation component stored the clip name rather than the clip index
node.activeClipIndices = [node.model.animations.findIndex(animation => animation.name === clip)];
const clipIndex = node.model.animations.findIndex(animation => animation.name === clip);
if (clipIndex !== -1) {
node.activeClipIndices = [clipIndex];
}
} else {
node.activeClipIndices = activeClipIndices;
}