Skip to content

Commit

Permalink
Fixes on ReplicateStrokes and RemoveKeyFrame. QOL update.
Browse files Browse the repository at this point in the history
Fixed ReplicateStrokes to account for Batches that do not have Geometry. This occurs when "erasing" joined strokes. The batch will
be memorized, but there is no geometry. If no geometry, then we'll uncreate the batch.

Fixed RemoveKeyFrame to break up a keyframe that has been extended. An empty extended keyframe will return an out-of-index error.

updateFrameInfo is changed to disambiguate the UI. A colon implies there are seconds and nano-seconds when it's not the case.
  • Loading branch information
JayMayo authored and andybak committed Jan 27, 2025
1 parent 91d39a3 commit ccbb675
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions Assets/Prefabs/Panels/Widgets/FrameNotchesWidget.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -184,7 +184,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -268,7 +268,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 7
value: 8
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -352,7 +352,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 5
value: 6
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -436,7 +436,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 6
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -520,7 +520,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 4
value: 5
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -604,7 +604,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down Expand Up @@ -688,7 +688,7 @@ PrefabInstance:
- target: {fileID: 4141830414106372800, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
propertyPath: m_text
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4518675632882533363, guid: 7a7d5ae4b979c7b4c86b109067ea20c9,
type: 3}
Expand Down
10 changes: 5 additions & 5 deletions Assets/Scripts/Animation/AnimationUI_Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private void UpdateNodes()
GameObject newFrame = Instantiate(timelineNotchPrefab, frameNotchesWidget.transform, false);
// HARD CODED. MUST GET Vector and Scale info from FrameButton1
newFrame.transform.localPosition = new Vector3(posModifier * 0.1971429f, 0, 0.0087f); // 1.9... is the spacing between framebuttons 0 and 1
newFrame.transform.FindChild("Num").GetComponent<TextMeshPro>().text = "" + posModifier;
newFrame.transform.FindChild("Num").GetComponent<TextMeshPro>().text = "" + (posModifier + 1);

posModifier = posModifier + 1;
}
Expand Down Expand Up @@ -638,7 +638,8 @@ public void UpdateTimelineNob()

public void updateFrameInfo()
{
textRef.GetComponent<TextMeshPro>().text = (m_FrameOn.ToString("0.00")) + ":" + GetTimelineLength();
float adjustedFrameOn = Math.Min(m_FrameOn + 1, GetTimelineLength());
textRef.GetComponent<TextMeshPro>().text = (adjustedFrameOn.ToString("0")) + " / " + GetTimelineLength();
}

public void UpdateUI(bool timelineInput = false)
Expand Down Expand Up @@ -706,10 +707,9 @@ public DeletedFrame RemoveKeyFrame(int trackNum = -1, int frameNum = -1)
deletedFrame.Location = (index.Item1, index.Item2);

App.Scene.HideCanvas(deletedFrame.Frame.Canvas);
CanvasScript replacingCanvas = App.Scene.AddCanvas();
for (int l = index.Item2; l < nextIndex.Item2; l++)
{
Frame removingFrame = NewFrame(replacingCanvas);
Frame removingFrame = NewFrame(App.Scene.AddCanvas());
Timeline[index.Item1].Frames[l] = removingFrame;
}

Expand Down Expand Up @@ -989,7 +989,7 @@ private CanvasScript ReplicateStrokesToNewCanvas(List<Stroke> oldStrokes)

for (int i = 0; i < oldStrokes.Count; i++)
{
if (oldStrokes.Count == newStrokes.Count && oldStrokes[i].m_Type == Stroke.Type.NotCreated)
if (oldStrokes.Count == newStrokes.Count && (oldStrokes[i].m_Type == Stroke.Type.NotCreated || !oldStrokes[i].IsGeometryEnabled))
{
// using SketchMemory of oldStrokes to mark Uncreated strokes on newStrokes. Otherwise, Uncreated strokes will be re-made.
newStrokes[i].Uncreate();
Expand Down

0 comments on commit ccbb675

Please sign in to comment.