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
+2 -3
View File
@@ -98,7 +98,7 @@ std::string cad_recipe; // empty for non-CAD projects
```
```
Metadata/SnapOrca_cad.bin // written only when cad_recipe is non-empty
Metadata/orca_cad.bin // written only when cad_recipe is non-empty
```
Readers that do not know the entry ignore it; writers skip it entirely when empty. So
@@ -107,8 +107,7 @@ existing projects are bit-identical and old readers are unaffected. Good.
**But the moment upstream ships this, it owns forward-compatibility forever.** Three
things should be settled *before* the first release, because none can be changed after:
1. **Name.** `SnapOrca_cad.bin` is fork-branded in an upstream project file. Rename to a
neutral path (e.g. `Metadata/cad_recipe.bin`).
1. **Name.** Renamed to `Metadata/orca_cad.bin`.
2. **Encoding.** The recipe is an opaque **cereal `PortableBinaryArchive`** blob whose
layout is the field order of `CadFeature::serialize`. Portable across endianness and
word size — *not* across a field reorder. Append-only is currently a convention held by