Skip to content

Multiple timeline fixes and adjustments#1170

Merged
Nickelony merged 5 commits intotimeline-flybyfrom
Nickelony/Timeline-Fixes
Mar 28, 2026
Merged

Multiple timeline fixes and adjustments#1170
Nickelony merged 5 commits intotimeline-flybyfrom
Nickelony/Timeline-Fixes

Conversation

@Nickelony
Copy link
Copy Markdown
Collaborator

@Nickelony Nickelony commented Mar 28, 2026

  • Review all 11 changed files for potential regressions
  • Verify build compiles (C# compilation succeeds; fxc.exe error is environment-only)
  • Analyze camera number insertion logic (GetInsertionNumber, PrepareCamerasForInsertion)
  • Verify undo ordering changes in DeleteSelectedCameras, AppendCameraAtPlayhead, InsertCameraAtPlayhead
  • Verify CanUseGizmo() centralization in Panel3D
  • Verify SignedRadToDeg usage for flyby rotation/FOV
  • Verify playhead reset/timecode update behavior
  • Verify editor event handling changes

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on improving flyby timeline editing/preview behavior and preventing gizmo interaction during camera preview or when it would interfere with flyby camera visualization.

Changes:

  • Added signed radians-to-degrees helpers and switched flyby rotation/FOV derivation to use signed degrees.
  • Centralized “gizmo usable” checks and applied them across picking, drawing, and mouse movement paths.
  • Refined flyby timeline camera insertion behavior (including camera-number shifting for insertions) and added a view-model event to request “zoom to fit”; playback completion now leaves the playhead at the end.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TombLib/TombLib/Utils/MathC.cs Adds SignedRadToDeg helpers to support signed angle conversions.
TombEditor/Controls/Panel3D/Panel3DPicking.cs Avoids gizmo picking when gizmo should be inactive.
TombEditor/Controls/Panel3D/Panel3DDraw.cs Hides gizmo based on unified CanUseGizmo() logic.
TombEditor/Controls/Panel3D/Panel3DCameraMovement.cs Avoids updating gizmo during fly mode unless usable.
TombEditor/Controls/Panel3D/Panel3D.cs Introduces CanUseGizmo() gating logic for preview/selection/flyby proximity.
TombEditor/Controls/Panel3D/MouseHandler/Panel3DMouseMove.cs Gates gizmo mouse-move updates behind CanUseGizmo().
TombEditor/Controls/Panel3D/MouseHandler/Panel3DMouse.cs Avoids hover/picking updates when gizmo shouldn’t be active.
TombEditor/Controls/FlybyTimeline/FlybyTimelineViewModel.cs Adjusts add/insert camera logic, undo ordering, and adds ZoomToFitRequested event.
TombEditor/Controls/FlybyTimeline/FlybyTimelineView.xaml.cs Subscribes/unsubscribes to ZoomToFitRequested and queues zoom-to-fit.
TombEditor/Controls/FlybyTimeline/FlybySequenceHelper.cs Uses Vector3.IsFinite and signed degree conversion for editor-camera rotation copying.
TombEditor/Controls/FlybyTimeline/FlybyPreviewController.cs When playback ends, sets playhead to total duration instead of resetting to 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nickelony
Copy link
Copy Markdown
Collaborator Author

@copilot Could you please review this Pull Request and check for any regressions?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

@copilot Could you please review this Pull Request and check for any regressions?

I've reviewed all 11 changed files thoroughly. Here are my findings:

No regressions found. The changes are well-structured and correct. Specific notes:

Camera number insertion logic (GetInsertionNumber, PrepareCamerasForInsertion): Now properly operates in the camera-number domain instead of mixing list indices with persisted Number values. This correctly addresses the earlier review comments about non-contiguous numbering/legacy data. The requiresNumberShift guard avoids unnecessary shifting when a gap already exists.

Undo ordering in DeleteSelectedCameras: Changed from OnDataChangedPushUndoIfAny to PushUndoIfAnyOnDataChanged. This is safe because undo captures object state (not UI state), and the added RefreshSequenceList() correctly handles sequences becoming empty after deletion.

OnSelectedCameraChanged: The explicit OnPropertyChanged(nameof(CanEditProperties)) was removed, but the [NotifyPropertyChangedFor(nameof(CanEditProperties))] attribute on _selectedCamera already handles this automatically. The new _preview.ShowCamera() call is properly guarded by IsPreviewActive && !IsPlaying.

OnPlayheadSecondsChanged partial method: Replacing the manual UpdatePlayheadTimecode() calls with CommunityToolkit's auto-generated partial method ensures the timecode is always updated when PlayheadSeconds changes, regardless of the caller. No call sites were missed.

CanUseGizmo() centralization: Correctly applied across all 5 Panel3D paths (picking, drawing, hover, left-drag, right-drag). The squared-distance check avoids sqrt overhead. Passing null to GizmoUpdateHoverEffect when disabled properly clears the hover state.

SignedRadToDeg for flyby rotation/FOV: FOV values from editorCamera.FieldOfView are always positive, so SignedRadToDeg and RadToDeg produce identical results. For yaw/pitch from atan2/asin, signed degrees is the correct representation for editor camera angles.

Edge case: The TryAddCameraAtPlayhead tolerance change from 0.01f to 0.0001f with separate "at end" vs "past end" checks is more precise and avoids the old behavior of always appending when the cursor was within 10ms of the last camera.

@Nickelony Nickelony merged commit 69616f7 into timeline-flyby Mar 28, 2026
5 checks passed
@Nickelony Nickelony deleted the Nickelony/Timeline-Fixes branch March 28, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants