mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Save variable placeholders in project files #725
This commit is contained in:
parent
1b9bddca2a
commit
112e8e0a6f
@ -196,11 +196,11 @@ const Timeline = {
|
|||||||
time = Timeline.time;
|
time = Timeline.time;
|
||||||
}
|
}
|
||||||
if (!animation) animation = Animator.selected;
|
if (!animation) animation = Animator.selected;
|
||||||
var fps = Math.clamp(animation.snapping, 1, 120);
|
var fps = Math.clamp(animation ? animation.snapping : settings.animation_snap.value, 1, 120);
|
||||||
return Math.clamp(Math.round(time*fps)/fps, 0);
|
return Math.clamp(Math.round(time*fps)/fps, 0);
|
||||||
},
|
},
|
||||||
getStep() {
|
getStep() {
|
||||||
return 1/Math.clamp(Animator.selected.snapping, 1, 120);
|
return 1/Math.clamp(Animator.selected ? Animator.selected.snapping : settings.animation_snap.value, 1, 120);
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
$('#timeline_body').mousedown(Timeline.selector.down)
|
$('#timeline_body').mousedown(Timeline.selector.down)
|
||||||
|
@ -70,6 +70,9 @@ var codec = new Codec('project', {
|
|||||||
model.animations.push(a.getUndoCopy({bone_names: true}, true))
|
model.animations.push(a.getUndoCopy({bone_names: true}, true))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (Interface.Panels.variable_placeholders.inside_vue._data.text) {
|
||||||
|
model.animation_variable_placeholders = Interface.Panels.variable_placeholders.inside_vue._data.text;
|
||||||
|
}
|
||||||
|
|
||||||
if (Format.display_mode && Object.keys(display).length >= 1) {
|
if (Format.display_mode && Object.keys(display).length >= 1) {
|
||||||
var new_display = {}
|
var new_display = {}
|
||||||
@ -216,6 +219,9 @@ var codec = new Codec('project', {
|
|||||||
base_ani.extend(ani).add();
|
base_ani.extend(ani).add();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (model.animation_variable_placeholders) {
|
||||||
|
Interface.Panels.variable_placeholders.inside_vue._data.text = model.animation_variable_placeholders;
|
||||||
|
}
|
||||||
if (model.display !== undefined) {
|
if (model.display !== undefined) {
|
||||||
DisplayMode.loadJSON(model.display)
|
DisplayMode.loadJSON(model.display)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user