.aep import: a Channel Info record without its data is reported as damaged

import_extra returned as soon as the arbitrary data was missing, so an
EXtractoR or IDentifier value record whose aRbs/aRbp payload is gone was
silently imported with the default channels; the payload may have chosen
other ones (Z). As for Lumetri's data parameters, a stored record without its
payload now adds a DamagedData loss; a parameter with no record stays the
silent default. The test now asserts the report.
This commit is contained in:
vangel76 committed 2026-11-08 02:32:56 +01:00
1 parent 67a39d9a2b
commit b90950c6a2
2 files changed
+16 -3

No files matched your search

+9 -1
View File
@@ -438,7 +438,15 @@ fn import_extra(fx: &AepEffect<'_, '_>, extra: Extra, p: &EffectParam<'_, '_>, h
col.lose(LossCategory::Effects, format!("{here}: keyframes or an expression on {} are not imported", p.name));
}
let Some(data) = fx.arbitrary_data(&p.match_name) else {
// No data: every value is at its default.
// No record: every value is at its default. A Channel Info value record without its
// aRbs/aRbp payload (every sampled record has it) is damaged: the payload may have chosen
// other channels (`Z`), so the defaults are not what After Effects renders.
if p.stored().is_some() && matches!(extra, Extra::Extractor | Extra::Identifier) {
col.lose(
LossCategory::DamagedData,
format!("{here}: the Channel Info data is missing (a value record without its data), the default channels used"),
);
}
return;
};
let mut set = |id: &str, v: f64| {
@@ -270,13 +270,16 @@ fn identifier_names_without_a_terminator_or_in_invalid_utf8_are_refused() {
}
/// A Channel Info value record without its arbitrary data (no `aRbs`): the effect still imports,
/// with the defaults, and nothing panics.
/// with the defaults, nothing panics, and the missing data is reported as damaged (it may have
/// chosen other channels, so the defaults are not what After Effects renders).
#[test]
fn a_missing_channel_info_payload_leaves_the_defaults() {
fn a_missing_channel_info_payload_is_reported_and_leaves_the_defaults() {
let mut fx = extractor(vec![], vec![]);
fx.data.clear();
let (g, r) = run(&fx, "ec.3d.extractor");
assert_eq!(losses(&r, LossCategory::Effects, "EXtractoR"), Vec::<String>::new());
let found = losses(&r, LossCategory::DamagedData, "EXtractoR");
assert!(found.len() == 1 && found[0].contains("Channel Info data is missing"), "{found:?}");
let g = g.expect("imported");
for (id, want) in [("red", "R"), ("green", "G"), ("blue", "B"), ("alpha", "A")] {
assert_eq!(v(&g, id), Value::Str(want.into()), "{id}");
@@ -285,6 +288,8 @@ fn a_missing_channel_info_payload_leaves_the_defaults() {
fx.data.clear();
let (g, r) = run(&fx, "ec.3d.identifier");
assert_eq!(losses(&r, LossCategory::Effects, "IDentifier"), Vec::<String>::new());
let found = losses(&r, LossCategory::DamagedData, "IDentifier");
assert!(found.len() == 1 && found[0].contains("Channel Info data is missing"), "{found:?}");
let g = g.expect("imported");
assert_eq!(v(&g, "channelType"), Value::Enum(0));
near(&g, "id", 5.0);