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) { if (data.markers instanceof Array) {
data.markers.forEach(marker => { 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; return this;

View File

@ -1219,30 +1219,30 @@ BARS.defineActions(function() {
new Action('timeline_frame_back', { new Action('timeline_frame_back', {
icon: 'arrow_back', icon: 'arrow_back',
category: 'animation', 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}), keybind: new Keybind({key: 188}),
click: function (e) { click: function (e) {
if (Modes.edit) { if (Modes.animate || Prop.active_panel == 'timeline') {
BarItems.animated_texture_frame.change(v => v - 1);
} else {
let time = Timeline.snapTime(limitNumber(Timeline.time - Timeline.getStep(), 0, 1e4)); let time = Timeline.snapTime(limitNumber(Timeline.time - Timeline.getStep(), 0, 1e4));
Timeline.setTime(time); Timeline.setTime(time);
Animator.preview() Animator.preview()
} else {
BarItems.animated_texture_frame.change(v => v - 1);
} }
} }
}) })
new Action('timeline_frame_forth', { new Action('timeline_frame_forth', {
icon: 'arrow_forward', icon: 'arrow_forward',
category: 'animation', 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}), keybind: new Keybind({key: 190}),
click: function (e) { click: function (e) {
if (Modes.edit) { if (Modes.animate || Prop.active_panel == 'timeline') {
BarItems.animated_texture_frame.change(v => v + 1);
} else {
let time = Timeline.snapTime(limitNumber(Timeline.time + Timeline.getStep(), 0, 1e4)); let time = Timeline.snapTime(limitNumber(Timeline.time + Timeline.getStep(), 0, 1e4));
Timeline.setTime(time); Timeline.setTime(time);
Animator.preview() 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', 'rename',
'delete' 'delete'

File diff suppressed because one or more lines are too long