Load the CAD recipe from projects saved before it was renamed

The recipe's 3MF entry moved from Metadata/SnapOrca_cad.bin to
Metadata/orca_cad.bin, so projects saved by earlier builds opened with an
empty Design tab. Both 3MF backends now read either name and write only the
new one; the recipe version advances to 6 to mark the move.
This commit is contained in:
SoftFever
2026-08-29 01:56:48 +08:00
parent 0fc62d03b9
commit 8f014de84c
7 changed files with 191 additions and 14 deletions
+7 -1
View File
@@ -3808,7 +3808,13 @@ bool CadDocument::deserialize_recipe(const std::string& blob)
+ std::to_string(ORCA_CAD_RECIPE_VERSION) + ")";
return false;
}
if (v == 5) {
// The framed layout has been byte-identical since v5 (v6 advanced the stamp without
// touching the bytes), so every version from 5 up is read below. A future bump that DOES
// change the framing must exclude itself there — this is what forces that decision
// instead of letting a v7 blob be silently misread by the v5 reader.
static_assert(ORCA_CAD_RECIPE_VERSION <= 6,
"recipe version bumped: confirm the new version still uses the v5 framing");
if (v >= 5) {
// Framed path: every feature is a length-prefixed self-contained cereal stream, so
// the same four lines handle BOTH directions of mismatch. Older file, newer build:
// the sub-stream ends early, fa(f) throws, and the fields already assigned are kept