Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

fix(project): clips that were reversed or animated in 0.2.4 say so as the project opens

Jareerb00ffab72a71
diff --git a/src/crates/concat-host/src/session.rs b/src/crates/concat-host/src/session.rs
index eeb9c552..350b72fe 100644
--- a/src/crates/concat-host/src/session.rs
+++ b/src/crates/concat-host/src/session.rs
@@ -26,6 +26,8 @@ pub struct Session {
/// The links to retired effects the open rewrote, old id and new, each
/// pair once: what the window names as the project opens.
upgraded: Vec<(String, String)>,
+ /// The clips whose retired fields the open took off.
+ retired: concat_project::RetiredFields,
}
/// What every mutating call returns: the authoritative state plus history
@@ -115,11 +117,15 @@ impl Session {
}
changed
});
+ // Fields an earlier version wrote and this one does not read, off
+ // the clips, with the clips named for the window to say so.
+ let retired = editor.drop_retired_fields();
Ok(Session {
path: path.to_owned(),
settings,
editor,
upgraded,
+ retired,
})
}
@@ -144,6 +150,13 @@ impl Session {
&self.upgraded
}
+ /// The clips this open found with fields an earlier version wrote and
+ /// this one no longer reads, now taken off: reversed ones that play
+ /// forwards, animated ones that hold still. Empty for most documents.
+ pub fn retired(&self) -> &concat_project::RetiredFields {
+ &self.retired
+ }
+
/// The project folder.
pub fn path(&self) -> &str {
&self.path
diff --git a/src/crates/concat-project/src/editor.rs b/src/crates/concat-project/src/editor.rs
index 970d9005..ed9fcb8e 100644
--- a/src/crates/concat-project/src/editor.rs
+++ b/src/crates/concat-project/src/editor.rs
@@ -106,6 +106,52 @@ impl Editor {
changed
}
+ /// Takes off the clip fields earlier versions wrote and this one no
+ /// longer reads - 0.2.4's `reverse` flag and its preset animations -
+ /// as the document is read, the way [`Editor::upgrade_links`] does: not
+ /// a step to undo. They rode along unread, so a reversed clip played
+ /// forwards and an animated one sat still with nothing said (audit
+ /// 2026-09-28, #5). Returns the names of the clips that had each, so
+ /// the open can say which; the next save makes it so.
+ pub fn drop_retired_fields(&mut self) -> RetiredFields {
+ use std::sync::Arc;
+ const ANIMATIONS: [&str; 4] = [
+ "animationIn",
+ "animationOut",
+ "animationCombo",
+ "animationLoop",
+ ];
+ let mut found = RetiredFields::default();
+ for timeline in &mut self.project.timelines {
+ for index in 0..timeline.clips.len() {
+ let extra = &timeline.clips[index].extra;
+ let reversed = extra.get("reverse").and_then(|v| v.as_bool()) == Some(true);
+ let animated = ANIMATIONS
+ .iter()
+ .any(|key| extra.get(*key).is_some_and(|value| !value.is_null()));
+ let any = extra.contains_key("reverse")
+ || ANIMATIONS.iter().any(|key| extra.contains_key(*key));
+ if !any {
+ continue;
+ }
+ let name = timeline.clips[index].name.clone();
+ if reversed && !found.reversed.contains(&name) {
+ found.reversed.push(name.clone());
+ }
+ if animated && !found.animated.contains(&name) {
+ found.animated.push(name);
+ }
+ let timeline = Arc::make_mut(timeline);
+ let clip = Arc::make_mut(&mut timeline.clips[index]);
+ clip.extra.remove("reverse");
+ for key in ANIMATIONS {
+ clip.extra.remove(key);
+ }
+ }
+ }
+ found
+ }
+
/// The current state, read-only: all mutation goes through
/// [`Editor::apply`] so nothing can change without being undoable.
pub fn project(&self) -> &Project {
@@ -306,3 +352,12 @@ impl Default for Editor {
Self::new()
}
}
+
+/// The clips [`Editor::drop_retired_fields`] found, by name, each once.
+#[derive(Clone, Debug, Default, PartialEq)]
+pub struct RetiredFields {
+ /// Clips an earlier version played backwards, which now play forwards.
+ pub reversed: Vec<String>,
+ /// Clips an earlier version moved with a preset animation.
+ pub animated: Vec<String>,
+}
diff --git a/src/crates/concat-project/src/lib.rs b/src/crates/concat-project/src/lib.rs
index 15ca1ef3..ffd7c062 100644
--- a/src/crates/concat-project/src/lib.rs
+++ b/src/crates/concat-project/src/lib.rs
@@ -29,7 +29,7 @@ pub mod speed;
pub use commands::{Command, CommandError, Outcome, why_not_merge};
pub use doc::{DOCUMENT_VERSION, DocumentSettings, document_version, from_document, to_document};
-pub use editor::Editor;
+pub use editor::{Editor, RetiredFields};
pub use model::Project;
#[cfg(test)]
@@ -3850,4 +3850,50 @@ mod tests {
"an empty name falls back to the figure's"
);
}
+
+ /// 0.2.4's reverse flag and preset animations come off as the document
+ /// is read, with the clips that had them named; a false flag or a null
+ /// animation is taken off without being named.
+ #[test]
+ fn retired_clip_fields_are_dropped_and_named() {
+ let mut editor = Editor::new();
+ for (index, name) in ["Backwards", "Bouncy", "Plain"].into_iter().enumerate() {
+ editor
+ .apply(Command::AddLayerClip {
+ track_id: None,
+ start: index as f64 * 2.0,
+ duration: Some(1.0),
+ effect_id: "concat.warm".into(),
+ name: name.into(),
+ })
+ .expect("a layer");
+ }
+ let mut document = editor.to_document(&settings());
+ let clips = document["timelines"][0]["clips"]
+ .as_array_mut()
+ .expect("clips");
+ assert!(clips.len() >= 3, "{clips:?}");
+ clips[0]["reverse"] = serde_json::json!(true);
+ clips[1]["animationIn"] = serde_json::json!({"name": "bounce", "duration": 0.5});
+ clips[2]["reverse"] = serde_json::json!(false);
+ clips[2]["animationLoop"] = serde_json::Value::Null;
+ let names: Vec<String> = clips
+ .iter()
+ .map(|clip| clip["name"].as_str().unwrap_or_default().to_owned())
+ .collect();
+
+ let mut reopened = Editor::from_document(&document).expect("reads");
+ let retired = reopened.drop_retired_fields();
+ assert_eq!(retired.reversed, vec![names[0].clone()]);
+ assert_eq!(retired.animated, vec![names[1].clone()]);
+ for clip in &reopened.project().active().clips {
+ for key in ["reverse", "animationIn", "animationLoop"] {
+ assert!(!clip.extra.contains_key(key), "{key} on {}", clip.name);
+ }
+ }
+ assert_eq!(
+ reopened.drop_retired_fields(),
+ crate::RetiredFields::default()
+ );
+ }
}
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index a4548bce..3f45ec1d 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "Der Clip hat sich während des Umkehrens geändert; bitte erneut umkehren",
"studio.clipHasNoSound": "Dieser Clip hat keinen Ton zum Exportieren",
"studio.clipsDoNotMeet": "Diese beiden Clips stoßen auf derselben Spur nicht aneinander",
+ "studio.clipsLostAnimations": "{0} bewegten sich mit voreingestellten Animationen, die diese Version nicht mehr hat; Keyframes leisten dasselbe. Speichere, um die Änderung zu behalten.",
+ "studio.clipsNowForwards": "{0} liefen in einer früheren Version rückwärts und laufen jetzt vorwärts. Wähle einen aus und drücke Rückwärts in der Leiste, um ihn wieder umzukehren; speichere, um die Änderung zu behalten.",
"studio.closeProject": "Projekt schließen",
"studio.closeWindow": "Fenster schließen",
"studio.couldNotExportAudio": "Audio konnte nicht exportiert werden: {0}",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index 4600ae21..671375ed 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "The clip changed while it was being reversed; reverse it again",
"studio.clipHasNoSound": "This clip has no sound to export",
"studio.clipsDoNotMeet": "Those two clips don't meet on the same track",
+ "studio.clipsLostAnimations": "{0} moved with preset animations, which this version no longer has; keyframes do the same work. Save to keep the change.",
+ "studio.clipsNowForwards": "{0} played backwards in an earlier version and now play forwards. Select one and press Reverse on the tray to reverse it again; save to keep the change.",
"studio.closeProject": "Close project",
"studio.closeWindow": "Close window",
"studio.couldNotExportAudio": "Could not export the audio: {0}",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index 0569e3f1..e80bdda9 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "El clip cambió mientras se invertía; inviértelo de nuevo",
"studio.clipHasNoSound": "Este clip no tiene sonido que exportar",
"studio.clipsDoNotMeet": "Esos dos clips no se tocan en la misma pista",
+ "studio.clipsLostAnimations": "{0} se movían con animaciones predefinidas que esta versión ya no tiene; los fotogramas clave hacen lo mismo. Guarda para conservar el cambio.",
+ "studio.clipsNowForwards": "{0} se reproducían al revés en una versión anterior y ahora van hacia delante. Selecciona uno y pulsa Invertir en la bandeja para invertirlo de nuevo; guarda para conservar el cambio.",
"studio.closeProject": "Cerrar proyecto",
"studio.closeWindow": "Cerrar ventana",
"studio.couldNotExportAudio": "No se pudo exportar el audio: {0}",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 561428fb..e66be7c7 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "کلیپ در حین معکوس‌کردن تغییر کرد؛ دوباره معکوس کنید",
"studio.clipHasNoSound": "این کلیپ صدایی برای خروجی ندارد",
"studio.clipsDoNotMeet": "این دو کلیپ در یک ترک به هم نمی‌رسند",
+ "studio.clipsLostAnimations": "{0} با انیمیشن‌های آماده‌ای حرکت می‌کردند که این نسخه دیگر ندارد؛ کی‌فریم‌ها همین کار را می‌کنند. برای نگه‌داشتن این تغییر ذخیره کنید.",
+ "studio.clipsNowForwards": "{0} در نسخهٔ قبلی برعکس پخش می‌شدند و اکنون رو به جلو پخش می‌شوند. یکی را انتخاب کنید و «معکوس» را در نوار بزنید تا دوباره برعکس شود؛ برای نگه‌داشتن این تغییر ذخیره کنید.",
"studio.closeProject": "بستن پروژه",
"studio.closeWindow": "بستن پنجره",
"studio.couldNotExportAudio": "خروجی گرفتن از صدا ممکن نشد: {0}",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index 92de224e..7b79e93d 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "Le clip a changé pendant l'inversion ; recommencez",
"studio.clipHasNoSound": "Ce clip n’a pas de son à exporter",
"studio.clipsDoNotMeet": "Ces deux clips ne se touchent pas sur la même piste",
+ "studio.clipsLostAnimations": "{0} bougeaient avec des animations prédéfinies que cette version n'a plus ; les images clés font le même travail. Enregistrez pour conserver le changement.",
+ "studio.clipsNowForwards": "{0} étaient lus à l'envers dans une version précédente et le sont maintenant à l'endroit. Sélectionnez-en un et appuyez sur Inverser dans la barre pour l'inverser à nouveau ; enregistrez pour conserver le changement.",
"studio.closeProject": "Fermer le projet",
"studio.closeWindow": "Fermer la fenêtre",
"studio.couldNotExportAudio": "Impossible d’exporter l’audio : {0}",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index f3bf1aec..e022a102 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "Klip se promijenio tijekom obrtanja; obrni ga ponovno",
"studio.clipHasNoSound": "Ovaj isječak nema zvuka za izvoz",
"studio.clipsDoNotMeet": "Ta se dva isječka ne dodiruju na istoj traci",
+ "studio.clipsLostAnimations": "{0} su se kretali unaprijed zadanim animacijama koje ova verzija više nema; ključni kadrovi rade isto. Spremi da zadržiš promjenu.",
+ "studio.clipsNowForwards": "{0} su se u ranijoj verziji reproducirali unatrag, a sada idu naprijed. Odaberi jedan i pritisni Obrnuto na traci da ga ponovno obrneš; spremi da zadržiš promjenu.",
"studio.closeProject": "Zatvori projekt",
"studio.closeWindow": "Zatvori prozor",
"studio.couldNotExportAudio": "Zvuk nije moguće izvesti: {0}",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index 8f7dae0f..2682a925 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "La clip è cambiata durante l'inversione; ripeti l'operazione",
"studio.clipHasNoSound": "Questa clip non ha audio da esportare",
"studio.clipsDoNotMeet": "Quelle due clip non si toccano sulla stessa traccia",
+ "studio.clipsLostAnimations": "{0} si muovevano con animazioni predefinite che questa versione non ha più; i fotogrammi chiave fanno lo stesso lavoro. Salva per mantenere la modifica.",
+ "studio.clipsNowForwards": "{0} venivano riprodotte al contrario in una versione precedente e ora vanno in avanti. Selezionane una e premi Inverti nella barra per invertirla di nuovo; salva per mantenere la modifica.",
"studio.closeProject": "Chiudi progetto",
"studio.closeWindow": "Chiudi finestra",
"studio.couldNotExportAudio": "Impossibile esportare l’audio: {0}",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index e2d0e54a..9d3c5f90 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "逆再生の処理中にクリップが変更されました。もう一度実行してください",
"studio.clipHasNoSound": "このクリップには書き出す音声がありません",
"studio.clipsDoNotMeet": "その2つのクリップは同じトラックで隣り合っていません",
+ "studio.clipsLostAnimations": "{0} はこのバージョンにはないプリセットアニメーションで動いていました。キーフレームで同じことができます。変更を残すには保存してください。",
+ "studio.clipsNowForwards": "{0} は以前のバージョンで逆再生されていましたが、今は順再生になります。もう一度逆にするには、クリップを選んでトレイの「逆再生」を押してください。変更を残すには保存してください。",
"studio.closeProject": "プロジェクトを閉じる",
"studio.closeWindow": "ウィンドウを閉じる",
"studio.couldNotExportAudio": "音声を書き出せませんでした: {0}",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index a9518544..6bb32728 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "역재생 처리 중에 클립이 바뀌었습니다. 다시 실행하세요",
"studio.clipHasNoSound": "이 클립에는 내보낼 소리가 없습니다",
"studio.clipsDoNotMeet": "두 클립이 같은 트랙에서 맞닿아 있지 않습니다",
+ "studio.clipsLostAnimations": "{0}은(는) 이 버전에 더 이상 없는 프리셋 애니메이션으로 움직였습니다. 키프레임으로 같은 효과를 낼 수 있습니다. 변경 사항을 유지하려면 저장하세요.",
+ "studio.clipsNowForwards": "{0}은(는) 이전 버전에서 거꾸로 재생되었지만 이제 정방향으로 재생됩니다. 하나를 선택하고 트레이의 역재생을 눌러 다시 뒤집으세요. 변경 사항을 유지하려면 저장하세요.",
"studio.closeProject": "프로젝트 닫기",
"studio.closeWindow": "창 닫기",
"studio.couldNotExportAudio": "오디오를 내보낼 수 없습니다: {0}",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index 4e1fb6b9..f84f8906 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "O clipe mudou enquanto era revertido; reverta de novo",
"studio.clipHasNoSound": "Este clipe não tem som para exportar",
"studio.clipsDoNotMeet": "Esses dois clipes não se encontram na mesma faixa",
+ "studio.clipsLostAnimations": "{0} se moviam com animações predefinidas que esta versão não tem mais; os quadros-chave fazem o mesmo trabalho. Salve para manter a mudança.",
+ "studio.clipsNowForwards": "{0} tocavam de trás para frente numa versão anterior e agora tocam para frente. Selecione um e toque em Reverter na bandeja para invertê-lo de novo; salve para manter a mudança.",
"studio.closeProject": "Fechar projeto",
"studio.closeWindow": "Fechar janela",
"studio.couldNotExportAudio": "Não foi possível exportar o áudio: {0}",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index 7d768fc6..7f800062 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "Клип изменился во время реверса; повторите",
"studio.clipHasNoSound": "В этом клипе нет звука для экспорта",
"studio.clipsDoNotMeet": "Эти два клипа не стыкуются на одной дорожке",
+ "studio.clipsLostAnimations": "{0} двигались по готовым анимациям, которых в этой версии больше нет; то же делают ключевые кадры. Сохраните проект, чтобы оставить изменение.",
+ "studio.clipsNowForwards": "{0} в прежней версии воспроизводились задом наперёд, а теперь — вперёд. Выберите клип и нажмите «Реверс» на панели, чтобы развернуть его снова; сохраните проект, чтобы оставить изменение.",
"studio.closeProject": "Закрыть проект",
"studio.closeWindow": "Закрыть окно",
"studio.couldNotExportAudio": "Не удалось экспортировать звук: {0}",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index b0f3ad08..c134c7f3 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "Klip ters çevrilirken değişti; yeniden ters çevir",
"studio.clipHasNoSound": "Bu klipte dışa aktarılacak ses yok",
"studio.clipsDoNotMeet": "Bu iki klip aynı parçada birbirine değmiyor",
+ "studio.clipsLostAnimations": "{0} bu sürümde artık bulunmayan hazır animasyonlarla hareket ediyordu; anahtar kareler aynı işi görür. Değişikliği korumak için kaydedin.",
+ "studio.clipsNowForwards": "{0} önceki bir sürümde tersten oynuyordu, artık ileri oynuyor. Birini seçip tepsideki Ters Çevir'e basarak yeniden ters çevirin; değişikliği korumak için kaydedin.",
"studio.closeProject": "Projeyi kapat",
"studio.closeWindow": "Pencereyi kapat",
"studio.couldNotExportAudio": "Ses dışa aktarılamadı: {0}",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 7a9c13dd..3fbd0ef6 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "倒放处理期间片段已更改;请重新倒放",
"studio.clipHasNoSound": "这个片段没有可导出的声音",
"studio.clipsDoNotMeet": "这两个片段在同一轨道上并不相邻",
+ "studio.clipsLostAnimations": "{0} 使用了本版本已不再提供的预设动画;关键帧可以实现同样的效果。保存即可保留此更改。",
+ "studio.clipsNowForwards": "{0} 在早期版本中倒放,现在改为正放。选中一个并按托盘上的“倒放”即可再次倒放;保存即可保留此更改。",
"studio.closeProject": "关闭项目",
"studio.closeWindow": "关闭窗口",
"studio.couldNotExportAudio": "无法导出音频:{0}",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index 0e1f05d0..f31f73f2 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -865,6 +865,8 @@
"studio.clipChangedWhileBeing": "倒轉處理期間片段已變更;請重新倒轉",
"studio.clipHasNoSound": "這個片段沒有可匯出的聲音",
"studio.clipsDoNotMeet": "這兩個片段在同一軌道上並不相鄰",
+ "studio.clipsLostAnimations": "{0} 使用了本版本已不再提供的預設動畫;關鍵影格可以達到相同效果。儲存即可保留這項變更。",
+ "studio.clipsNowForwards": "{0} 在較早版本中倒放,現在改為正放。選取一個並按托盤上的「倒轉播放」即可再次倒放;儲存即可保留這項變更。",
"studio.closeProject": "關閉專案",
"studio.closeWindow": "關閉視窗",
"studio.couldNotExportAudio": "無法匯出音訊:{0}",
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index 8edb423a..183dceca 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -1841,6 +1841,14 @@ fn retired_effects(project: &Project) -> Vec<String> {
names
}
+/// Names for a notice: the first three, and how many more there are.
+fn few(names: &[String]) -> String {
+ match names.len() {
+ 0..=3 => names.join(", "),
+ count => format!("{} +{}", names[..3].join(", "), count - 3),
+ }
+}
+
/// What the confirmation sheet can ask about.
#[derive(Clone, Debug, PartialEq)]
pub enum Confirm {
@@ -6756,6 +6764,26 @@ impl Studio {
false,
);
}
+ // Clips that played backwards or moved by a preset in an
+ // earlier version, which this one does not read: named,
+ // with the way back where there is one.
+ let retired = self
+ .session
+ .as_ref()
+ .map(|session| session.retired().clone())
+ .unwrap_or_default();
+ if !retired.reversed.is_empty() {
+ self.notify(
+ &tf("studio.clipsNowForwards", &[&few(&retired.reversed)]),
+ false,
+ );
+ }
+ if !retired.animated.is_empty() {
+ self.notify(
+ &tf("studio.clipsLostAnimations", &[&few(&retired.animated)]),
+ false,
+ );
+ }
// Log missing media to file for debugging
if let Some(session) = &self.session {