Skip to content

Commit

Permalink
[ci-build]
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed Feb 1, 2023
1 parent 7875053 commit 0372128
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js/animations/keyframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions js/io/formats/bbmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
14 changes: 7 additions & 7 deletions js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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();
Expand All @@ -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]);
Expand Down

0 comments on commit 0372128

Please sign in to comment.