mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-01-18 15:26:19 +08:00
[ci-build]
This commit is contained in:
parent
7875053d63
commit
03721285ee
@ -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) {
|
||||
|
@ -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({
|
||||
|
14
js/util.js
14
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user