зеркало из https://github.com/mozilla/Spoke.git
Fix issue with missing clip
This commit is contained in:
Родитель
b890808909
Коммит
53b3b4aa14
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче