Python scripting for lightburn files

Hey, so Im working really hard to create a generation script that creates paths to cut in lightburn.
The idea is to create a tile generator for a modular tabletop RPG tileset.
It’s working somewhat fine but I’m having issues making it fully compatible with lightburn. Lightburn doesn’t seem to fully implement the SVG standard and also, there are no controls for SVG, like, I can’t set cutting settings or add mask relationships.

So, basically, although the SVG works somewhat fine, when it’s imported into lightburn, it doesn’t work well with images nor cut presets.

I tried to reverse-engineer the XML format but it’s quite cumbersome.
It stores paths and control points in a non-intuitive way for reading, so Im having a real hard time working the issues out.

Are you guys planning on adding plugin support? Or at least expose the file format?
Is there a way to create mask relationships within SVGs that lightburn supports?

This is my current work, for reference:

1 Like

Take a look at this - Lightburn LBRN code is easier to write than LBRN2 Is LightBurn File Format (lbrn2) documented or open sourced?

1 Like

Thank you so much for this!
Now I just have to write some code to convert from svg to lightburn. I’ll share this once I get it going.

3 Likes

Instead of inserting cut settings (which will be extremely different for each setup), use the LB color palette to assign “layers” to your objects. LB does this during importing the SVG. If you search the forum or documentation, you find the list of color values that is used for each layer.

1 Like

Ty! I understand that and I’m doing that. The thing is, I’m abstracting the lightburn file generation into it’s own library, thus I wanted to expose this as well. It might be that for some specific conditions, the user might want to bind a setting to the file. It’s convenient and that’s the easy part.
But the library I wrote doesn’t add any cut settings by default, it uses the color palette.
The biggest hurdle and what I’m working on now is the function to convert an SVG to lightburn so I can add SVGs to the lighburn file directly. Still, this task is as big as writing the whole library because I have to support everything again, squares, ellipses… and paths. dang, paths are hard.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.