Skip to content

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

The monitor renders cutouts: its flattening now knows the project folder

Jareer90b29f80d7ca
diff --git a/engine/crates/concat/src/studio.rs b/engine/crates/concat/src/studio.rs
index 0981c25d..2b02299f 100644
--- a/engine/crates/concat/src/studio.rs
+++ b/engine/crates/concat/src/studio.rs
@@ -1503,8 +1503,15 @@ impl Studio {
};
// The echo when there is one: a picture being dragged on the stage
// is drawn where the pointer has it, not where the document last
- // had it. Same flattening the session does for itself.
- let mut clips = concat_export::flatten::flatten_timeline(self.project(), None);
+ // had it. Same flattening the session does for itself, project
+ // folder included: that is what names a cutout's masks, and
+ // without it the monitor would show every cutout as shot.
+ let project_dir = std::path::PathBuf::from(session.path());
+ let mut clips = concat_export::flatten::flatten_timeline_in(
+ self.project(),
+ None,
+ Some(&project_dir),
+ );
let (width, height) = self.output_size();
// Titles, painted to pictures and rejoined; see concat-host's titles.
for title in self.host.titles.clips(self.project(), width, height) {
diff --git a/engine/crates/concat/ui/inspector/clip-inspector.slint b/engine/crates/concat/ui/inspector/clip-inspector.slint
index 9e720cd9..69672620 100644
--- a/engine/crates/concat/ui/inspector/clip-inspector.slint
+++ b/engine/crates/concat/ui/inspector/clip-inspector.slint
@@ -960,7 +960,7 @@ export component VideoPanel inherits VerticalLayout {
maximum: 0.1;
step: 0.002;
default-value: 0.01;
- fmt: ParamFormat.percent;
+ fmt: ParamFormat.fraction;
changed(v) => { root.set(ClipField.cutout-feather, v); root.commit(); }
}
if root.removal == 1 && root.selected.cutout-progress >= 0: AnalysisRow {
@@ -1025,7 +1025,7 @@ export component VideoPanel inherits VerticalLayout {
maximum: 0.5;
step: 0.005;
default-value: 0.06;
- fmt: ParamFormat.percent;
+ fmt: ParamFormat.fraction;
changed(v) => { root.cutout-size(v); }
}
if root.removal == 2: Param {
@@ -1035,7 +1035,7 @@ export component VideoPanel inherits VerticalLayout {
maximum: 0.1;
step: 0.002;
default-value: 0.01;
- fmt: ParamFormat.percent;
+ fmt: ParamFormat.fraction;
changed(v) => { root.set(ClipField.cutout-feather, v); root.commit(); }
}
if root.removal == 2 && root.selected.cutout-progress >= 0: AnalysisRow {
diff --git a/engine/crates/concat/ui/inspector/controls.slint b/engine/crates/concat/ui/inspector/controls.slint
index 92154e69..402ed2d2 100644
--- a/engine/crates/concat/ui/inspector/controls.slint
+++ b/engine/crates/concat/ui/inspector/controls.slint
@@ -544,9 +544,11 @@ export component Subhead inherits VerticalLayout {
// A square tick box, for a block that is on or off among siblings that
// exclude it - the three ways of removing a background. A Switch says a
-// setting is on; a box among boxes says which one.
+// setting is on; a box among boxes says which one. The box never sets
+// itself: it asks, and shows whatever the owner then binds, so a tick
+// that the owner refuses does not stick.
export component Check inherits Rectangle {
- in-out property <bool> checked;
+ in property <bool> checked;
in property <bool> enabled: true;
callback toggled(checked: bool);
@@ -570,10 +572,7 @@ export component Check inherits Rectangle {
touch := TouchArea {
enabled: root.enabled;
mouse-cursor: pointer;
- clicked => {
- root.checked = !root.checked;
- root.toggled(root.checked);
- }
+ clicked => { root.toggled(!root.checked); }
}
}