Viewport Render doesn't render Grease Pencil Overlays, Shading #72862

Closed
opened 2020-01-03 02:20:20 +01:00 by Bun ny · 13 comments

System Information
Operating system: Windows 7 x64
Graphics card: NVIDIA GeForce GTX 580

Blender Version
Broken: 2.82 a854840e76

Short description of error
Rendering with the Viewport Render operator doesn't render Overlays and Shading settings pertaining to Grease Pencil objects. Regardless of the Fade Layers overlay setting or the Color Type setting, Grease Pencil objects render as if no Overlay settings are active and with the Material color type.

Exact steps for others to reproduce the error
Open attached .blend, confirm the Fade Layers Overlay setting and Random Color Type shading settings are active, call Viewport Render Image operator, resulting image differs from Viewport.
viewport_render_bug.blend

**System Information** Operating system: Windows 7 x64 Graphics card: NVIDIA GeForce GTX 580 **Blender Version** Broken: 2.82 a854840e76ae **Short description of error** Rendering with the Viewport Render operator doesn't render Overlays and Shading settings pertaining to Grease Pencil objects. Regardless of the Fade Layers overlay setting or the Color Type setting, Grease Pencil objects render as if no Overlay settings are active and with the Material color type. **Exact steps for others to reproduce the error** Open attached .blend, confirm the Fade Layers Overlay setting and Random Color Type shading settings are active, call Viewport Render Image operator, resulting image differs from Viewport. [viewport_render_bug.blend](https://archive.blender.org/developer/F8257224/viewport_render_bug.blend)
Author

Added subscriber: @bunny

Added subscriber: @bunny
Member

Added subscribers: @Jeroen-Bakker, @lichtwerk

Added subscribers: @Jeroen-Bakker, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Can confirm the behavior, but I am unsure about the state of the Viewport Render operators (bpy.ops.render.opengl).

@Jeroen-Bakker: it may very well be that this is just a known limitation about these operators. Wouldnt these be removed/obsolete at some point with the workbench render engine anyways?
(btw. the workbench renderengine F12 lso doesnt respect the Random Color Type for Greasepencil objects...)

Can confirm the behavior, but I am unsure about the state of the Viewport Render operators (`bpy.ops.render.opengl`). @Jeroen-Bakker: it may very well be that this is just a known limitation about these operators. Wouldnt these be removed/obsolete at some point with the workbench render engine anyways? (btw. the workbench renderengine F12 lso doesnt respect the `Random` Color Type for Greasepencil objects...)

Added subscribers: @fclem, @antoniov

Added subscribers: @fclem, @antoniov

Actually, the render doesn't display any overlay in Grease Pencil.

As @fclem is doing a refactor of the drawing engine, we must wait to see how this will be handle, because some of the current overlays in grease pencil engine it will be moved to overlay engine.

Actually, the render doesn't display any overlay in Grease Pencil. As @fclem is doing a refactor of the drawing engine, we must wait to see how this will be handle, because some of the current overlays in grease pencil engine it will be moved to overlay engine.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Checked on this and replacing DRW_state_is_image_render for DRW_state_is_scene_render seems to make this work as expected.

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index a1a1f7cc389..f4baf2c7837 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -439,7 +439,7 @@ void GPENCIL_cache_init(void *vedata)
       stl->storage->is_main_onion = false;
     }
     /* save render state */
-    stl->storage->is_render = DRW_state_is_image_render();
+    stl->storage->is_render = DRW_state_is_scene_render();
     stl->storage->is_mat_preview = (bool)stl->storage->is_render &&
                                    STREQ(scene->id.name + 2, "preview");
 
Checked on this and replacing DRW_state_is_image_render for DRW_state_is_scene_render seems to make this work as expected. ``` diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index a1a1f7cc389..f4baf2c7837 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -439,7 +439,7 @@ void GPENCIL_cache_init(void *vedata) stl->storage->is_main_onion = false; } /* save render state */ - stl->storage->is_render = DRW_state_is_image_render(); + stl->storage->is_render = DRW_state_is_scene_render(); stl->storage->is_mat_preview = (bool)stl->storage->is_render && STREQ(scene->id.name + 2, "preview"); ```

I think it's safe to include this fix for 2.82 as the whole implementation has been rewritten for 2.83

I think it's safe to include this fix for 2.82 as the whole implementation has been rewritten for 2.83

This issue was referenced by dfb4a2e907

This issue was referenced by dfb4a2e907b42f7655ff01b6ade299a8d7092a91

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Antonio Vazquez self-assigned this 2020-01-27 11:38:19 +01:00

This issue was referenced by 7e8e7bfe69

This issue was referenced by 7e8e7bfe6958b377b2de8c4102c865657ce755ec
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
6 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#72862
No description provided.