Page MenuHome

Edge/vertex selection isnt working properly with X-ray set to 1
Closed, ResolvedPublic

Description

System Information
Operating system: w10
Graphics card: Gtx 1080TI

Blender Version
Broken: blender-2.80-009dbc2bc9fb
Worked:

Short description of error
Strange behavior on mesh elements selection if you set your X-ray to 1 (other values work as expected).

Exact steps for others to reproduce the error
Add a cube to the scene, enter edit mode, switch X-ray on, set it to 1 and try selecting vertices from different view angles. It's not working properly

Event Timeline

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

Sometimes when I go into edit mode and set x-ray to 1 and try to select and edge I get a segfault:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x0000555558b02a44 in GPU_texture_width (tex=0x0) at /home/zed/prog/blender/source/blender/gpu/intern/gpu_texture.c:1539
1539		return tex->w;
(gdb) bt
#0  0x0000555558b02a44 in GPU_texture_width (tex=0x0) at /home/zed/prog/blender/source/blender/gpu/intern/gpu_texture.c:1539
#1  0x0000555558b4139f in DRW_framebuffer_select_id_read (rect=0x7fffffffd640, r_buf=0x7fffc559b008)
    at /home/zed/prog/blender/source/blender/draw/intern/draw_manager.c:2547
#2  0x0000555557fa8787 in ED_view3d_select_id_read_nearest (UNUSED_vc=0x7fffffffd9a0, mval=0x7fffffffda00, id_min=0, id_max=0, r_dist=0x7fffffffd6ac)
    at /home/zed/prog/blender/source/blender/editors/space_view3d/view3d_draw_legacy.c:384
#3  0x000055555823f9fa in EDBM_edge_find_nearest_ex (vc=0x7fffffffd9a0, r_dist=0x7fffffffd7ec, r_dist_center=0x0, use_select_bias=true, use_cycle=false,
    r_eed_zbuf=0x7fffffffd808) at /home/zed/prog/blender/source/blender/editors/mesh/editmesh_select.c:668
#4  0x0000555558240924 in unified_findnearest (vc=0x7fffffffd9a0, bases=0x7fffc545ba48, bases_len=1, r_base_index=0x7fffffffd914, r_eve=0x7fffffffd928,
    r_eed=0x7fffffffd930, r_efa=0x7fffffffd938) at /home/zed/prog/blender/source/blender/editors/mesh/editmesh_select.c:992
#5  0x0000555558249687 in EDBM_select_pick (C=0x7fffe3858188, mval=0x7fffffffda50, extend=false, deselect=false, toggle=false)
    at /home/zed/prog/blender/source/blender/editors/mesh/editmesh_select.c:2029
#6  0x0000555557fcc6e4 in view3d_select_exec (C=0x7fffe3858188, op=0x7fffc98fd708)
    at /home/zed/prog/blender/source/blender/editors/space_view3d/view3d_select.c:2074
#7  0x0000555557fccb8d in view3d_select_invoke (C=0x7fffe3858188, op=0x7fffc98fd708, event=0x7fffc63e0c88)
    at /home/zed/prog/blender/source/blender/editors/space_view3d/view3d_select.c:2158
#8  0x0000555557e5ba26 in wm_operator_invoke (C=0x7fffe3858188, ot=0x7fffde5ed448, event=0x7fffc63e0c88, properties=0x7fffc97e6088, reports=0x0,
    poll_only=false, use_last_properties=true) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:1343
#9  0x0000555557e5da05 in wm_handler_operator_call (C=0x7fffe3858188, handlers=0x7fffde7b82d0, handler_base=0x7fffd311bda8, event=0x7fffc63e0c88,
    properties=0x7fffc97e6088) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2144
#10 0x0000555557e5e5dc in wm_handlers_do_intern (C=0x7fffe3858188, event=0x7fffc63e0c88, handlers=0x7fffde7b82d0)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2462
#11 0x0000555557e5f2ed in wm_handlers_do (C=0x7fffe3858188, event=0x7fffc63e0c88, handlers=0x7fffde7b82d0)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2720
#12 0x0000555557e60865 in wm_event_do_handlers (C=0x7fffe3858188) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:3141
#13 0x0000555557e54d6f in WM_main (C=0x7fffe3858188) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm.c:418
#14 0x0000555557e4f41f in main (argc=1, argv=0x7fffffffe088) at /home/zed/prog/blender/source/creator/creator.c:503

Other times it doesn't crash but I do observe the weird behavior as reported here.
For the selection to be correct, it seems like you have to toggle X-ray on/off or change the value to something that is not 1.0 first.

However it will break again as soon as you rotate/move the viewport again.

This might be my fault so I'll investigate this a bit further.