Reproduction files (4)
superslicer_style.3mf, 24.4 KB: download
prusa_control.3mf, 2.1 KB: download
#!/usr/bin/env python3
"""Generate a minimal SuperSlicer-style 3MF, faithful to SuperSlicer's exporter
(merill/SuperSlicer, a fork of PrusaSlicer's 3MF writer):
- Application metadata: "SuperSlicer-2.6.59.0" (no "PrusaSlicer" substring)
- 3D/3dmodel.model: <object id="N" type="model"> with vertices/triangles as direct
children (3MF core spec) and NO name attribute (SuperSlicer/PrusaSlicer do not
write object names into the model xml; they live in the sidecar configs)
- Object names live in the sidecars Metadata/Slic3r_model.config,
Metadata/Slic3r_PE_model.config, Metadata/SuperSlicer_model.config as
<object id="N"><metadata type="object" key="name" value="..."/></object>
- No 3D/_rels/3dmodel.model.rels, no Bambu project files
Usage: make_superslicer_3mf.py OUT.3mf [APPLICATION_STRING]
"""
import sys, zipfile
OUT = sys.argv[1] if len(sys.argv) > 1 else "superslicer_style.3mf"
APP = sys.argv[2] if len(sys.argv) > 2 else "SuperSlicer-2.6.59.0"
MODEL = """<?xml version="1.0" encoding="UTF-8"?>
<model unit="millimeter" xml:lang="en-US" xmlns="http://schemas.microsoft.com/3dmanufacturing/core/2015/02">
<metadata name="Application">{APP}</metadata>
<resources>
<object id="1" type="model">
<vertices>
<vertex x="0" y="0" z="0"/><vertex x="10" y="0" z="0"/><vertex x="10" y="10" z="0"/><vertex x="0" y="10" z="0"/>
<vertex x="0" y="0" z="10"/><vertex x="10" y="0" z="10"/><vertex x="10" y="10" z="10"/><vertex x="0" y="10" z="10"/>
</vertices>
<triangles>
<triangle v1="0" v2="2" v3="1"/><triangle v1="0" v2="3" v3="2"/>
<triangle v1="4" v2="5" v3="6"/><triangle v1="4" v2="6" v3="7"/>
<triangle v1="0" v2="1" v3="5"/><triangle v1="0" v2="5" v3="4"/>
<triangle v1="1" v2="2" v3="6"/><triangle v1="1" v2="6" v3="5"/>
<triangle v1="2" v2="3" v3="7"/><triangle v1="2" v2="7" v3="6"/>
<triangle v1="3" v2="4" v3="7"/><triangle v1="3" v2="7" v3="4"/>
</triangles>
</object>
<object id="2" type="model">
<vertices>
<vertex x="0" y="0" z="0"/><vertex x="20" y="0" z="0"/><vertex x="20" y="20" z="0"/><vertex x="0" y="20" z="0"/>
<vertex x="0" y="0" z="10"/><vertex x="20" y="0" z="10"/><vertex x="20" y="20" z="10"/><vertex x="0" y="20" z="10"/>
</vertices>
<triangles>
<triangle v1="0" v2="2" v3="1"/><triangle v1="0" v2="3" v3="2"/>
<triangle v1="4" v2="5" v3="6"/><triangle v1="4" v2="6" v3="7"/>
<triangle v1="0" v2="1" v3="5"/><triangle v1="0" v2="5" v3="4"/>
<triangle v1="1" v2="2" v3="6"/><triangle v1="1" v2="6" v3="5"/>
<triangle v1="2" v2="3" v3="7"/><triangle v1="2" v2="7" v3="6"/>
<triangle v1="3" v2="4" v3="7"/><triangle v1="3" v2="7" v3="4"/>
</triangles>
</object>
</resources>
<build>
<item objectid="1" transform="1 0 0 10 0 1 0 10 0 0 1 0 0 0 1" printable="1"/>
<item objectid="2" transform="1 0 0 60 0 1 0 10 0 0 1 0 0 1 0 0 1" printable="1"/>
</build>
</model>""".format(APP=APP)
def model_config():
objs = []
for oid, name in [(1, "LDO_Skirt_Left"), (2, "LDO_Skirt_Right")]:
objs.append(f' <object id="{oid}" instancescount="1">\n'
f' <metadata type="object" key="name" value="{name}"/>\n'
f' <volume firstid="0" lastid="11"/>\n'
f' </object>\n')
return '<?xml version="1.0" encoding="UTF-8"?>\n<config>\n' + "".join(objs) + '</config>\n'
CONTENT_TYPES = """<?xml version="1.0" encoding="UTF-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
<Default Extension="model" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"/>
<Default Extension="png" ContentType="image/png"/>
<Default Extension="config" ContentType="application/octet-stream"/>
<Default Extension="txt" ContentType="text/plain"/>
<Default Extension="gcode" ContentType="text/plain"/>
</Types>"""
RELS = """<?xml version="1.0" encoding="UTF-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Target="/3D/3dmodel.model" Id="rel0" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel"/>
</Relationships>"""
with zipfile.ZipFile(OUT, "w", zipfile.ZIP_DEFLATED) as z:
z.writestr("[Content_Types].xml", CONTENT_TYPES)
z.writestr("_rels/.rels", RELS)
z.writestr("3D/3dmodel.model", MODEL)
for f in ("Metadata/Slic3r_model.config",
"Metadata/Slic3r_PE_model.config",
"Metadata/SuperSlicer_model.config"):
z.writestr(f, model_config())
print("wrote", OUT, "with Application =", APP)
# Issue #13368 — SuperSlicer 3mf imports lose object names ("Object_N")
Status: **reproduced** on main (commit f939e2b1e) with the Release binary at $ORCA_BIN,
using the MCP harness under Xvfb.
## What the bug is
`Model::read_from_archive` (src/libslic3r/Model.cpp:542) asks
`PrusaFileParser::check_3mf_from_prusa` whether a .3mf is slic3r-family. That check
only sets `m_from_prusa` when the `<metadata name="Application">` text contains the
literal substring `"PrusaSlicer"` — src/libslic3r/Format/3mf.cpp:368:
```cpp
if (!str.empty() && str.find("PrusaSlicer") != std::string::npos) m_from_prusa = true;
```
SuperSlicer writes `Application = "SuperSlicer-2.6.59.0"`, so the test fails and the
file is routed to `load_bbs_3mf` instead of `load_3mf`. SuperSlicer stores object
names only in the sidecar configs (`Metadata/Slic3r_PE_model.config` etc., as
`<object id="N"><metadata type="object" key="name" value="..."/></object>`); it does
NOT write a `name` attribute on `<object>` in `3D/3dmodel.model`. The BBS reader only
uses the `name` attribute (bbs_3mf.cpp:5791) and falls back to:
```cpp
// src/libslic3r/Format/bbs_3mf.cpp:2325
model_object->name = "Object_"+std::to_string(object.second+1);
```
Hence "Object_1, Object_2, ...".
## Repro files
- `make_superslicer_3mf.py` — generates a minimal but valid SuperSlicer-style 3MF
(two objects "LDO_Skirt_Left"/"LDO_Skirt_Right", no `name` attributes in the model
xml, names only in Metadata/Slic3r_model.config, Slic3r_PE_model.config and
SuperSlicer_model.config). Usage:
`python3 make_superslicer_3mf.py OUT.3mf ["Application string"]`
- `superslicer_style.3mf` — Application = `SuperSlicer-2.6.59.0` (the bug case)
- `prusa_control.3mf` — byte-identical except Application = `PrusaSlicer-2.6.1`
(the control that proves it is only the substring test at play)
Note: the .3mf files from the previous session were invalid XML (stray `<mesh>`
wrapper) and failed to load at all; they have been regenerated and validated.
## Steps (all from $WT)
```
orca-mcp launch --bin $ORCA_BIN --xvfb
orca-mcp call project_open "{\"path\":\"$PWD/repro/superslicer_style.3mf\"}" --wait
# -> {"names": ["Object_1", "Object_2"], ...} <-- BUG
orca-mcp call object_list # names are Object_1 / Object_2
orca-mcp screenshot repro/ss_superlicer_loaded.png --target main
orca-mcp call project_open "{\"path\":\"$PWD/repro/prusa_control.3mf\"}"
orca-mcp call dialog_answer '{"button":"OK"}' # "The 3MF is not supported by OrcaSlicer, loading geometry data only."
orca-mcp call object_list # names are LDO_Skirt_Left / LDO_Skirt_Right <-- correct
orca-mcp screenshot repro/ss_prusa_control_loaded.png --target main
orca-mcp stop
```
## Observed
- SuperSlicer-signature file: object list shows **Object_1, Object_2**
(ss_superlicer_loaded.png).
- Identical file with "PrusaSlicer" signature: object list shows
**LDO_Skirt_Left, LDO_Skirt_Right** (ss_prusa_control_loaded.png), after a
"The 3MF is not supported by OrcaSlicer, loading geometry data only." dialog —
i.e. even the Prusa route only recovers geometry + names, not settings, but at
least the names survive.
This confirms both halves of the cause:
1. routing decision: 3mf.cpp:368 substring test on "PrusaSlicer" (and Model.cpp:542);
2. symptom origin: bbs_3mf.cpp:2325 "Object_N" fallback.
## Fix-direction note for the next job
The reporter's proposed patch (detect the sidecar via `MODEL_CONFIG_FILE`) actually
does work in THIS codebase, contrary to the earlier summary's concern: here
`MODEL_CONFIG_FILE = "Metadata/Slic3r_PE_model.config"` (3mf.cpp:103) and it is
exactly the slic3r-family model-config sidecar that `_3MF_Importer::_extract_model_config_from_archive`
(3mf.cpp:1376) reads to restore names, and which SuperSlicer writes. Simpler and
closer to the reporter's diagnosis would be to widen the substring test at
3mf.cpp:368 to also accept "SuperSlicer"/"Slic3r". A caveat either way: routing
SuperSlicer files into load_3mf also subjects their Metadata/Slic3r_PE_model.config
to settings import, and raises the "not supported by OrcaSlicer" dialog seen with
the control file.