Dev:Ref/Release Notes/2.73/Freestyle

From Blender Developer Wiki
Jump to: navigation, search

Freestyle NPR Rendering

Freestyle improvements include: A new Add-on to export SVGs, a new option to cache view maps and some more options for sorting and chain selection.

Built-in SVG Exporter

File:Blender273 FreestyleSVGExport.png
Freestyle SVG Export options.

Freestyle now has a built-in SVG exporter. This feature is implemented as an addon and can be enabled in the user preferences (render section). Features of the exporter include:

  • An user interface
  • Integration with the parameter editor and some of its settings, in particular:
    • Base color, transparency and thickness (no modifiers applied)
    • Visibility
    • Stroke caps
    • Dashes
  • Support for animation
  • Some extra attributes that make manipulation of the exporter's result in Inkscape easier.
  • The ability to export fills (a closed external contour with the underlying material's color)

Contributors: Folkert de Vries, Campbell Barton and Tamito Kajiyama.


How to Use the SVG Exporter

  1. Open the User Preference window (CtrlAltU) and go to the Add-ons section.
  2. Look for Render: Freestyle SVG Exporter and enable it.
  3. Go to the Render context of the Properties window, and check the toggle button in the Freestyle SVG export tab (next to the Freestyle tab, as shown in the figure above).
  4. Render your scene with Freestyle enabled as usual.
  5. Find exported SVG files in the animation output directory specified in the Output tab. Generated SVG files follow Blender's file naming convention (i.e., prefix + frame number/range + extension) with the file extension replaced with .svg. A frame number is included as part of SVG file names when the SVG export mode is set to Frame, whereas a frame range (indicated by the start and end frame) is used for the Animation export mode.

SVG Export Examples

File:Blender 273 Tomo final.png
Finished artwork composed of color and Freestyle line components (courtesy of Tomo).
File:Blender 273 Tomo Freestyle SVG output.png
Freestyle lines in SVG format seen in Inkscape (exported SVG file courtesy of Tomo).
File:Blender273 Freestyle SuzanneContours.png
Another example of Freestyle SVG export results (exported SVG file).

View Map Caching

New render layer option named View map cache is added to reuse a previously computed view map for subsequent rendering. The cache is automatically updated when the mesh geometry of the input 3D scene has been changed.

This functionality offers a major performance boost for Freestyle animation rendering when camera-space mesh geometry is static, as well as for repeated still renders with updates of line stylization options.

Although the View map cache toggle is a render layer option, the cache memory is shared by all render layers and scenes. This means that if Freestyle is used for two or more render layers (possibly in different scenes through the compositor), then the cached view map for one render layer is replaced by a new view map for another render layer and hence no performance gain is expected.


Sorting and Chain Selection

File:Blender273 FreestyleSortingSelection.png
New options for sorting and chain selection.

The following two sort keys are added for sorting chains, in addition to the existing options Distance from Camera and 2D Length.

  • Projected X - Sort by the projected X value in the image coordinate system.
  • Projected Y - Sort by the projected Y value in the image coordinate system.

A new line style option called Chain Count is also added to allow for the selection of first N chains.

Moreover, the chain sorting and chain selection operations are now executed in this order instead of the reverse order used previously. The UI has also changed accordingly. This functional change is backward compatible and won't result in visual differences.