# Importing SVG files without losing transparency data

I've been using Blender to make things like these: stylized vector illustrations made with Inkscape or Illustrator, imported as layered transparent pngs into Blender. The effect is easier to understand if you watch the youtube video.

I'm using transparent PNGs because SVGs shapes imported into Blender loose their transparency data.

Imported SVGs come with color information all right, but it would be great if one could import SVGs into Blender without losing the transparency data of the individual shapes. I imagine for each individual shape an emission shader with the color information plugged into a mix shader node along with a transparent shader, with the transparency data used as fac.

My question: is that import procedure feasible with a script or a plugin?

• Oh, yes, I get SVG color in Blender 2.91 if in Illustrator Export settings I choose SVG Tiny 1.2. As for transparency, still no luck. Hopefully someone will bring us some light. Jan 15 at 13:04
• I confirm that imported vector files saved in Illustrator as SVG Tiny 1.2 are imported as colored overlapping curves into Blender. Blender 2.91, Windows 10. You may also try this: youtube.com/watch?v=YJeipIO0wcw Jan 15 at 15:21
• Thanks. Now it is weird more than before. I used "Save as..." and just by opening "More..." to see if "Presentation Attributes" is set, it worked for SVG 1.0 and 1.1 without any special touch. Hmm... (BTW for any "Tiny" the "Presentation Attributes" is not available and it still wants any transparency rasterise into image.) Never mind, colors are there. Thanks. I will delete my comment to don't mess your question with my off topic here. BTW there is no feature to import SVG with alpha, so someone with golden hands will have to write better add-on for that. Jan 15 at 16:14

The SVG importer is very basic, it will not deal with any effects used on vector drawing programs, you can only import the path and color, no alpha.

But even if you manage to import the alpha channel, the different paths would end up overlapping on the same plane, creating Z-fighting problems.

An alternative solution would be to rasterize the paths as different images.

Then use the import images as planes and select all of the images at the same time to import.

On the top right of the import window, click on the gear icon to reveal the options for the importer.

There is an option to offset the imported images on a particular axis and determine the offset distance:

If you use the $$Z$$ axis you should get a lineup like this:

For cycles you might need to increase the number of Transparency bounces in the light path section of the render properties.

You might need to adjust the clip distance for camera and viewport, so that you don't run into Z-fighting issues.

• > An alternative solution would be to rasterize the paths as different images This is precisely what I have being doing (see screenshot above), and it isn't a satisfactory solution for may reasons, specially performance. A vector illustration may consist easily of more than a thousand individual shapes. Blender can handle these numbers easily if imported as curves, but it will crash suddenly if I try to render that many imported rasterized planes. To circumvent that limitation I've been cramming many individual vector paths into a single rasterized layer, but the result is truncated. Jan 16 at 10:28
• > Even if you manage to import the alpha channel, the different paths would end up overlapping on the same plane, creating Z-fighting problems. That wouldn't be a problem, since the plugin intelligently imports the svg's individual shapes as ordered layers that take into account their relative position in the original drawing, so they can be easily moved into position in 3D space. I have used this method to move hundreds of imported paths into position in this animation: instagram.com/p/CJGrkBEIlYU Unfortunately in the process the imported shapes lost their opacity data. Jan 16 at 10:28
• > The SVG importer is very basic, it will not deal with any effects used on vector drawing programs, you can only import the path and color, no alpha. That's precisely the irritating limitation I'm trying to circumvent =) In the svg file the opacity information for each object is readily available as a factor between 0 and 1. This data could directly inform the factor of transparency in a mix shader node... Jan 16 at 10:30
• Feel free to modify the SVG importer and make it available for others.
– susu
Jan 26 at 21:45