| ... | ... | @@ -621,6 +621,7 @@ impl Engine { |
| 621 | 621 | | "pKill" |
| 622 | 622 | | "pMerge" |
| 623 | 623 | | "pBounce" => self.dummy.clone(), |
| 624 | "Custom" if node.connected_node("Image1").and_then(|s| comp.find_node(s)).is_none() => self.dummy.clone(), |
| 624 | 625 | "Custom" => self.eval_custom(comp, node, time, frame_i, comp_dims, enc, visiting, stats), |
| 625 | 626 | "Renderer3D" => self.eval_renderer3d(comp, node, time, frame_i, comp_dims, enc, visiting, stats), |
| 626 | 627 | other => { |
| ... | ... | @@ -816,6 +817,39 @@ Composition { |
| 816 | 817 | assert!(pl[2] > 240 && pl[0] < 15 && pl[1] < 15, "SwLegacy2 expected blue, got {:?}", &pl[..4]); |
| 817 | 818 | } |
| 818 | 819 | |
| 820 | #[test] |
| 821 | fn custom_without_image1_renders_nothing() { |
| 822 | let src = r#" |
| 823 | Composition { |
| 824 | CurrentTime = 0, |
| 825 | RenderRange = { 0, 0 }, |
| 826 | GlobalRange = { 0, 0 }, |
| 827 | Tools = ordered() { |
| 828 | Unwired = Custom { |
| 829 | Inputs = { |
| 830 | RedExpression = Input { Value = "0.7", }, |
| 831 | AlphaExpression = Input { Value = "1", }, |
| 832 | }, |
| 833 | }, |
| 834 | Dangling = Custom { |
| 835 | Inputs = { |
| 836 | Image1 = Input { SourceOp = "NoSuchTool", Source = "Output", }, |
| 837 | RedExpression = Input { Value = "0.7", }, |
| 838 | AlphaExpression = Input { Value = "1", }, |
| 839 | }, |
| 840 | }, |
| 841 | }, |
| 842 | } |
| 843 | "#; |
| 844 | let comp = Comp::from_fusion_str(src).expect("parse custom comp"); |
| 845 | let mut eng = Engine::new_headless().expect("gpu"); |
| 846 | for name in ["Unwired", "Dangling"] { |
| 847 | let (t, _) = eng.evaluate(&comp, comp.find_node(name).unwrap(), 0.0); |
| 848 | let px = eng.readback_rgba(&t).unwrap(); |
| 849 | assert_eq!(&px[..4], &[0, 0, 0, 0], "{name} must be transparent without Image1"); |
| 850 | } |
| 851 | } |
| 852 | |
| 819 | 853 | #[test] |
| 820 | 854 | fn frame_memo_distinguishes_subframe_times_within_same_rounded_frame() { |
| 821 | 855 | // BG1 animates TopLeftRed from 0.0 at t=9.0 to 1.0 at t=10.0. |