← All ideas
  • Categories
  • Published 12 Nov 2017

Blender SVG importer needs CSS parser

Currently, it seems that the SVG file importer doesn't any more work with the modern SVG files created in Illustrator. For graphical design work, this is very important. We cannot anymore import coloured SVG files. Only Black colour is supported and then you need manually to fix the graphics, which can be a very time-consuming job to do.

I've let know that it is because of CSS styles in the SVG files.

80%

Development Status: Open

Upvote 4 Downvote 1
artturi85
12 Nov 2017

9 Comments

jenkm

You just need to set the CSS Properties (when selecting Save As...) or Styling (when selecting Export As...) option to the Presentational Attributes in the SVG Options dialog box.

2
artturi85 Author

@Yevgeny Makarov: But in a case when one has no access to the original file and he is basically only doing the 3d-job? I think it would be very important that Blender supports the normal file types we possibly can get from a client. No one would know that Blender supports only inline styling if they have not read countless random forum posts in random online places. That is also mostly the basic problem when using Blender professionally. You always need to go somewhere searching add-ons that you don't even know if they exist or checking "hacks" to do simple tasks.

Sry about this. It had to be said.

jason

What version of Blender are you using? I use SVG import all the time with files created in Inkscape and it works just fine (including color).

artturi85 Author

@Jason van Gumster: 2.79. Always when I import svg file, I get only black materials. dropbox.com/s/l1hdm0zq3rnthtl/logo1.svg

jason

@Artturi Mäntysaari: That SVG was made in Illustrator and it looks like AI did something unexpected with formatting of the file. Try this: Open the SVG in Inkscape and ungroup (<kbd>Alt</kbd>+<kbd>G</kbd>) everything. Now re-save as an SVG in Inkscape. After doing that, if you import into Blender, you should see the colors without problem.

What this means is that there's likely a bug in the SVG importer that's specific to whatever wonky think AI is doing. In which case, the best move would be to file a bug report at developer.blender.org . Include your SVG with the bug report and feel free to link to this post to show the work-around.

artturi85 Author

@Jason van Gumster: Okay, I made this bug report: developer.blender.org/T53278

1
artturi85 Author

@Artturi Mäntysaari: Sergey told me this:

"Our SVG importer is quite simple, and does not support styles created by CSS. There isn't really a fix here unless someone volunteers to write a CSS parser for the importer :)

So thanks for the report, but it's rather lack of feature than a bug here. "

So I am back here for asking a new feature.

1
jason

@Artturi Mäntysaari: In that case, I would recommend that you revise the description (and perhaps the title) of your proposal to more accurately reflect the specific feature you're looking for.

In this case, it would be the ability to parse CSS styles in an SVG file upon import.

artturi85 Author

@Jason van Gumster: I've updated this.

1