public override bool Execute(WindowState state) { TimelineEditor.clipboard.Clear(); var clips = SelectionManager.SelectedClips().ToArray(); if (clips.Length > 0) { ItemAction <TimelineClip> .Invoke <CopyClipsToClipboard>(state, clips); } var markers = SelectionManager.SelectedMarkers().ToArray(); if (markers.Length > 0) { ItemAction <IMarker> .Invoke <CopyMarkersToClipboard>(state, markers); } var tracks = SelectionManager.SelectedTracks().ToArray(); if (tracks.Length > 0) { CopyTracksToClipboard.Do(state, tracks); } return(true); }
public static void ShowItemContextMenu(Vector2 mousePosition) { var menu = new GenericMenu(); var state = TimelineWindow.instance.state; TimelineAction.AddToMenu(menu, state, mousePosition); if (SelectionManager.SelectedClips().Any()) { ItemAction <TimelineClip> .AddToMenu(menu, state); } if (SelectionManager.SelectedMarkers().Any()) { ItemAction <IMarker> .AddToMenu(menu, state); } var clipGUI = PickerUtils.PickedLayerableOfType <TimelineClipGUI>(); if (clipGUI != null && clipGUI.drawer != null) { var clips = SelectionManager.SelectedClips().ToArray(); if (clips.Length > 0) { clipGUI.drawer.OnBuildClipContextMenu(menu, clips, state); AddMarkerMenuCommands(menu, clipGUI.clip.parentTrack, TimelineHelpers.GetCandidateTime(state, mousePosition)); } } menu.ShowAsContext(); }
public override bool Execute(WindowState state) { if (SelectionManager.GetCurrentInlineEditorCurve() != null) { return(false); } var clips = SelectionManager.SelectedClips().ToArray(); return(clips.Length > 0 && ClipModifier.MatchContent(clips)); }
public override MenuActionDisplayState GetDisplayState(WindowState state) { var clips = SelectionManager.SelectedClips().ToArray(); if (!clips.Any() || SelectionManager.GetCurrentInlineEditorCurve() != null) { return(MenuActionDisplayState.Hidden); } return(clips.Any(TimelineHelpers.HasUsableAssetDuration) ? MenuActionDisplayState.Visible : MenuActionDisplayState.Disabled); }
protected override bool ExecuteCommand(Event evt, WindowState state) { var consumed = false; var clips = SelectionManager.SelectedClips(); foreach (var clip in clips) { consumed |= ItemAction <TimelineClip> .HandleShortcut(state, evt, clip); } var markers = SelectionManager.SelectedMarkers(); foreach (var marker in markers) { consumed |= ItemAction <IMarker> .HandleShortcut(state, evt, marker); } return(consumed); }
protected override bool ContextClick(Event evt, WindowState state) { if (evt.alt) { return(false); } var selectable = PickerUtils.PickedLayerableOfType <ISelectable>(); if (selectable != null && selectable.IsSelected()) { SequencerContextMenu.ShowItemContextMenu(evt.mousePosition, SelectionManager.SelectedClips().ToArray(), SelectionManager.SelectedMarkers().ToArray()); return(true); } return(false); }
public override bool Execute(WindowState state) { var clips = SelectionManager.SelectedClips().ToArray(); return(clips.Length > 0 && ClipModifier.MatchContent(clips)); }