Freestyle seed in noise modifier can be zero (leading to crash) #89081

Closed
opened 2021-06-12 08:26:12 +02:00 by Hanafi A. Hassan · 9 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: AMD Radeon(TM) R4 Graphics ATI Technologies Inc. 4.5.13558 Core Profile Context 26.20.11016.1

Blender Version
Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: 84da05a8b8

Short description of error
Issue is that seed on the freestyle noise modifier can be zero (leading to division by zero)

Exact steps for others to reproduce the error

#89081.blend

  • Open file
  • F12 to render
  • crash
Python: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 1558, in process
    shaders_list.append(ThicknessNoiseShader(
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 616, in __init__
    NoiseShader.__init__(self, amplitude, period, seed)
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 595, in __init__
    self.scale = 1 / period / seed
ZeroDivisionError: float division by zero

Original report:

  1. Duplicate scene into "CompositingSet" and "LineSet" each.

  2. For "LineSet", set render engine to 'cycles', sampling of render to '1', in the film check the transparent box, freestyle check. In view layer properties > filter > include > UNcheck all EXCEPT 'Volumes'.

  3. For "CompositingSet". in the compositing workspace, connect nodes as follow: - texture > [2X] multiply (connect in one of the value input) > displace ( x and y scale) > viewerAND [2] Render layer "CompositingSet" +Render layer "LineSet" > Alpha Over > displace (image) > viewer

  4. In graph editor, apply noise modifier to: 1) "LineSet" scene > View Layer properties > FreeStyle Line Style > Thickness > Add modifier >Seed :: 2) "CompositingSet" scene > Node of 'texture' > Offset: Z

  5. In graph editor, for channel 'Seed' and 'Offset: Z', add keyframe at time '0' and '25'. Then, go to tab key > sample keyframes. Next, disable noise modifiers on both channel 'Seed' and 'Offset Z'.

  6. Render Animation [F12] and CRASH!

Hope the team stay healthy and safe. If you guys fixed this, it'll be a game changer in NPR rendering (like Beastars).
Thank you!
Crash render after compositing and freestyle.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: AMD Radeon(TM) R4 Graphics ATI Technologies Inc. 4.5.13558 Core Profile Context 26.20.11016.1 **Blender Version** Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: `84da05a8b8` **Short description of error** Issue is that seed on the freestyle noise modifier can be zero (leading to division by zero) **Exact steps for others to reproduce the error** [#89081.blend](https://archive.blender.org/developer/F10391130/T89081.blend) - Open file - F12 to render - crash ``` Python: Traceback (most recent call last): File "<string>", line 1, in <module> File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 1558, in process shaders_list.append(ThicknessNoiseShader( File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 616, in __init__ NoiseShader.__init__(self, amplitude, period, seed) File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 595, in __init__ self.scale = 1 / period / seed ZeroDivisionError: float division by zero ``` --- Original report: 1. Duplicate scene into "CompositingSet" and "LineSet" each. 2. For "LineSet", set render engine to 'cycles', sampling of render to '1', in the film check the transparent box, freestyle check. In view layer properties > filter > include > UNcheck all EXCEPT 'Volumes'. 3. For "CompositingSet". in the compositing workspace, connect nodes as follow: **- [x]**texture > [2X] multiply (connect in one of the value input) > displace ( x and y scale) > viewer**AND [2**] Render layer "CompositingSet" +Render layer "LineSet" > Alpha Over > displace (image) > viewer 4. In graph editor, apply noise modifier to: 1) "LineSet" scene > View Layer properties > FreeStyle Line Style > Thickness > Add modifier >Seed :: 2) "CompositingSet" scene > Node of 'texture' > Offset: Z 5. In graph editor, for channel 'Seed' and 'Offset: Z', add keyframe at time '0' and '25'. Then, go to tab key > sample keyframes. Next, disable noise modifiers on both channel 'Seed' and 'Offset Z'. 6. Render Animation [F12] and CRASH! Hope the team stay healthy and safe. If you guys fixed this, it'll be a game changer in NPR rendering (like Beastars). Thank you! [Crash render after compositing and freestyle.blend](https://archive.blender.org/developer/F10167932/Crash_render_after_compositing_and_freestyle.blend)

Added subscriber: @HanafiHikari

Added subscriber: @HanafiHikari
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm.

Issue is that seed on the noise modifier can be zero (leading to division by zero) and can be seen in much simpler file, see

#89081.blend

Python: Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 1558, in process
    shaders_list.append(ThicknessNoiseShader(
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 616, in __init__
    NoiseShader.__init__(self, amplitude, period, seed)
  File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 595, in __init__
    self.scale = 1 / period / seed
ZeroDivisionError: float division by zero
Can confirm. Issue is that seed on the noise modifier can be zero (leading to division by zero) and can be seen in much simpler file, see [#89081.blend](https://archive.blender.org/developer/F10391130/T89081.blend) ``` Python: Traceback (most recent call last): File "<string>", line 1, in <module> File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 1558, in process shaders_list.append(ThicknessNoiseShader( File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 616, in __init__ NoiseShader.__init__(self, amplitude, period, seed) File "/build_linux/bin/3.0/scripts/freestyle/modules/parameter_editor.py", line 595, in __init__ self.scale = 1 / period / seed ZeroDivisionError: float division by zero ```
Philipp Oeser changed title from [CRASH] Unable to render after compositing and freestyle to Freestyle seed in noise modifier can be zero (leading to crash) 2021-09-09 16:46:52 +02:00
Philipp Oeser self-assigned this 2021-11-23 10:47:56 +01:00
Member

Should just be forced to positive / non-zero.
Not sure if it mandatory to have a version patch in do_versions for this, but will check on these.

Should just be forced to positive / non-zero. Not sure if it mandatory to have a version patch in `do_versions` for this, but will check on these.

This issue was referenced by 9d519f1db4

This issue was referenced by 9d519f1db48602b5b728ae4fcef2bae6c2369c6f

This issue was referenced by f3ba6ac182

This issue was referenced by f3ba6ac1820f53aa04ba2d8601c5a2a2204d8287

This issue was referenced by ef88047a97

This issue was referenced by ef88047a97a10283cca21a3fe75c8d69d8fc40eb
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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
3 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#89081
No description provided.