[Add-on] Export 2D Curve to SVG

Who doesn’t like to edit curves in Blender? :stuck_out_tongue:

I mean, precise transform operators that allow to input values or expressions, dynamic workflow with combination of hot-keys, a global pivot to do complex transformations, and you can even set the handle coordinates!

If that fancy curve could be exported… Blender can import vectors, why not export?

So I looked the Data-Blocks inside the Outliner to figure out how the curves are stored, then I wrote a simple python script that loops through the curve points to output a svg. It was actually easy, all the data needed is in there.

With this Add-on installed, select one or more curves (with the curve type set to 2D) and go to the Properties area and the Data (Curve) tab. The panel will be there with some options, then click in ‘Export’.

Python isn’t my main programming language, so the code is a little messy… And it still needs a lot of improvements, some of them I commented in there. If you can help in any way, let me know :o

Download the script on GitHub:

Comments are welcome

3 Likes

Nice!!!
I needed to do this same thing today, but I’m so lazy to write addons, just wrote a small xml converter, but filled all the other svg stuff by hand…

Your script will sure be handy!
Obrigado.

I already needed a lot before learning to use Inkscape :yes: but I really don’t like the tools to create paths in there… except the “organic” shapes you can make by dragging the curve itself, not the points – would be a good feature in blender, but it’s far away of what I can program :stuck_out_tongue:

Hello, ARYEL. I use your script all the time in version 2.79 during the vectorization of bitmap objects and it works great and thank you very much for that.
Are you planning to upgrade to version 2.8?
Thx

Hello, @Nanomanpro

Glad to see that my old script is useful! :smiley:

I will happily upgrade to version 2.8. Are you using the original script, or did you change anything?

I noticed the Dropbox link is broken, so I will upload to Github.

1 Like

Maybe old, but still great :slightly_smiling_face:
I’m using version 0.0.1 without any changes.

Hey, I just released v0.0.2! I made some refactoring, fixed some bugs and added a Scale property.
It is still compatible with Blender 2.7x. I noticed some problems with 2.80, and I even introduced another bug related to PEP 465.

I will create a branch for 2.80, and when it is finally released, I will merge with master.

Ok, I’ve got a working 2.80 branch! You can access here.
Let me know if you have any issues.

2 Likes

Hello, ARYEL. As far as I can see addon is doing great in 2.8 :).
Only CorelDraw has some minor problems with svg file interpretation (video below), but I can handle it.
Once again, thank You very much for this addon:)

Did CorelDraw work properly before? I can not test it…
But the generated file is almost the same.
I see you use Inkscape as well, and it works fine to me.

I made this add-on in a time when I was crazy looking for it :sweat_smile:
It is very minimal, a proper export for strokes and textures, or correct splines order would be nice.

Thank you for your appreciation!

Previously it was similar - this is an internal CorelDraw (also called BugDraw:P) problem, but despite its imperfections it is a great tool for fast and efficient work with vectors, did you know that the Mac version was recently released?
Inkscape deal perfectly with this type of SVG :slight_smile: