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); return(true); } return(false); }
public static bool CanCycleMarkers() { if (!SelectionManager.SelectedMarkers().Any()) { return(false); } var cluster = PickerUtils.PickedLayerableOfType <TimelineMarkerClusterGUI>(); if (cluster == null) { return(false); } // Only cycle if the marker is selected and nothing else is selected return(cluster.topMarker.IsSelected() && SelectionManager.Count() == 1); }
protected override bool MouseDown(Event evt, WindowState state) { var handle = PickerUtils.TopmostPickedItem() as TimelineClipHandle; if (handle == null) { return(false); } if (handle.clipGUI.clip.parentTrack != null && handle.clipGUI.clip.parentTrack.lockedInHierarchy) { return(false); } m_TrimClipHandler = handle; m_IsCaptured = true; state.AddCaptured(this); m_UndoSaved = false; var clip = m_TrimClipHandler.clipGUI.clip; m_OriginalDuration = clip.duration; m_OriginalTimeScale = clip.timeScale; m_OriginalEaseInDuration = clip.easeInDuration; m_OriginalEaseOutDuration = clip.easeOutDuration; RefreshOverlayStrings(m_TrimClipHandler, state); // in ripple trim, the right edge moves and needs to snap var edges = ManipulateEdges.Right; if (EditMode.editType != EditMode.EditType.Ripple && m_TrimClipHandler.trimDirection == TrimEdge.Start) { edges = ManipulateEdges.Left; } m_SnapEngine = new SnapEngine(m_TrimClipHandler.clipGUI, new TrimClipAttractionHandler(), edges, state, evt.mousePosition); EditMode.BeginTrim(ItemsUtils.ToItem(clip), m_TrimClipHandler.trimDirection); return(true); }
protected override bool DoubleClick(Event evt, WindowState state) { if (evt.button != 0) { return(false); } var trackGUI = PickerUtils.FirstPickedElementOfType <TimelineTrackBaseGUI>(); if (trackGUI == null) { return(false); } // Double-click is only available for AnimationTracks: it conflicts with selection mechanics on other tracks if ((trackGUI.track as AnimationTrack) == null) { return(false); } return(EditTrackInAnimationWindow.Do(state, trackGUI.track)); }
void DoLayout() { EventType rawType = Event.current.rawType; var mousePosition = Event.current.mousePosition; // mousePosition is also affected by this bug and does not reflect the original position after a Use() Initialize(); var processManipulators = Event.current.type != EventType.Repaint && Event.current.type != EventType.Layout; if (processManipulators) { // Update what's under mouse the cursor PickerUtils.DoPick(state, mousePosition); if (state.editSequence.asset != null) { m_PreTreeViewControl.HandleManipulatorsEvents(state); } } SequencerGUI(); if (processManipulators) { if (state.editSequence.asset != null) { m_PostTreeViewControl.HandleManipulatorsEvents(state); } } if (state.editSequence.asset != null) { m_RectangleSelect.OnGUI(state, rawType, mousePosition); m_RectangleZoom.OnGUI(state, rawType, mousePosition); } }
void SelectionChangedCallback(int[] ids) { if (Event.current.button == 1 && PickerUtils.PickedLayerableOfType <ISelectable>() != null) { return; } if (Event.current.command || Event.current.control || Event.current.shift) { SelectionManager.UnSelectTracks(); } else { SelectionManager.Clear(); } foreach (var id in ids) { var trackGUI = (TimelineTrackBaseGUI)m_TreeView.FindItem(id); SelectionManager.Add(trackGUI.track); } m_State.GetWindow().Repaint(); }