feat: improve camera motion and shot transitions

This commit is contained in:
KINDNICK
2026-08-03 06:27:17 +09:00
parent 02d76bc87c
commit 80ff929a1c
22 changed files with 2563 additions and 129 deletions
@@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 30c854c9afbd493f8b2e660c23584f83
guid: f3fb35740c814042bce3842307136af2
@@ -155,6 +155,168 @@ namespace Streamingle.Editor
Is.LessThan(exact.DutchIndices.Length));
}
[Test]
public void EditablePresetPreservesStopThroughDirectionChangeKeys()
{
const int count = 121;
const int center = 60;
const int preserveRadius = 21;
var times = new double[count];
var positions = new Vector3[count];
var rotations = new Quaternion[count];
var fieldOfView = new float[count];
var dutch = new float[count];
for (var index = 0; index < count; index++)
{
times[index] = index / 60.0;
float x;
if (index <= center)
{
var t = index / (float)center;
x = -t * t * t + t * t + t;
}
else
{
var t = (index - center) /
(float)(count - 1 - center);
var progress = -t * t * t + 2f * t * t;
x = 1f - progress;
}
positions[index] = new Vector3(x, 1.6f, -4f);
rotations[index] = Quaternion.identity;
fieldOfView[index] = 40f;
dutch[index] = 0f;
}
var result = Simplify(
new CameraSamples(
times,
positions,
rotations,
fieldOfView,
dutch),
AICameraTimelinePreviewImporter.CurveSimplificationPreset.Editable);
for (var index = center - preserveRadius;
index <= center + preserveRadius;
index++)
{
Assert.That(
result.PositionIndices,
Does.Contain(index),
$"Direction-change key {index} was simplified away.");
}
}
[Test]
public void EditablePresetPreservesBrakedRightAngleTurnKeys()
{
const int count = 121;
const int center = 60;
const int preserveRadius = 21;
var times = new double[count];
var positions = new Vector3[count];
var rotations = new Quaternion[count];
var fieldOfView = new float[count];
var dutch = new float[count];
for (var index = 0; index < count; index++)
{
times[index] = index / 60.0;
if (index <= center)
{
var t = index / (float)center;
var progress = -t * t * t + t * t + t;
positions[index] = new Vector3(progress, 1.6f, -4f);
}
else
{
var t = (index - center) /
(float)(count - 1 - center);
var progress = -t * t * t + 2f * t * t;
positions[index] = new Vector3(1f, 1.6f, -4f + progress);
}
rotations[index] = Quaternion.identity;
fieldOfView[index] = 40f;
dutch[index] = 0f;
}
var result = Simplify(
new CameraSamples(
times,
positions,
rotations,
fieldOfView,
dutch),
AICameraTimelinePreviewImporter.CurveSimplificationPreset.Editable);
for (var index = center - preserveRadius;
index <= center + preserveRadius;
index++)
{
Assert.That(
result.PositionIndices,
Does.Contain(index),
$"Right-angle braking key {index} was simplified away.");
}
}
[Test]
public void EditablePresetPreservesBrakedFortyFiveDegreeTurnKeys()
{
const int count = 121;
const int center = 60;
const int preserveRadius = 21;
var times = new double[count];
var positions = new Vector3[count];
var rotations = new Quaternion[count];
var fieldOfView = new float[count];
var dutch = new float[count];
var outgoing = new Vector3(1f, 0f, 1f).normalized;
for (var index = 0; index < count; index++)
{
times[index] = index / 60.0;
if (index <= center)
{
var t = index / (float)center;
var progress = -t * t * t + t * t + t;
positions[index] = new Vector3(progress, 1.6f, -4f);
}
else
{
var t = (index - center) /
(float)(count - 1 - center);
var progress = -t * t * t + 2f * t * t;
positions[index] =
new Vector3(1f, 1.6f, -4f) + outgoing * progress;
}
rotations[index] = Quaternion.identity;
fieldOfView[index] = 40f;
dutch[index] = 0f;
}
var result = Simplify(
new CameraSamples(
times,
positions,
rotations,
fieldOfView,
dutch),
AICameraTimelinePreviewImporter.CurveSimplificationPreset.Editable);
for (var index = center - preserveRadius;
index <= center + preserveRadius;
index++)
{
Assert.That(
result.PositionIndices,
Does.Contain(index),
$"Forty-five-degree braking key {index} was simplified away.");
}
}
[Test]
public void ExplicitDirectorScopesSeparateSameNamedSongDirectors()
{
@@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 1b88c37fe4bd4e48818660d18810ae43
guid: 8e37a17d5d9e451dad2a8bbc9f1d2f8a
@@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 7a3ea2034f8a4ce1b45f1673472e5e6f
guid: 39679e5d695f47288b75d9429735481a
@@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 74ed53c76a0a4c6c82ea504d79132c63
guid: a959d1021a8c4fce976089fee89d1978
@@ -1,3 +1,3 @@
fileFormatVersion: 2
guid: b557e27541794769bd7798589e9c5a9b
guid: af51bc7a0bfd4d4492a7da670bb46a59
timeCreated: 1785484800