diff --git a/js/animations/keyframe.js b/js/animations/keyframe.js index e5888e0d6..dc7d29380 100644 --- a/js/animations/keyframe.js +++ b/js/animations/keyframe.js @@ -652,7 +652,7 @@ Object.assign(Clipbench, { } var first = keyframes[0]; var single_animator; - keyframes.forEach(function(kf) { + keyframes.forEach((kf) => { if (kf.time < first.time) { first = kf } @@ -663,7 +663,7 @@ Object.assign(Clipbench, { } }) - keyframes.forEach(function(kf) { + keyframes.forEach((kf) => { var copy = kf.getUndoCopy(); copy.time_offset = kf.time - first.time; if (single_animator != false) { diff --git a/js/io/formats/bbmodel.js b/js/io/formats/bbmodel.js index 3f6501248..92a7752fd 100644 --- a/js/io/formats/bbmodel.js +++ b/js/io/formats/bbmodel.js @@ -86,6 +86,10 @@ var codec = new Codec('project', { }, 200) } this.parse(model, file.path) + + if (Modes.animate && !AnimationItem.selected && AnimationItem.all[0]) { + AnimationItem.all[0].select(); + } }, export() { Blockbench.export({ diff --git a/js/util.js b/js/util.js index 15dcdd0f1..aa3b25fe7 100644 --- a/js/util.js +++ b/js/util.js @@ -601,7 +601,7 @@ var Objector = { } var Merge = { - number: function(obj, source, index) { + number(obj, source, index) { if (source[index] !== undefined) { var val = source[index] if (typeof val === 'number' && !isNaN(val)) { @@ -614,7 +614,7 @@ var Merge = { } } }, - string: function(obj, source, index, validate) { + string(obj, source, index, validate) { if (source[index] || typeof source[index] === 'string') { var val = source[index] if (typeof val !== 'string') val = val.toString(); @@ -623,33 +623,33 @@ var Merge = { } } }, - molang: function(obj, source, index) { + molang(obj, source, index) { if (['string', 'number'].includes(typeof source[index])) { obj[index] = source[index]; } }, - boolean: function(obj, source, index, validate) { + boolean(obj, source, index, validate) { if (source[index] !== undefined) { if (validate instanceof Function === false || validate(source[index])) { obj[index] = source[index] } } }, - function: function(obj, source, index, validate) { + function(obj, source, index, validate) { if (typeof source[index] === 'function') { if (validate instanceof Function === false || validate(source[index])) { obj[index] = source[index] } } }, - arrayVector: function(obj, source, index, validate) { + arrayVector(obj, source, index, validate) { if (source[index] instanceof Array) { if (validate instanceof Function === false || validate(source[index])) { obj[index].V3_set(source[index]); } } }, - arrayVector2: function(obj, source, index, validate) { + arrayVector2(obj, source, index, validate) { if (source[index] instanceof Array) { if (validate instanceof Function === false || validate(source[index])) { obj[index].replace(source[index]);