file.importProject: import an EffectCraft project into the open project
File > Import > EffectCraft Project (and .ecproj/.ecprojx given to File > Import) merges the project into a folder named after the file, with every id shifted past the open project's, in one undo step. Relative footage resolves next to the file; the result lists comps, root comps, primaryComp and missing media. offset_ids now shifts tracker Motion Targets and saturates instead of overflowing; fix_next_id saturates too, so a damaged file can't overflow on open or import. Menu entry translated in all ten menu catalogues. Rebased onto current upstream main for the split of #858 (test module list in engine lib.rs; es/pt-br/ru/fr/de/cs menu translations). (cherry picked from commit 19c653fccc95133fb35e978a7f7f20a18c0e8c89) (cherry picked from commit 4e751ad2) (cherry picked from commit ceed706cc3b5f3755769738a1ddb3d965a94ab6b)
This commit is contained in:
@@ -1394,10 +1394,11 @@ impl Project {
|
||||
pub fn fix_next_id(&mut self) {
|
||||
let mut m = self.next_id;
|
||||
for (id, it) in &self.items {
|
||||
m = m.max(id.0 + 1);
|
||||
// Saturating: a damaged file's ids must not overflow (the import then refuses it).
|
||||
m = m.max(id.0.saturating_add(1));
|
||||
if let ItemKind::Comp(c) = &it.kind {
|
||||
for l in &c.layers {
|
||||
m = m.max(l.id.0 + 1).max(l.props.max_uid() + 1);
|
||||
m = m.max(l.id.0.saturating_add(1)).max(l.props.max_uid().saturating_add(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user