Freestyle SVG Export: Exception when render layer does not have a freestyle line set #49855
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#49855
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Windows 7 Professional SP1
NVIDIA GTX 960
Blender Version
Broken: (example: 2.78 4bble22
When the freestyle SVG export addon is enabled and there are no freestyle line sets but freestyle is enabled the SVGExporterLinesetPanel will query the active freestyle line style and cause and attribute error.
Should this be wrapped with a Try/Except, hasattr or poll function to prevent blender from attempting to access freestyle line styles when they do not currently exist?
Included below is a stack trace of the error as it occurred on my machine.
Exact steps for others to reproduce the error
Changed status to: 'Open'
Added subscriber: @awrigh502
Added subscribers: @flokkievids, @VukGardasevic
I can confirm the issue. The UI code doesn't have a check for lineset existence, resulting in firing up errors in the console.
@flokkievids Would you mind take a look? Thanks.
This issue was referenced by
0796f5a8ed
Changed status from 'Open' to: 'Resolved'
Added subscriber: @kjym3
This issue has been resolved. Thanks for the bug report!
@kjym3: The core issue here is that its possible to have 0 linesets whilst Freestyle is enabled. In contrast
a scene always has at least one render layer: it's impossible to remove the final one.
I don't see how having 0 linesets would be useful and would propose to make that impossible. Any thoughts?
If I remember correctly, I didn't even consider the possibility of imposing the constraint that there must be at least one lineset. It is easy to check if there's a lineset, and I was not aware of negative effects due to an empty set of linesets.
Making it impossible to have an empty set of linesets is not a good idea, because the data structure representing the set of linesets is part of a scene render layer. The memory for the set of linesets is hence allocated when a new scene render layer is created, so that the set of linesets needs to be populated by a default lineset, which in turn triggers the allocation of a new line style data block, no matter whether Freestyle is enabled or not. Having ten render layers would then imply ten line style data blocks in a .blend file even when you don't use Freestyle, which is unlikely acceptable from non-Freestyle users' perspective.
As to
0796f5a8ed
, you can simply test if freestyle.linesets.active is None and return from the draw() function if that is the case. You don't need to rely on a try-except clause.