From d91b14db54848d3447b11bb5e36c29afdd904b03 Mon Sep 17 00:00:00 2001 From: tylerjenningsw Date: Thu, 29 Oct 2026 19:30:31 -0400 Subject: [PATCH] Viewer: a precomp's undecodable proxy has its notice with Collapse on, now that a proxy keeps the flattened path (#1701) --- crates/ui-egui/src/panels/viewer.rs | 8 +++----- crates/ui-egui/tests/it/ui_unreadable_footage.rs | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/viewer.rs b/crates/ui-egui/src/panels/viewer.rs index a255bd321..d084dd006 100644 --- a/crates/ui-egui/src/panels/viewer.rs +++ b/crates/ui-egui/src/panels/viewer.rs @@ -8,8 +8,8 @@ use effectcraft_engine::commands::shape_tool::PaintKind; use effectcraft_engine::effects::puppet::PinKind; use effectcraft_engine::geom::{Mat3, vec2 as gv2}; use effectcraft_engine::project::{Comp, Layer, LayerId, LayerSource}; +use effectcraft_engine::render::EvalCtx; use effectcraft_engine::render::three_d::{self, CameraState, View3D}; -use effectcraft_engine::render::{EvalCtx, Renderer}; use effectcraft_engine::time::Tick; use egui::{Align2, Color32, Pos2, Rect, Sense, Stroke, StrokeKind, pos2, vec2}; use serde_json::json; @@ -721,13 +721,11 @@ fn phase_scene(app: &mut EffectcraftApp, ectx: &EvalCtx, v: &mut Vw<'_>) { } /// Up to three layers active at `time` whose footage, or the proxy in use for footage or a -/// precomp, can't be decoded, each with the reason. A collapsed precomp draws its own layers, -/// never the comp's proxy. +/// precomp, can't be decoded, each with the reason. fn footage_problems<'c>(app: &EffectcraftApp, ectx: &EvalCtx, comp: &'c Comp, time: Tick) -> Vec<(&'c Layer, String)> { - let r = Renderer::new(ectx.project, &*app.session.footage, Default::default()); comp.layers .iter() - .filter(|l| l.is_active_at(time) && l.switches.video && r.collapsed(ectx, l).is_none()) + .filter(|l| l.is_active_at(time) && l.switches.video) .filter_map(|layer| { let (LayerSource::Footage { item } | LayerSource::Comp { item }) = &layer.source else { return None }; Some((layer, ectx.project.item(*item).and_then(|i| app.session.footage.item_problem(i))?)) diff --git a/crates/ui-egui/tests/it/ui_unreadable_footage.rs b/crates/ui-egui/tests/it/ui_unreadable_footage.rs index 63e3a75c2..a62884f43 100644 --- a/crates/ui-egui/tests/it/ui_unreadable_footage.rs +++ b/crates/ui-egui/tests/it/ui_unreadable_footage.rs @@ -83,10 +83,10 @@ fn an_undecodable_proxy_in_use_is_marked_as_the_proxy() { assert!(notice.label.contains(&format!("Proxy: {WHY}")), "{notice:?}"); } -/// A precomp whose proxy can't be decoded: the layer says so while it renders through the -/// proxy, but not with Collapse Transformations on, which draws the precomp's own layers. +/// A precomp whose proxy can't be decoded: the layer says so with Collapse Transformations off +/// or on, since a proxy in use keeps the precomp on the flattened path that draws the proxy. #[test] -fn a_collapsed_precomp_has_no_notice_for_its_proxy() { +fn a_precomp_with_an_undecodable_proxy_has_a_notice_collapsed_or_not() { for collapse in [false, true] { let mut s = Session { footage: Arc::new(Stub(|f| f.path.ends_with(".avi"))), ..Default::default() }; s.execute("comp.new", json!({"name": "Inner", "width": 64, "height": 36, "duration": 4})).unwrap(); @@ -99,6 +99,6 @@ fn a_collapsed_precomp_has_no_notice_for_its_proxy() { s.execute("layer.addItem", json!({"item": inner.0})).unwrap(); s.execute("layer.setSwitch", json!({"layers": ["#1"], "switch": "collapse", "value": collapse})).unwrap(); let h = open(s); - assert_eq!(h.state().auto.query("viewer.footageProblem.").is_empty(), collapse, "collapse {collapse}"); + assert!(!h.state().auto.query("viewer.footageProblem.").is_empty(), "collapse {collapse}"); } }