Page MenuHome

Mac OS draws object made from only vertices differently from Windows (object 'Display as' mode set to 'WIRE').
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 660/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 442.19

Blender Version
Broken: version: 2.82 (sub 6), branch: master, commit date: 2020-02-11 14:45, hash: rBc939b4df18e9

Short description of error
Scene has cube mesh object - with edges and faces removed (only vertices are left). In object mode vertices will be visible as points, but if I want to hide them I can set object 'Display as' mode to - 'WIRE' then:

  • for Windows users - object vertices are no longer visible (nice)
  • for Mac users object vertices remain still visible (not good)

Hopefully this can be unified to hide drawing of verts in object mode and 'WIRE' draw method for both OS.

Exact steps for others to reproduce the error

  • add cube - delete only edges and faces
  • set object draw mode (in object 'Viewport Display' props - to 'WIRE'. On Mac OS vertices remain visible.

I attach blend with hidden cube vertices in object mode.

Event Timeline

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.EditedMar 5 2020, 12:50 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

In my opinion a mesh with only looseverts should be visible in both solid mode and wireframe mode.
This is how it worked in blender 2.79.

I don’t know why you say it’s not good to remain visible. The problem here seems to be on Windows and not on Mac.
@Clément Foucault (fclem), do you know if you had a decision on how it should be?

Hiding verts by setting object 'Display as' WIRE in just nice option to have, IMO better to have 2 options, rather than make verts always visible.
In my case I want to be able to snap to invisible verts using build-in blender vert snapping tools, while I'm drawing them in python using BGL. But yep, you may say it is actually bug- and that they are should be always invisible - it is just nice trick to have (hiding verts by drawing object as wire)

@Germano Cavalcante (mano-wii) I don't remember any decision on this. It might be a bug. They don't show here either on linux.

In my opinion the correct thing should be to follow what it was in 2.79.
So that should solve:

diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c
index 5dbdc71dae1..592542bd723 100644
--- a/source/blender/draw/engines/overlay/overlay_wireframe.c
+++ b/source/blender/draw/engines/overlay/overlay_wireframe.c
@@ -129,8 +129,10 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
   const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES) != 0;
   const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0;
   const bool is_mesh = ob->type == OB_MESH;
-  const bool use_wire = (pd->overlay.flag & V3D_OVERLAY_WIREFRAMES) || (ob->dtx & OB_DRAWWIRE) ||
-                        (ob->dt == OB_WIRE);
+  const bool is_mesh_verts_only = is_mesh && (((Mesh *)ob->data)->totedge == 0 &&
+                                              ((Mesh *)ob->data)->totvert > 0);
+  const bool use_wire = !is_mesh_verts_only && ((pd->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
+                                                (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE));
 
   if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
     OVERLAY_ExtraCallBuffers *cb = OVERLAY_extra_call_buffer_get(vedata, ob);
@@ -221,7 +223,7 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
     DRW_object_wire_theme_get(ob, draw_ctx->view_layer, &color);
 
     /* Draw loose geometry. */
-    if (me->totedge == 0 && me->totvert > 0) {
+    if (is_mesh_verts_only) {
       struct GPUBatch *geom = DRW_cache_mesh_all_verts_get(ob);
       if (geom) {
         OVERLAY_extra_loose_points(cb, geom, ob->obmat, color);

But it's strange that on the Mac the drawing behaves differently.
@Ankit Meel (ankitm) or @Brecht Van Lommel (brecht), can you confirm that behavior on Mac?

tested on 2.83 rB3da2dc82132f downloaded from https://builder.blender.org