Skip to content
Snippets Groups Projects
Commit 0796f5a8 authored by Folkert de Vries's avatar Folkert de Vries
Browse files

Fixes T49855 - Exception when there is no line set

The UI code assumed the existence of an active lineset. Turns out that
the final lineset can be removed (unlike render layers, where there is
always at least one).
parent a49ccb06
Branches
Tags
No related merge requests found
...@@ -190,19 +190,28 @@ class SVGExporterLinesetPanel(bpy.types.Panel): ...@@ -190,19 +190,28 @@ class SVGExporterLinesetPanel(bpy.types.Panel):
scene = context.scene scene = context.scene
svg = scene.svg_export svg = scene.svg_export
freestyle = scene.render.layers.active.freestyle_settings freestyle = scene.render.layers.active.freestyle_settings
linestyle = freestyle.linesets.active.linestyle
layout.active = (svg.use_svg_export and freestyle.mode != 'SCRIPT') try:
row = layout.row() linestyle = freestyle.linesets.active.linestyle
column = row.column()
column.prop(linestyle, 'use_export_strokes')
column = row.column() except AttributeError:
column.active = svg.object_fill # Linestyles can be removed, so 0 linestyles is possible.
column.prop(linestyle, 'use_export_fills') # there is nothing to draw in those cases.
# see https://developer.blender.org/T49855
return
row = layout.row() else:
row.prop(linestyle, "stroke_color_mode", expand=True) layout.active = (svg.use_svg_export and freestyle.mode != 'SCRIPT')
row = layout.row()
column = row.column()
column.prop(linestyle, 'use_export_strokes')
column = row.column()
column.active = svg.object_fill
column.prop(linestyle, 'use_export_fills')
row = layout.row()
row.prop(linestyle, "stroke_color_mode", expand=True)
class SVGExport(bpy.types.PropertyGroup): class SVGExport(bpy.types.PropertyGroup):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment