cache: use disk states to share caches

This commit is contained in:
itsmattkc
2022-06-05 19:47:33 -07:00
parent 13299d0a3b
commit 25699ef05b
14 changed files with 109 additions and 50 deletions
-2
View File
@@ -47,8 +47,6 @@ Footage::Footage(const QString &filename) :
valid_(false),
cancelled_(nullptr)
{
SetCacheTextures(true);
PrependInput(kLoopModeInput, NodeValue::kCombo, 0, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
PrependInput(kFilenameInput, NodeValue::kFile, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
@@ -90,7 +90,11 @@ ProjectSerializer220403::LoadData ProjectSerializer220403::Load(Project *project
qWarning() << "Failed to find node with ID" << id;
reader->skipCurrentElement();
} else {
// Disable cache while node is being loaded (we'll re-enable it later)
node->SetCachesEnabled(false);
LoadNode(node, xml_node_data, reader);
node->setParent(project);
}
}
@@ -312,6 +316,11 @@ ProjectSerializer220403::LoadData ProjectSerializer220403::Load(Project *project
}
}
// Re-enable caches
for (Node *n : project->nodes()) {
n->SetCachesEnabled(true);
}
return load_data;
}