-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMCL-0000: add spline smoother #1017
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev/splineroll-easing #1017 +/- ##
=========================================================
- Coverage 26.95% 26.81% -0.15%
=========================================================
Files 254 256 +2
Lines 28439 28593 +154
=========================================================
Hits 7666 7666
- Misses 20773 20927 +154 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to me – I committed minor doc fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks. I may be missing part of the bigger picture, so feel free to disregard if not relevant.
ux.Add(new HelpBox("Spline Smoother adjusts the spline's knot settings to maintain smoothness " | ||
+ "suitable for camera paths. Do not adjust the tangents manually; they will be overwritten by the smoother.", | ||
HelpBoxMessageType.Info)); | ||
ux.Add(new PropertyField(serializedObject.FindProperty("AutoSmooth"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use nameof
to avoid the hardcoded string.
ux.Add(new PropertyField(serializedObject.FindProperty("AutoSmooth"))); | |
ux.Add(new PropertyField(serializedObject.FindProperty(nameof(CinemachineSplineSmoother.AutoSmooth)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish I had known about nameof
earlier! Thanks for this. Elsewhere I used some awkward expressions to avoid hardcoded strings. I like this much better.
{ | ||
#if UNITY_EDITOR | ||
UnityEditor.Undo.RecordObject(container, "Smooth Spline"); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should RecordObject
be part of this function or called beforehand in CinemachineSplineSmootherEditor
? It may be strange from an API perspective to add to the undo stack when calling this function from the editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right, this isn't the correct place for this
Purpose of this PR
Added CinemachineSplineSmoother for creating smooth splines suitable for camera paths. This replicates the behaviour of CinemachineSmoothPath in CM2.
See https://forum.unity.com/threads/replicating-cm2s-smoothpath-in-cm3s-splines.1610553/#post-9931731 for the full story.
SplineSmoother is now automatically added when upgrading CinemchineSmoothPath from CM2, and when creating dolly spline or spline cart from Cinemachine menu.
Testing status
Documentation status
Technical risk
low