Repository navigation
Send to slicer: let an app that embeds the editor take the design directly (OrcaSlicer plugin tab) #2144
Replies: 2 comments 4 replies
|
@joaobordignon thanks, that's a really nice idea, and thanks for working out the details so carefully. Yes, I'd like a PR. My answers to your questions:
One wish from my side: I'd like this not to be about one slicer only. Could your plugin also cover Bambu Studio and PrusaSlicer, if they let a plugin show a page in a tab or window as OrcaSlicer 2.5 does? If one of them can't, a short note on what's missing would help, so the guide can say which slicers can use it today. A few things that would help with the review: only listen to |
|
Thanks again for merging #2169 and for the fixes you added on top. The OrcaSlicer plugin that uses it is now published:
It adds a layerling tab to OrcaSlicer 2.5+ (Linux for now) that shows layerling.com. Export → Send to OrcaSlicer puts the STL on the plate. Sending the same design again updates the file, so Reload from disk in Orca swaps the part in place. A small panel in Prepare lists the parts that came from layerling and links to layerling.com, the guide, GitHub Sponsors and Ko-fi. It is a community plugin and says so in the listing; nothing about it is official. If you'd like anything worded differently, or a link removed, just tell me. |
Uh oh!
There was an error while loading. Please reload this page.
Hi! I've been building an OrcaSlicer plugin that puts layerling in a tab next to Prepare / Preview / Device. OrcaSlicer 2.5 has Python plugins that can add full tabs with an HTML page, so the tab shows layerling in an iframe (
https://layerling.com/?editor=1, so it opens straight on the editor).What works today
What's missing
The user still has to go through the export window for every change. The plugin can't take the design itself, because layerling runs on its own origin inside the tab and nothing in the editor talks to the page around it. The MCP bridge would work, but it's switched off on layerling.com, and that's the right call.
The idea
A small opt-in handshake over
postMessage, between the editor and the window that frames it:{ type: "layerling:hello", version: 1 }on mount. It carries no design data.{ type: "layerling:host", version: 1, name: "OrcaSlicer", format: "stl" | "3mf" }{ type: "layerling:ready", version: 1 }{ type: "layerling:request-model", requestId, format }, sent by the host's own button (optional){ type: "layerling:model", version: 1, requestId, fileName, format, bytes, base64 }or{ type: "layerling:error", … }Once a host has introduced itself, the editor shows a Send to OrcaSlicer button, using whatever name the host gave. It sends the same file the export window writes. The editor only listens to
window.parent, and only when it is actually framed, so nothing changes for normal use.The file comes from the same code path as MCP
export_mesh: visible solids, holes cut, overlapping bodies merged for STL, colours kept for 3MF. The editor-side change is one component plus about 10 lines inLayerlingEditor.tsx.I have a prototype. It's a patch on v1.175.0 that type-checks and that I'm now testing in my local build: a floating button that only shows up when a host has said hello. The button's placement is your call, maybe next to Export in the File group. I'm happy to open a PR if you like the direction.
Questions for you
request-model), or only receive it when the user clicks the button? Letting the host ask is what makes a "Send to plate" button in the slicer possible. On the other hand, any page that frames layerling.com could then read whatever the user builds inside that frame. Storage partitioning means it wouldn't see the user's existing designs. If that's a concern, the click-only version, or a confirmation the first time, would be fine for my use.Thanks for layerling. It's a joy to design in!
All reactions