Page MenuHome

Viewport shading fails when a newly added primitive (from custom script) is modified in the redo panel
Closed, ResolvedPublic

Description

System Information
Operating system: Windows-10-10.0.18362 64 Bits
Graphics card: Quadro 600/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 369.09

Blender Version
Broken: version: 2.80 (sub 60), branch: master, commit date: 2019-05-08 20:08, hash: rB733811330c9b
Worked: last known good hash: rBa8a11d35372a

Short description of error
Upon initial creation of the primitive mesh everything is fine. However, once you tweak one of the properties on the redo panel, the newly added mesh loses all shading. It remains like this until you enter/exit Edit mode for the mesh in question.

Initial creation:

After tweaking Redo panel:

Exact steps for others to reproduce the error

  • Load attached .blend
  • Click "Run Script" in the editor that's already open
  • In the 3D Viewport, Search for the newly added "Test: Test Add Primitive" operator and invoke it
  • A subdivided cube appears on screen (Good!)
  • Tweak one of the properties of this new object in its Redo panel
  • Observe how all shading is lost (Bad)
    • Enter/Exit Edit mode for the primitive and notice it returns to normal

Git bisect ended up blaming the following commit:
[733811330c9] master: Workbench: Use common_view_lib and remove NormalMatrix usage

Event Timeline

Sebastian Parborg (zeddb) lowered the priority of this task from 90 to 50.

This is because we now assume the inverse matrix is up to date when drawing.
I'm not sure how you do that in Python or if the depsgraph should handle this on its own.

Good news: This appears to be fixed as of some checkin yesterday
Bad news: I didn't spot any obvious depsgraph change for this but there was the big eevee refactor... so I'm not sure if this was a happy accident that will regress again soon or if it's actually fixed :)

Sergey Sharybin (sergey) changed the task status from Unknown Status to Resolved.May 29 2019, 4:59 PM

This was fixed by rBbe5fd9c. Makes total sense actually :)

Thanks for the report, closing it now.