Fix timeline markers getting duplicated

Fix next/previous frame actions not working in paint mode
Fix issue with context menu of null object
This commit is contained in:
JannisX11 2022-06-21 23:30:18 +02:00
parent 16f67df9a9
commit 41eae34d46
4 changed files with 13 additions and 10 deletions

View File

@ -83,7 +83,9 @@ class Animation {
}
if (data.markers instanceof Array) {
data.markers.forEach(marker => {
this.markers.push(new TimelineMarker(marker));
if (!this.markers.find(m2 => Math.epsilon(m2.time, marker.time, 0.001))) {
this.markers.push(new TimelineMarker(marker));
}
})
}
return this;

View File

@ -1219,30 +1219,30 @@ BARS.defineActions(function() {
new Action('timeline_frame_back', {
icon: 'arrow_back',
category: 'animation',
condition: {modes: ['animate', 'edit'], method: () => (!Modes.edit || Interface.Panels.textures.inside_vue.maxFrameCount())},
condition: {modes: ['animate', 'edit', 'paint'], method: () => (Modes.animate || Interface.Panels.textures.inside_vue.maxFrameCount())},
keybind: new Keybind({key: 188}),
click: function (e) {
if (Modes.edit) {
BarItems.animated_texture_frame.change(v => v - 1);
} else {
if (Modes.animate || Prop.active_panel == 'timeline') {
let time = Timeline.snapTime(limitNumber(Timeline.time - Timeline.getStep(), 0, 1e4));
Timeline.setTime(time);
Animator.preview()
} else {
BarItems.animated_texture_frame.change(v => v - 1);
}
}
})
new Action('timeline_frame_forth', {
icon: 'arrow_forward',
category: 'animation',
condition: {modes: ['animate', 'edit'], method: () => (!Modes.edit || Interface.Panels.textures.inside_vue.maxFrameCount())},
condition: {modes: ['animate', 'edit', 'paint'], method: () => (Modes.animate || Interface.Panels.textures.inside_vue.maxFrameCount())},
keybind: new Keybind({key: 190}),
click: function (e) {
if (Modes.edit) {
BarItems.animated_texture_frame.change(v => v + 1);
} else {
if (Modes.animate || Prop.active_panel == 'timeline') {
let time = Timeline.snapTime(limitNumber(Timeline.time + Timeline.getStep(), 0, 1e4));
Timeline.setTime(time);
Animator.preview()
} else {
BarItems.animated_texture_frame.change(v => v + 1);
}
}
})

View File

@ -126,7 +126,7 @@ class NullObject extends OutlinerElement {
}
},
'_',
Outliner.control_menu_group,
...Outliner.control_menu_group,
'_',
'rename',
'delete'

File diff suppressed because one or more lines are too long