From 1e6be1295d9c87f73141b3de190973c14f1bf762 Mon Sep 17 00:00:00 2001 From: young Date: Mon, 31 Aug 2026 13:17:55 +1000 Subject: [PATCH] Make motion blur streakier and simplify its controls --- src/components/video-editor/SettingsPanel.tsx | 148 ------------------ src/components/video-editor/VideoEditor.tsx | 12 -- src/components/video-editor/audio.test.ts | 4 +- .../video-editor/cursorMotionPresets.ts | 10 +- .../video-editor/projectPersistence.ts | 6 +- .../videoPlayback/cursorRenderer.ts | 2 +- .../videoPlayback/zoomTransform.test.ts | 45 +++++- .../videoPlayback/zoomTransform.ts | 29 ++-- 8 files changed, 69 insertions(+), 187 deletions(-) diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index 81c934d5..5146aa1d 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -22,10 +22,6 @@ import { Switch } from "@/components/ui/switch"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { useTheme } from "@/contexts/ThemeContext"; import { getAssetPath, getRenderableVideoUrl, getWallpaperThumbnailUrl } from "@/lib/assetPath"; -import { - TEMPORAL_MOTION_BLUR_DEFAULT_SAMPLE_COUNT, - TEMPORAL_MOTION_BLUR_DEFAULT_SHUTTER_FRACTION, -} from "@/lib/exporter/temporalMotionBlur"; import { cn } from "@/lib/utils"; import type { BuiltInWallpaper } from "@/lib/wallpapers"; import { @@ -64,7 +60,6 @@ import type { WebcamPositionPreset, ZoomDepth, ZoomMode, - ZoomMotionBlurTuning, ZoomTransitionEasing, } from "./types"; import { @@ -78,7 +73,6 @@ import { DEFAULT_CURSOR_CLICK_EFFECT_DURATION_MS, DEFAULT_CURSOR_CLICK_EFFECT_OPACITY, DEFAULT_CURSOR_CLICK_EFFECT_SCALE, - DEFAULT_CURSOR_MOTION_BLUR, DEFAULT_CURSOR_SIZE, DEFAULT_CURSOR_STYLE, DEFAULT_CURSOR_SWAY, @@ -92,7 +86,6 @@ import { DEFAULT_WEBCAM_SHADOW, DEFAULT_WEBCAM_SIZE, DEFAULT_ZOOM_IN_DURATION_MS, - DEFAULT_ZOOM_MOTION_BLUR_TUNING, DEFAULT_ZOOM_OUT_DURATION_MS, } from "./types"; import { fromCursorSwaySliderValue, toCursorSwaySliderValue } from "./videoPlayback/cursorSway"; @@ -548,14 +541,6 @@ interface SettingsPanelProps { onShadowChange?: (intensity: number) => void; backgroundBlur?: number; onBackgroundBlurChange?: (amount: number) => void; - zoomMotionBlurTuning?: ZoomMotionBlurTuning; - onZoomMotionBlurTuningChange?: (tuning: ZoomMotionBlurTuning) => void; - zoomTemporalMotionBlur?: number; - onZoomTemporalMotionBlurChange?: (amount: number) => void; - zoomMotionBlurSampleCount?: number | null; - onZoomMotionBlurSampleCountChange?: (count: number | null) => void; - zoomMotionBlurShutterFraction?: number | null; - onZoomMotionBlurShutterFractionChange?: (fraction: number | null) => void; connectZooms?: boolean; onConnectZoomsChange?: (enabled: boolean) => void; autoApplyFreshRecordingAutoZooms?: boolean; @@ -600,8 +585,6 @@ interface SettingsPanelProps { onCameraSpringMassMultiplierChange?: (multiplier: number) => void; zoomClassicMode?: boolean; onZoomClassicModeChange?: (enabled: boolean) => void; - cursorMotionBlur?: number; - onCursorMotionBlurChange?: (amount: number) => void; cursorClickEffect?: CursorClickEffectStyle; onCursorClickEffectChange?: (effect: CursorClickEffectStyle) => void; cursorClickEffectColor?: string; @@ -1009,8 +992,6 @@ export function SettingsPanel({ onShadowChange, backgroundBlur = 0, onBackgroundBlurChange, - zoomMotionBlurTuning = DEFAULT_ZOOM_MOTION_BLUR_TUNING, - onZoomMotionBlurTuningChange, connectZooms = true, onConnectZoomsChange, autoApplyFreshRecordingAutoZooms = true, @@ -1043,8 +1024,6 @@ export function SettingsPanel({ onCameraSpringMassMultiplierChange, zoomClassicMode = false, onZoomClassicModeChange, - cursorMotionBlur = DEFAULT_CURSOR_MOTION_BLUR, - onCursorMotionBlurChange, cursorClickEffect = DEFAULT_CURSOR_CLICK_EFFECT, onCursorClickEffectChange, cursorClickEffectColor = DEFAULT_CURSOR_CLICK_EFFECT_COLOR, @@ -1546,7 +1525,6 @@ export function SettingsPanel({ }; const resetZoomSection = () => { - onZoomMotionBlurTuningChange?.(initialEditorPreferences.zoomMotionBlurTuning); onCameraSpringStiffnessMultiplierChange?.( initialEditorPreferences.cameraSpringStiffnessMultiplier, ); @@ -1572,7 +1550,6 @@ export function SettingsPanel({ initialEditorPreferences.cursorSpringDampingMultiplier, ); onCursorSpringMassMultiplierChange?.(initialEditorPreferences.cursorSpringMassMultiplier); - onCursorMotionBlurChange?.(initialEditorPreferences.cursorMotionBlur); onCursorClickEffectChange?.(initialEditorPreferences.cursorClickEffect); onCursorClickEffectColorChange?.(initialEditorPreferences.cursorClickEffectColor); onCursorClickEffectScaleChange?.(initialEditorPreferences.cursorClickEffectScale); @@ -1593,7 +1570,6 @@ export function SettingsPanel({ cursorSpringStiffnessMultiplier, cursorSpringDampingMultiplier, cursorSpringMassMultiplier, - cursorMotionBlur, cursorClickBounce, cursorClickBounceDuration, }) ?? "focused" @@ -1601,7 +1577,6 @@ export function SettingsPanel({ }, [ cursorClickBounce, cursorClickBounceDuration, - cursorMotionBlur, cursorSize, cursorSmoothing, cursorSpringDampingMultiplier, @@ -1620,7 +1595,6 @@ export function SettingsPanel({ onCursorSpringStiffnessMultiplierChange?.(preset.cursorSpringStiffnessMultiplier); onCursorSpringDampingMultiplierChange?.(preset.cursorSpringDampingMultiplier); onCursorSpringMassMultiplierChange?.(preset.cursorSpringMassMultiplier); - onCursorMotionBlurChange?.(preset.cursorMotionBlur); onCursorClickBounceChange?.(preset.cursorClickBounce); onCursorClickBounceDurationChange?.(preset.cursorClickBounceDuration); }; @@ -2719,104 +2693,6 @@ export function SettingsPanel({ -
-
-
- {tSettings("effects.motionBlurDebug", "Motion Blur Debug")} -
-
- {tSettings( - "effects.motionBlurDebugHint", - "Development-only tuning for the split move-vs-zoom blur path. Pan controls drive the streak filter, and zoom controls drive the focus-centered zoom filter.", - )} -
-
- - onZoomMotionBlurTuningChange?.({ - ...zoomMotionBlurTuning, - panVelocityThreshold: value, - }) - } - formatValue={(value) => `${Math.round(value)} px/s`} - parseInput={(text) => - parseFloat(text.replace(/px\/s$/i, "").trim()) - } - /> - - onZoomMotionBlurTuningChange?.({ - ...zoomMotionBlurTuning, - maxDirectionalBlurPx: value, - }) - } - formatValue={(value) => `${value.toFixed(1)} px`} - parseInput={(text) => parseFloat(text.replace(/px$/i, "").trim())} - /> - - onZoomMotionBlurTuningChange?.({ - ...zoomMotionBlurTuning, - zoomVelocityThreshold: value, - }) - } - formatValue={(value) => value.toFixed(3)} - parseInput={(text) => parseFloat(text)} - /> - - onZoomMotionBlurTuningChange?.({ - ...zoomMotionBlurTuning, - maxRadialBlurStrength: value, - }) - } - formatValue={(value) => value.toFixed(3)} - parseInput={(text) => parseFloat(text)} - /> -
-
@@ -3061,19 +2937,6 @@ export function SettingsPanel({ )}
)} - {showDevMotionControls ? ( -
-
- {tSettings( - "effects.exportBlurMovedToDev", - "Export blur tuning is available in Settings > Dev.", - )} -
-
- {`${TEMPORAL_MOTION_BLUR_DEFAULT_SAMPLE_COUNT} samples · ${Math.round(TEMPORAL_MOTION_BLUR_DEFAULT_SHUTTER_FRACTION * 100)}% shutter`} -
-
- ) : null} {selectedZoomId && (