Enabling Freestyle SVG Exporter add-on prevents Freestyle lines being visible in render #86257

Open
opened 2021-03-04 07:42:36 +01:00 by Nicolas · 8 comments

System Information
Operating system: Windows 10 Pro (2004) x64
Graphics card: Nvidia RTX 3080

Blender Version
Broken

  • 2.93.0
  • 2.92.0
  • 2.90.1

Description

The Freestyle SVG Exporter fails to export the result and prevents the Freestyle lines from being displayed, when the output directory doesn't exist.

Original description:
The Freestyle SVG Exporter prevents the Freestyle lines from being visible in renders. This was very puzzling since the references I could find online seem to suggest that Freestyle lines with the Freestyle SVG Exporter addon enabled should be visible in the render, including comments such as by Robert Guetzkow in the earlier bug report linked below.

No amount of changes to Freestyle's settings that I tried, or rendering it as a separate pass for the compositor made any difference to the (lack of) visibility of the Freestyle lines in the render when the addon is enabled.

Note: most of this bug report has been copied from my comment in this earlier reported bug , as per suggestion of @rjg since I could reproduce it in more recent versions of Blender.

Exact steps for others to reproduce the error

  1. Ensure that C:\tmp does not exist (either by renaming or deleting)
  2. Open the preferences (Edit > Preferences > Add-ons and enable Freestyle SVG Exporter
  3. Enable Render Properties > Freestyle and Render Properties > Freestyle SVG Export
  4. Render and observe the errors on the console
Traceback (most recent call last):
  File "Z:\02_software\blender-2.92.0-windows64\2.92\scripts\addons\render_freestyle_svg.py", line 294, in svg_export_header
    with open(create_path(scene), "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\tmp\\0001.svg'

Original steps:

  1. Open Blender's Add-ons preferences and enable 'Render: Freestyle SVG Exporter'.
  2. Open the default start-up scene (with the cube).
  3. Under the Properties pane>Render Properties check/enable 'Freestyle'.
  4. Render the scene (F12) and observe the Freestyle lines visible.
  5. Now go back to the Render Properties and check/enable 'Freestyle SVG Export' (for clarity: in addition to the already enabled 'Freestyle' option).
  6. Render the scene again and observe the Freestyle lines are no longer visible.

This occurs whether using Eevee or Cycles as the render engine.

Video demonstration

Attached video is while using a completely fresh profile and install of Blender 2.92.0, apart from the 'Freestyle SVG Exporter' addon being enabled.Demo.mp4

**System Information** Operating system: Windows 10 Pro (2004) x64 Graphics card: Nvidia RTX 3080 **Blender Version** Broken - 2.93.0 - 2.92.0 - 2.90.1 **Description** The *Freestyle SVG Exporter* fails to export the result and prevents the Freestyle lines from being displayed, when the output directory doesn't exist. Original description: The Freestyle SVG Exporter prevents the Freestyle lines from being visible in renders. This was very puzzling since the references I could find online seem to suggest that Freestyle lines with the Freestyle SVG Exporter addon enabled should be visible in the render, including comments such as by Robert Guetzkow in the earlier bug report linked below. No amount of changes to Freestyle's settings that I tried, or rendering it as a separate pass for the compositor made any difference to the (lack of) visibility of the Freestyle lines in the render when the addon is enabled. Note: most of this bug report has been copied from my comment in [this earlier reported bug ](https://developer.blender.org/T73950), as per suggestion of @rjg since I could reproduce it in more recent versions of Blender. **Exact steps for others to reproduce the error** 1. Ensure that `C:\tmp` does not exist (either by renaming or deleting) 2. Open the preferences (*Edit > Preferences > Add-ons* and enable *Freestyle SVG Exporter* 3. Enable *Render Properties > Freestyle* and *Render Properties > Freestyle SVG Export* 4. Render and observe the errors on the console ``` Traceback (most recent call last): File "Z:\02_software\blender-2.92.0-windows64\2.92\scripts\addons\render_freestyle_svg.py", line 294, in svg_export_header with open(create_path(scene), "w") as f: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\tmp\\0001.svg' ``` Original steps: 1. Open Blender's Add-ons preferences and enable 'Render: Freestyle SVG Exporter'. 2. Open the default start-up scene (with the cube). 3. Under the Properties pane>Render Properties check/enable 'Freestyle'. 4. Render the scene (F12) and observe the Freestyle lines visible. 5. Now go back to the Render Properties and check/enable 'Freestyle SVG Export' (for clarity: in addition to the already enabled 'Freestyle' option). 6. Render the scene again and observe the Freestyle lines are no longer visible. This occurs whether using Eevee or Cycles as the render engine. **Video demonstration** Attached video is while using a completely fresh profile and install of Blender 2.92.0, apart from the 'Freestyle SVG Exporter' addon being enabled.[Demo.mp4](https://archive.blender.org/developer/F9864854/Demo.mp4)
Author

Added subscribers: @rjg, @elan

Added subscribers: @rjg, @elan
Author

Discovered the cause of this issue:

The default output directory for Blender is /tmp\. Changing it to a custom directory (in my test the Desktop) resulted in the correct behavior of Freestyle displaying in the render while the Freestyle SVG Exporter checkbox is enabled.

Not sure if /tmp\ is equivalent/routed to the Windows temp directory (which Blender does use for various things) but either way it's unexpected behavior to be triggered by merely leaving Blender's default output directory as-is.

This may explain why Robert couldn't reproduce the issue earlier if they were using a non-default output directory?

FWIW, both Blender versions I have installed were installed to the default paths in the Program Files directory.

Discovered the cause of this issue: The default output directory for Blender is `/tmp\`. Changing it to a custom directory (in my test the Desktop) resulted in the correct behavior of Freestyle displaying in the render while the Freestyle SVG Exporter checkbox is enabled. Not sure if `/tmp\` is equivalent/routed to the Windows temp directory (which Blender does use for various things) but either way it's unexpected behavior to be triggered by merely leaving Blender's default output directory as-is. This may explain why Robert couldn't reproduce the issue earlier if they were using a non-default output directory? FWIW, both Blender versions I have installed were installed to the default paths in the Program Files directory.

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

@elan Does the C:\tmp directory exist on your system?

Please open Blender's installation directory and double click on the blender_debug_log.cmd. This will start Blender in debug mode and create log files. Try to make Blender fail to render the FreeStyle outline again. Once it does, close Blender. The Windows Explorer should open and show you up to two files, a debug log and the system information. Add them to your bug report by clicking on the upload button as shown in the screenshot below or via drag and drop.

2019_12_04_upload_icon_developer_blender_org.png

@elan Does the `C:\tmp` directory exist on your system? Please open Blender's installation directory and double click on the `blender_debug_log.cmd`. This will start Blender in debug mode and create log files. Try to make Blender fail to render the FreeStyle outline again. Once it does, close Blender. The Windows Explorer should open and show you up to two files, a debug log and the system information. Add them to your bug report by clicking on the upload button as shown in the screenshot below or via drag and drop. ![2019_12_04_upload_icon_developer_blender_org.png](https://archive.blender.org/developer/F8190038/2019_12_04_upload_icon_developer_blender_org.png)
Author

Does the C:\tmp directory exist on your system?

No. If that's where Blender defaults to for its output directory I'm not sure why it does when %temp% is the regular Windows environment variable for a temp directory (even the blender_debug_log.cmd uses it for its log file output).

Attached are the logs. It would appear Blender tries to write an SVG to the non-existant default output directory, fails, and thus for some reason blocks the rendering of the Freestyle lines within Blender.

blender_system_info.txt

blender_debug_output.txt

> Does the C:\tmp directory exist on your system? No. If that's where Blender defaults to for its output directory I'm not sure why it does when `%temp%` is the regular Windows environment variable for a temp directory (even the `blender_debug_log.cmd` uses it for its log file output). Attached are the logs. It would appear Blender tries to write an SVG to the non-existant default output directory, fails, and thus for some reason blocks the rendering of the Freestyle lines within Blender. [blender_system_info.txt](https://archive.blender.org/developer/F9865294/blender_system_info.txt) [blender_debug_output.txt](https://archive.blender.org/developer/F9865293/blender_debug_output.txt)

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

That add-on doesn't check whether the directory exists and doesn't attempt to create it. Using os.makedirs(path, exist_ok=True) should avoid this problem.

That add-on doesn't check whether the directory exists and doesn't attempt to create it. Using `os.makedirs(path, exist_ok=True)` should avoid this problem.

@elan I can't give you a definitive answer for past design decisions, but that has been the default output directory on Windows for as long as I can remember. Presumably as a mirror to the Linux tmp directory and to be more user accessible (many users likely wouldn't know what %TEMP% is and where to find it). However, that is just speculation on my part.

@elan I can't give you a definitive answer for past design decisions, but that has been the default output directory on Windows for as long as I can remember. Presumably as a mirror to the Linux `tmp` directory and to be more user accessible (many users likely wouldn't know what `%TEMP%` is and where to find it). However, that is just speculation on my part.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#86257
No description provided.