Page MenuHome

Diffuse material colour not assigned to stroke when rendering to SVG using Freestyle
Closed, ArchivedPublic

Description

System Information
Windows 7 64 bit
NVidia GeForce GT 425M

Blender Version
Broken: 2.73-rc

When trying to render to svg, the resulting strokes always have the Base Color as set in Freestyle Line Style under Color instead of the colour resulting from modifiers, like Along Stroke or Material.

Exact steps for others to reproduce the error
Create a scene with a few objects which have a Diffuse colour
Enable Freestyle and Freestyle SVG Export
In Freestyle Line Style (in the Render Layers tab), click Color and add the modifier Material
Set to Mix and Diffuse Color (if you used a diffuse colour on that material, the bug appears with either Specular or Freestyle Line)
Change the Base Color so it's not black
Render
View the resulting svg file in your favorite svg editor: the strokes all have the Base Color instead of the diffuse material colour as expected
When selecting Fill Contours in Freestyle SVG Export, the filled areas do have the correct material colour but the strokes are still in base colour

I don't know if this is really a bug since filled areas (when that option is selected) have the correct colour so that the outlines of the shapes are visible. But I have an application where only the strokes are used (and their colour). In that case consider this a feature request where you can apply a custom (preferrably material) colour to strokes.

Details

Type
Bug

Event Timeline

I guess it could be generalised to all color modifiers in Freestyle Line Style instead of only material. None of them appear to have an effect on the svg (they do affect the produced bitmap image tough).

Tamito Kajiyama (kjym3) closed this task as Archived.Jan 2 2015, 1:12 PM

The reported behaviour of the SVG exporter is a feature and not a bug. The rationale is that individual lines in an exported figure are SVG paths, each of which can have a fixed color, transparency, and line width. Hence only the base line color, alpha and thickness specified in a line style are applied to SVG lines. All modifiers for these line properties are simply ignored. On the other hand geometry modifiers are taken into account.

Just revised the Freestyle section of the Blender 2.73 release logs to better highlight the fact that only the base line color, transparency and thickness take effects and no modifiers are applied.

To elaborate a little further:

SVG doesn't support per-vertex style, where Freestyle does. this makes an exact conversion impossible. We decided that the best solution would be to export the base stroke color.
If you do need to export a specific style, please send me a message and we'll have a look at the possibilities.

I apologise for being new to this website and not having figured out how to send messages, I hope a comment is also acceptable.

Even though per-vertex colouring is not possible, I do believe per-stroke colouring is. Maybe this can be an option as the next best thing?

I'm not in a hurry for this as I currently can output to dxf using Freestyle and a custom plugin, which works fine with material colour. But I expect it won't keep on working as Blender progresses so I got very excited when learning Blender could generate proper 2D vector art natively.