Save variable placeholders in project files #725

This commit is contained in:
JannisX11 2020-09-14 18:31:28 +02:00
parent 1b9bddca2a
commit 112e8e0a6f
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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)
} }