# SVG output script

**URL:** <https://blenderartists.org/t/svg-output-script/566412>\
**Category:** Released Add-ons and Extensions\
**Created:** [February 23, 2013, 9:51am UTC](https://blenderartists.org/t/svg-output-script/566412 "2013-02-23T09:51:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![liero](https://blenderartists.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@liero](https://blenderartists.org/u/liero)\
**Post date:** [February 23, 2013, 9:51am UTC](https://blenderartists.org/t/svg-output-script/566412/1 "2013-02-23T09:51:37Z")

</div>

Hi, here is a script I’ve been playing with for a while: the idea is to get some quick vector output from Blender to feed Inkscape. It is not meant to be a NPR solution -as Freestyle will be- but you can still do some basic tricks. And it is pretty useful for simple shapes and so… I also tried to add a few abstract and geometric stuff into the mix.

Script will export current viewport -think a screen capture application- to a SVG file. Works with meshes and curves. I suggest you to open the svg file in a browser -Opera is very fast- and use it as a viewer while you play with settings. SVG code can also be edited inside the browser.

2.79 script: [https://www.dropbox.com/s/93xguzky732ajy8/export\_svg.py?dl=1](https://www.dropbox.com/s/93xguzky732ajy8/export_svg.py?dl=1)  
2.80 version: [https://www.dropbox.com/s/keur0yo5w4ipohw/export\_svg\_280.py?dl=1](https://www.dropbox.com/s/keur0yo5w4ipohw/export_svg_280.py?dl=1)

 ![](https://blenderartists.org/uploads/default/original/3X/7/4/74d3279272c006b0b49f72c79e74c6394b2746b9.jpg)  

the SVG vector files for the picture above: [https://www.dropbox.com/s/cnm4krfprorcv43/SVG.zip?dl=1](https://www.dropbox.com/s/cnm4krfprorcv43/SVG.zip?dl=1)

A couple of tips:

- limit the amount of exported geometry to get a faster export, but also to get different looks…

- use viewport to frame the objects, you can go ortho mode or edit lens value, check distortions

- ‘add to svg’ allows to append shapes to your svg, something like a ‘multiple exposure’ 😛

edit: added some help here: [https://www.dropbox.com/s/mbp3z4l4hwyg86n/settings.jpg?dl=1](https://www.dropbox.com/s/mbp3z4l4hwyg86n/settings.jpg?dl=1)

cheers

---

<div class="post-metadata">

**Author:** ![swmo](https://blenderartists.org/user_avatar/blenderartists.org/swmo/32/22769_2.png) [@swmo](https://blenderartists.org/u/swmo)\
**Post date:** [February 23, 2013, 12:22pm UTC](https://blenderartists.org/t/svg-output-script/566412/2 "2013-02-23T12:22:13Z")

</div>

Very interesting. Thank you!

---

<div class="post-metadata">

**Author:** ![matali](https://blenderartists.org/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@matali](https://blenderartists.org/u/matali)\
**Post date:** [February 23, 2013, 12:27pm UTC](https://blenderartists.org/t/svg-output-script/566412/3 "2013-02-23T12:27:04Z")

</div>

thanks a lot Liero 🙂

---

<div class="post-metadata">

**Author:** ![vklidu](https://blenderartists.org/user_avatar/blenderartists.org/vklidu/32/4040_2.png) [@vklidu](https://blenderartists.org/u/vklidu)\
**Post date:** [February 23, 2013, 3:48pm UTC](https://blenderartists.org/t/svg-output-script/566412/4 "2013-02-23T15:48:04Z")

</div>

Wow !!! What a day 🙂 would be hard to wait until Monday to test it. Image looks awesome. Thank you man.

---

<div class="post-metadata">

**Author:** ![kgeogeo](https://blenderartists.org/letter_avatar_proxy/v4/letter/k/9fc348/32.png) [@kgeogeo](https://blenderartists.org/u/kgeogeo)\
**Post date:** [February 23, 2013, 4:34pm UTC](https://blenderartists.org/t/svg-output-script/566412/5 "2013-02-23T16:34:30Z")

</div>

Just Wow!!!

---

<div class="post-metadata">

**Author:** ![Benkei](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/b5ac83/32.png) [@Benkei](https://blenderartists.org/u/Benkei)\
**Post date:** [February 23, 2013, 11:32pm UTC](https://blenderartists.org/t/svg-output-script/566412/6 "2013-02-23T23:32:50Z")

</div>

Great! That’s a really useful add-on! Thanks so much.  
I am eager to see the next major step.  
Svg animation?

---

<div class="post-metadata">

**Author:** ![tungee](https://blenderartists.org/user_avatar/blenderartists.org/tungee/32/6710_2.png) [@tungee](https://blenderartists.org/u/tungee)\
**Post date:** [February 24, 2013, 3:32am UTC](https://blenderartists.org/t/svg-output-script/566412/7 "2013-02-24T03:32:15Z")

</div>

Great as Always! Hope Campell doesnt break this Addon too!  
Edit: This is a Killer Addon!!!  
Such great possibilities!

---

<div class="post-metadata">

**Author:** ![Safetyman](https://blenderartists.org/user_avatar/blenderartists.org/safetyman/32/897453_2.png) [@Safetyman](https://blenderartists.org/u/Safetyman)\
**Post date:** [February 24, 2013, 3:48am UTC](https://blenderartists.org/t/svg-output-script/566412/8 "2013-02-24T03:48:03Z")

</div>

Which version of Blender is this for? I can’t seem to get it to work with v2.66.

 ![](https://blenderartists.org/uploads/default/original/3X/0/3/03d420dd955c134b7555ab320ed8cf0f04e07bb2.jpg)

---

<div class="post-metadata">

**Author:** ![ejnaren](https://blenderartists.org/user_avatar/blenderartists.org/ejnaren/32/645982_2.png) [@ejnaren](https://blenderartists.org/u/ejnaren)\
**Post date:** [February 24, 2013, 3:59am UTC](https://blenderartists.org/t/svg-output-script/566412/9 "2013-02-24T03:59:40Z")

</div>

@liero: No words man, no words! I am going to test this right now!

FOLLOWUP: It works great! I could not get it to export curves but the rest works very very very good!  
It is a very well done addon! All the options makes it so powerful.  
It is amazing.

Question: I see you use a scale option. How does the size of the resulting SVG objects compare to the size of the object? Say if I export a box where each edge is 10 cm in ortho mode. Is there a way to get the SVG edges to be 10cm in the .svg file?

Congrats again on this great tool! I will have to look through the source soon.

---

<div class="post-metadata">

**Author:** ![Atom](https://blenderartists.org/user_avatar/blenderartists.org/atom/32/2832_2.png) [@Atom](https://blenderartists.org/u/Atom)\
**Post date:** [February 24, 2013, 6:09am UTC](https://blenderartists.org/t/svg-output-script/566412/10 "2013-02-24T06:09:15Z")

</div>

@safetyman: Try specifying a folder on your desktop for output. If that does not work turn off _Relative Path_. I had a similar crash when I tried it out. But Absolute Pathing to an existing folder that you have permissions too will work.

---

<div class="post-metadata">

**Author:** ![Safetyman](https://blenderartists.org/user_avatar/blenderartists.org/safetyman/32/897453_2.png) [@Safetyman](https://blenderartists.org/u/Safetyman)\
**Post date:** [February 24, 2013, 6:30am UTC](https://blenderartists.org/t/svg-output-script/566412/11 "2013-02-24T06:30:57Z")

</div>

@Atom – thanks that worked. I’ll have to play around with the settings, but it looks to work really well. You also must select an object or objects for it to render anything.

@Liero – thanks for creating this. I’ve been waiting for something like this for a long time. Great job!

---

<div class="post-metadata">

**Author:** ![alan.zirpoli](https://blenderartists.org/user_avatar/blenderartists.org/alan.zirpoli/32/571323_2.png) [@alan.zirpoli](https://blenderartists.org/u/alan.zirpoli)\
**Post date:** [February 24, 2013, 6:53am UTC](https://blenderartists.org/t/svg-output-script/566412/12 "2013-02-24T06:53:22Z")

</div>

i was waiting for something like this too. Can you share the setting of the different example you post here?

---

<div class="post-metadata">

**Author:** ![liero](https://blenderartists.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@liero](https://blenderartists.org/u/liero)\
**Post date:** [February 24, 2013, 8:21am UTC](https://blenderartists.org/t/svg-output-script/566412/13 "2013-02-24T08:21:48Z")

</div>

thanks for the response guys, good to see you found this useful!

@safetyman sorry for the path problem, that needs to be properly coded  
@ejnaren I meant beveled curves, but added a simplistic way to render 3D un-beveled curves as paths; and pixels are just screen pixels atm, the scale works by multiplying this values… as a quick hack I could add an option to calculate scale -just ortho mode-  
@alan.zirpoli will try to add some way of storing and retrieving the settings from svg file, then I could upload some examples

main issues are related to z ordering of faces and objects, also my math / coding skills are pretty basic so things could surely run faster and better

been doing some fixes, so maybe download the script again…

---

<div class="post-metadata">

**Author:** ![ejnaren](https://blenderartists.org/user_avatar/blenderartists.org/ejnaren/32/645982_2.png) [@ejnaren](https://blenderartists.org/u/ejnaren)\
**Post date:** [February 24, 2013, 1:59pm UTC](https://blenderartists.org/t/svg-output-script/566412/14 "2013-02-24T13:59:26Z")

</div>

@liero: I cant tell you how useful that it already is!  
I have been researching which is the easiest way to get renders in scale from blender. I am an architect so it is very useful.  
By being bale to export drawings directly from blender you have essentially opened Blender for me to use as my main modeling app.

The ortho scale option might be better to add as an alternative addon? Some times you want to get your normal renders out in a certain scale as well. The render to print addon helps though:)

Anyway I just wanted to give you an idea:  
If the viewport / camera is in ortho mode. Then curves and handles are distorted uniformly. Meaning that even though the curve is 3D and the viewport is rotated the handles as seen in the viewport shapes the curve as seen in the viewport.

I have traced a simple bezier inkscape over a screenshot from blender.  
ie: ORTHO:

 ![](https://blenderartists.org/uploads/default/original/3X/e/b/eb76fdaa0231174e3d2e6a46e71ceafbb9cb4fac.png)  
  
Export function in other app all subdivide the curve making it into hundreds of segments to approximate it.  
I would be cool if the curve could be exported as is. Only works in ortho mode though: PERSPECTIVE:  
 ![](https://blenderartists.org/uploads/default/original/3X/f/b/fbf733cabfc75cbfa1264ff467c1fbd819596380.png)  
  
I dont know to much about curve math in perspective distortion but it seems the handles are the same angle at the viewport but needs some scaling factor.

I am sorry for this looong post but you have made my week. Im gonna let go now and go to bed.  
Thanks for the work man. It will work wonders for drawing sections of buildings with the cross section script I ported some time ago.

---

<div class="post-metadata">

**Author:** ![dphantom](https://blenderartists.org/user_avatar/blenderartists.org/dphantom/32/1287673_2.png) [@dphantom](https://blenderartists.org/u/dphantom)\
**Post date:** [February 24, 2013, 5:34pm UTC](https://blenderartists.org/t/svg-output-script/566412/15 "2013-02-24T17:34:46Z")

</div>

Oh man this one hell of a useful addon.  
God knows I have dreamt about something like this, think of the possibilities!  
This is gonna be great for exporting orthographic views elevations plans etc…

So many thanks!! Gonna give it a try soon

---

<div class="post-metadata">

**Author:** ![84d](https://blenderartists.org/user_avatar/blenderartists.org/84d/32/22645_2.png) [@84d](https://blenderartists.org/u/84d)\
**Post date:** [February 24, 2013, 10:40pm UTC](https://blenderartists.org/t/svg-output-script/566412/16 "2013-02-24T22:40:42Z")

</div>

This is great. Thank You so much, You made my day!  
i cant wait to try this.

---

<div class="post-metadata">

**Author:** ![liero](https://blenderartists.org/letter_avatar_proxy/v4/letter/l/53a042/32.png) [@liero](https://blenderartists.org/u/liero)\
**Post date:** [February 24, 2013, 10:45pm UTC](https://blenderartists.org/t/svg-output-script/566412/17 "2013-02-24T22:45:17Z")

</div>

added a fixed scale option when in ortho mode -in fact this script started as orthogonal only- but I guess the right solution would be to implement camera support; will think on the curves idea too…

@dphantom and @84d don’t get too excited as it can get a bit tricky to get nice results… share anything cool you make 😉

---

<div class="post-metadata">

**Author:** ![3Duaun](https://blenderartists.org/user_avatar/blenderartists.org/3duaun/32/8099_2.png) [@3Duaun](https://blenderartists.org/u/3Duaun)\
**Post date:** [February 25, 2013, 2:22am UTC](https://blenderartists.org/t/svg-output-script/566412/18 "2013-02-25T02:22:36Z")

</div>

WOW! great work on the various styles

---

<div class="post-metadata">

**Author:** ![eXKR](https://blenderartists.org/letter_avatar_proxy/v4/letter/e/839c29/32.png) [@eXKR](https://blenderartists.org/u/eXKR)\
**Post date:** [February 25, 2013, 4:33am UTC](https://blenderartists.org/t/svg-output-script/566412/19 "2013-02-25T04:33:55Z")

</div>

Awesome!!!

Just one thing: is it possible that you add the parameter configuration for all the examples? that way it would be much easier to get an overall idea of “what each parameter is used for”…  
Thanks, great work.

---

<div class="post-metadata">

**Author:** ![alan.zirpoli](https://blenderartists.org/user_avatar/blenderartists.org/alan.zirpoli/32/571323_2.png) [@alan.zirpoli](https://blenderartists.org/u/alan.zirpoli)\
**Post date:** [February 25, 2013, 7:24am UTC](https://blenderartists.org/t/svg-output-script/566412/20 "2013-02-25T07:24:39Z")

</div>

> [@eXKR](#):
>
> Awesome!!!
> 
> Just one thing: is it possible that you add the parameter configuration for all the examples? that way it would be much easier to get an overall idea of “what each parameter is used for”…  
> Thanks, great work.

That’s what I’ve meant too!

[Next page](https://blenderartists.org/t/svg-output-script/566412.md?page=2)
