mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-11 16:33:01 -06:00
PSD: take the integration branch's adapted non-finite test and psd_import formatting (#1149)
The six PSD PRs merged one by one leave #1131's test calling samples()/to_rgb(), which #1139 replaced; vangel76's integration draft #1149 has the adapted version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
02c412b835
commit
eb2b734059
@@ -111,16 +111,13 @@ struct Ctx<'a> {
|
||||
pub fn import(proj: &mut Project, psd: &Psd, path: &str, name: &str, retain: bool, rate: FrameRate, duration: Tick) -> PsdImport {
|
||||
let folder = proj.add_item(&format!("{name} Layers"), Label::Yellow, None, ItemKind::Folder);
|
||||
let mut cx = Ctx { psd, path, retain, folder, rate, duration, items: vec![], warnings: vec![] };
|
||||
cx.warnings.extend(psd.warnings.iter().cloned());
|
||||
let (tree, flattened) = psd.tree_report();
|
||||
if flattened > 0 {
|
||||
cx.warnings.push(format!("{flattened} group(s) nested deeper than {} levels were flattened into their parent", effectcraft_psd::MAX_GROUP_DEPTH));
|
||||
}
|
||||
cx.warnings.extend(psd.warnings.iter().cloned());
|
||||
let comp = if psd.layers.is_empty() && !psd.warnings.is_empty() {
|
||||
flattened_comp(proj, &mut cx, name)
|
||||
} else {
|
||||
build_comp(proj, &mut cx, name, &tree, None)
|
||||
};
|
||||
let comp =
|
||||
if psd.layers.is_empty() && !psd.warnings.is_empty() { flattened_comp(proj, &mut cx, name) } else { build_comp(proj, &mut cx, name, &tree, None) };
|
||||
PsdImport { comp, folder, items: cx.items, warnings: cx.warnings }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user