'use_freestyle' reports freestyle is off during viewport render #53919

Closed
opened 2018-01-27 19:37:56 +01:00 by Ray Mairlot · 4 comments

System Information
Windows 10 64-bit, Graphics cards: GTX 570, GT 610 (display).

Blender Version
Broken: 7b29e91 (latest Windows 64-bit build)
Worked: -

Short description of error

I am trying to test if freestyle is on or off from a frame_change_post handler so my code is not run when rendering in the viewport in Blender Render while Freestyle is enabled (related to my add-on mentiond here: blender/blender#53801)

When use_freestyle is printed from a frame_change_post handler it will print the correct value (ie. use_freestyle will return True) if the viewport isn't set to 'Rendered' mode. When changing to 'Rendered' viewport shading mode the frame handler will trigger (though I don't know why it is triggering) and report that freestyle is not running (ie. use_freestyle will return False).

This only happens when 'Blender Render' is the render engine. This doesn't happen in Cycles (nor is the frame handler even triggered when changing to 'Rendered' shading) and doesn't happen when there are no objects in the scene.

Exact steps for others to reproduce the error

Freestyle frame handler bug.blend

  1. Open the attached file.
  2. Run the script in the attached file in the text editor.
  3. Change frame and look in the System Console. "Using freestyle!" will be printed.
  4. Change to 'Rendered' viewport shading mode.
  5. "Not Using freestyle!" will have been printed (even though the frame hasn't changed).
  6. Change frames and both 'using' and 'not using' messages will be displayed.
**System Information** Windows 10 64-bit, Graphics cards: GTX 570, GT 610 (display). **Blender Version** Broken: 7b29e91 (latest Windows 64-bit build) Worked: - **Short description of error** I am trying to test if freestyle is on or off from a `frame_change_post` handler so my code is not run when rendering in the viewport in Blender Render while Freestyle is enabled (related to my add-on mentiond here: blender/blender#53801) When `use_freestyle` is printed from a `frame_change_post` handler it will print the correct value (ie. `use_freestyle` will return `True`) *if* the viewport isn't set to 'Rendered' mode. When changing to 'Rendered' viewport shading mode the frame handler will trigger (though I don't know why it is triggering) and report that freestyle is not running (ie. `use_freestyle` will return `False`). This only happens when 'Blender Render' is the render engine. This doesn't happen in Cycles (nor is the frame handler even triggered when changing to 'Rendered' shading) and doesn't happen when there are no objects in the scene. **Exact steps for others to reproduce the error** [Freestyle frame handler bug.blend](https://archive.blender.org/developer/F2002094/Freestyle_frame_handler_bug.blend) 1. Open the attached file. 2. Run the script in the attached file in the text editor. 3. Change frame and look in the System Console. "Using freestyle!" will be printed. 4. Change to 'Rendered' viewport shading mode. 5. "Not Using freestyle!" will have been printed (even though the frame hasn't changed). 6. Change frames and both 'using' and 'not using' messages will be displayed.
Author

Added subscriber: @RayMairlot

Added subscriber: @RayMairlot

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2018-01-28 15:09:22 +01:00

Freestyle creates a new scene to render lines, which is not the same as the existing scene. In general Blender can have multiple scenes active at the same time.

From what I can tell, the main issue in your script is that it sets the frame from the frame change handler. If you explicitly prevent that, then I don't think you need to track if the scene is rendering or using freestyle.

Freestyle creates a new scene to render lines, which is not the same as the existing scene. In general Blender can have multiple scenes active at the same time. From what I can tell, the main issue in your script is that it sets the frame from the frame change handler. If you explicitly prevent that, then I don't think you need to track if the scene is rendering or using freestyle.
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#53919
No description provided.