SVG v0.5.9o : import path to bezier curve (2009/04/20)

SVG 2 OBJ translater, 0.5.9o
(c) jm soler juillet 2004-april 2009, 
    released under GPL
   for the Blender 2.33 to 2.49 Python Scripts Bundle.
# Page officielle :
# Communiquer les problemes et erreurs sur:

Can’t wait for it! And four posts for this pack of most useful import-scripts is alright! :wink:
And again, another great script by you!
Thanks in advance.
If you need someone to test it, just tell. I’m on Linux and dabbling around with Gimp and Inkscape … (beg… beg… must have it…)


also, sodipodi, which you can also install in Windows, is a great package and exports SVG :slight_smile: Nice plugin.

Released a few minutes ago.

CAUTION : this script write a new file with the same name of the imported one but with a .obj extension. If an other file with this name is yet in the same folder it will be erazed.

Wow, this is excellent, excellent, excellent news (along with the EPS import too)!

However, it won’t work for me, trying to open files saved from Adobe Illustrator.

I get this error:

Traceback (most recent call last):
File “<string>”, line 511, in fonctionSELECT
File “<string>”, line 461, in scan_FILE
File “<string>”, line 432, in get_BOUDBOX
File “<string>”, line 426, in get_val
ValueError: empty string for float()

testing file:

Thank for report these errors. I’ll try to correct.

( note :For the moment only path are
avaible and there is no one in this file, just
a polygon shape.)

In gimp 2.02, paths are saved as svg files without extension. One has to add that .

this is the most useful script of the year!

Now, the Gimp 2.0 path are correctly understand and the extension ‘.svg’ is no more needed…

Thanks for this script. However, I can’t use this as I get an error:

Traceback (most recent call last):
File “”, line 535, in fonctionSELECT
File “”, line 519, in scan_FILE
File “”, line 196, in Open_GEOfile
AttributeError: ‘module’ object has no attribute ‘Load’

The script reminds the user not to forget to change the file name then gives the above error. I tried this script with Inkscape and Gimp.

Windows 2000, Blender 233a


A b234 function, but yet in recent cvs compilation,
note that you can load it yourself, try to find the file
myfileOOO.obj , curves are in.

Thanks jms! I had a chance to test and it works great!


I need returns about this script from linux user . Does Anybody work with inkscape on linux and make some tests ?

i’m using Linux, and just tried this import plugin.

first tried with some self-made SVGs, exported from Dia, that I use to make UML-diagrams … such as which is about one project with Blender game-engine. importing that fails quietly - nothing is printed to the console, and nothing created in Blender (have both 3d & OOPS views to monitor that). import of another similarily made svg fails reporting:

File “/home/antont/install/blender-2.34-linux-glibc2.2.5-i386/./.blender/scripts/”, line 559, in format_PATH
D=D.split(’ ')
UnboundLocalError: local variable ‘D’ referenced before assignment

which, reading your source, seems to be a case where find(’ d="') didn’t find anything…?

    if PATH.find(' d="')!=-1:
    D=D.split(' ')

Then I tried with some pre-installed Gnome svg icons that were in /usr/share - /usr/share/icons/gnome/scalable/emblems/emblem-cool.svg which fails differently:

File “/home/antont/install/blender-2.34-linux-glibc2.2.5-i386/./.blender/scripts/”, line 611, in scan_FILE
courbes,n0,CP=Actions[cell]([cell,cursor], D, n0,CP)
File “/home/antont/install/blender-2.34-linux-glibc2.2.5-i386/./.blender/scripts/”, line 383, in courbe_vers_c
if D[c[1]+4] not in TAGcourbe :
IndexError: list index out of range

Finally I found one svg that worked, in the Inkscape examples, markers.svg . It is created as a nice looking pair of sunglasses, made as a Bezier, in Blender. Some others (at least gradient.svg) fail with that same error (in courbe_vers_c).

Hopefully this report was helpful, and do tell more about what you wish Linux users to test … I think I’ll try saving as .ps from Dia and importing those with this plugin next


first of all thanks for your script,
i’ve exported sone svg with an open source software called lx viewer ( ) able to convert dvg and dxf files in svg format.

your scrip doesn’ t seem to work with these files, but maybe you ca have a look at it.

after importing this svg into gimp2.0 and exporting from gimp to svg the script give me this error:

['M', 0] 0.88,0.36
['0.88', '0.36']
Traceback (most recent call last):
  File "C:\Programmi\Blender Foundation\Blender\.blender\scripts\"
, line 648, in fonctionSELECT
  File "C:\Programmi\Blender Foundation\Blender\.blender\scripts\"
, line 616, in scan_FILE
    courbes,n0,CP=Actions[cell]([cell,cursor], D, n0,CP)
  File "C:\Programmi\Blender Foundation\Blender\.blender\scripts\"
, line 388, in courbe_vers_c
    courbe_vers_c(c, D, n0,CP)
  File "C:\Programmi\Blender Foundation\Blender\.blender\scripts\"
, line 367, in courbe_vers_c[l[4],
IndexError: list index out of range

hope can help

tnx 4 your work

Ok ! I will have a look at it.

This is not a pure path (no path at all in it) svg file. Translated with inkskape
(to export correct path(s) with inskape select all object and do ctrl-shift-c, but
this file gives bad results) it seems to contain shapes in “false” svg format
like path without a z key at end the line .

finally I can export something from coreldraw direct in bezier curve!!!

before: corel (dxf) > qcad (open-save-close) > blender (and modele on the dxf base!!)

corel > inkscape (onpen-save-close) > blender (ready)… :):):slight_smile:

thanks very much … I will test this right now!!!

A correction to inskape 0.4
copy this new script in the /.blender/scripts/bpymodules folder

in fact, .blender/scripts/bpymodules folder does not exists before blender 2.37