# V2 Camera Mode Interpolation

Camera mode interpolation blends between two `FV2CameraModeSpec` values over an
explicit duration. It resolves smooth position, rotation, and FOV transitions
for mode changes that need a designer-controlled duration instead of only using
the target mode's stack blend time.

## Runtime Surface

- `FV2CameraModeInterpolationConfig` configures default, minimum, and maximum
  durations, blend function, duration clamping, location, rotation, and FOV
  interpolation toggles, and whether the exported mode preserves target mode
  metadata.
- `FV2CameraModeInterpolationRequest` carries source and target camera modes,
  requested duration, elapsed seconds, delta seconds, and force-cut state.
- `FV2CameraModeInterpolationEvaluation` returns source and target ids, active
  mode type, blended pose, FOV, duration, elapsed time, raw and shaped alpha,
  remaining time, completion flags, exported mode spec, and validation issues.

## Blend Rules

1. Invalid config, invalid modes, or invalid request timing is blocking.
2. `RequestedDurationSeconds` uses `DefaultDurationSeconds` when it is zero.
3. When duration clamping is enabled, requested duration is clamped between the
   configured minimum and maximum and reported as `DurationClamped`.
4. Position, rotation, and FOV each honor their interpolation toggles.
5. Rotation interpolation uses shortest-path pitch, yaw, and roll deltas.
6. Force cut, cut blend function, zero duration, or same source and target mode
   immediately resolves to the target mode and reports `CutApplied`.
7. Completion is based on raw elapsed alpha so eased blends still complete at
   the configured duration.

## Camera Manager Export

`EvaluateCameraModeInterpolation` fills `ModeSpec` with the target mode id,
priority, active flag, and blended pose. When target metadata preservation is
enabled, the exported mode keeps the target blend function, input, cinematic,
and priority-blocking flags. `BuildCameraModeInterpolationMode` can also export
a custom mode id, priority, and active flag.

## Validation Commands

Run these targeted checks when touching camera mode interpolation:

```bash
python3 V2/ue/Tools/check-v2-camera-mode-interpolation.py
python3 V2/ue/Tools/check-v2-camera-manager.py
python3 V2/ue/Tools/check-v2-ci-workflow.py
python3 -m json.tool V2/ue/Content/V2/Gameplay/Camera/CameraModeInterpolation_V2_Contract.json
python3 -m py_compile V2/ue/Tools/check-v2-camera-mode-interpolation.py
```
