Page MenuHome

Flip matcap doesn't work in workbench rendered display mode
Closed, ResolvedPublicKNOWN ISSUE

Description

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.94

Blender Version
Broken: version: 2.80 (sub 71), branch: master, commit date: 2019-05-22 17:52, hash: rB8fdbd1377e53

Short description of error

Flip matcap option in workbench mode doesn't work.

Thank you

Event Timeline

I think, this issue needs clarification.
First of all, flipping the matcap in the viewport works. (by using the icon in the top right of the viewport).
What you captured in the screenshot is the render settings in the right sidebar (the properties bar). To see those settings in effect you need to press F12 to render out an image.

How to reproduce:

  • Switch the render engine to workbench.
  • Change the viewport display method to Render preview.
  • Select a matcap in the render settings of the properties bar.
  • Try flipping the matcap in the render settings with the double arrow icon <- This does't affect anything in the viewport, even though it affects the F12 render.
Brecht Van Lommel (brecht) renamed this task from flip matcap doesn't work to Flip matcap doesn't work in workbench rendered display mode.May 29 2019, 2:10 AM
Brecht Van Lommel (brecht) lowered the priority of this task from 90 to Low.
This comment was removed by Alphyn (Alphyn).
Richard Antalik (ISS) changed the subtype of this task from "Report" to "Known Issue".

toggle_matcap_flip in view3d_header.c implements the matcap flipping for both the 3D view and the rendering/scene. The issue seems to be that the dependency graph isn't updated, which is why workbench_private_data_init in workbench_data.c still gets the old value, despite being set by toggle_matcap_flip .

Adding a DEG_id_tag_update to the scene case, updates the rendered view when flipping the matcap direction.

ah, see it now [still fails in workbench engine rendered mode...]

@Robert Guetzkow (rjg) : ID_RECALC_BASE_FLAGS seems enough [the less impact, the better -- but cannot give you an exact reason...]

shouldnt it also reference the scene in the notifier? (not that it really makes a difference here...)

1
2
3diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
4index 119ba059a70..e38f7755041 100644
5--- a/source/blender/editors/space_view3d/view3d_header.c
6+++ b/source/blender/editors/space_view3d/view3d_header.c
7@@ -77,7 +77,8 @@ static int toggle_matcap_flip(bContext *C, wmOperator *UNUSED(op))
8 else {
9 Scene *scene = CTX_data_scene(C);
10 scene->display.shading.flag ^= V3D_SHADING_MATCAP_FLIP_X;
11- WM_event_add_notifier(C, NC_SCENE | NA_EDITED, v3d);
12+ WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene);
13+ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
14 }
15
16 return OPERATOR_FINISHED;

@Philipp Oeser (lichtwerk) I've used ID_RECALC_BASE_FLAGS in my test as well and it worked fine. However, since I'm not an expert on depsgraph questions I've asked @Sergey Sharybin (sergey) about this on blender.chat. I didn't want to post a diff without understanding how it works and whether it's the correct approach to fix the issue.

shouldnt it also reference the scene in the notifier?

That's what I thought, but it didn't seem to make a difference.

As for dependency graph I guess any recalc will do it (just need to inform the depsgraph that scene changed). Logically, it is something what affects on shading is changed, so better suit would be ID_RECALC_SHADING.

Robert Guetzkow (rjg) added a comment.EditedMay 7 2020, 9:05 PM

@Sergey Sharybin (sergey) ID_RECALC_SHADING doesn't seem to work though.