Page MenuHome

Invalid material indices: Crash on simple mesh edit when switching to face mode.
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: Radeon RX Vega (VEGA10, DRM 3.23.0, 4.15.0-58-generic, LLVM 8.0.0) X.Org 4.5 (Core Profile) Mesa 19.0.8

Blender Versions
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-10-27 13:40, hash: rB9b6aa740be31
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-03 00:28, hash: rB93f93e6b4558
Worked: 2.80

Short description of error
Blender 2.81 beta (couple of versions tried) will crash upon entering edit mode and going into face select mode. Every time. I'm able to work around it so it's no biggie for me, but thought I'd report it in case of underlying issues. Also crashed in 2019-10-27 version after trying load default startup. Appending it to clean project and attempting to edit it in face select mode will also crash, so I'm guessing it's related to mesh data. I have no issues rendering it in the main project it is used.

Exact steps for others to reproduce the error
Open the file and select the object.
Focus on it (it's isolated but in it's original project position) and enter edit mode.
If it doesn't crash immediately, I'm getting crash when switching to face select mode.
See attached:

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from Needs Triage by Developer to Needs Information from User.Mon, Nov 4, 10:50 AM

I am also getting

BLI_assert failed: /blender/gpu/intern/gpu_element.c:197, GPU_indexbuf_set_tri_verts(), at '(elem + 1) * 3 <= builder->max_index_len' Aborted (core dumped)

This is because there is something wrong with the material indices, which can be corrected by calling

bpy.data.objects['Kitchen.Backsplash'].data.validate_material_indices()

@CarlG (CarlG) : do you happen to know how you have run into this situation?

  • is this some blender modeling tool causing this?
  • is this imported into blender? (if so it could help posting the original file -- before importing -- maybe there is something wrong with one of our importers...)

CC @Bastien Montagne (mont29), CC @Campbell Barton (campbellbarton) : since those "corrupt" meshes happen to come by once in a while, what do you think of making an operator out of validate() / validate_material_indices() and adding this to the menus? [could save a little bit of a hassle...]

Philipp Oeser (lichtwerk) renamed this task from Crash on simple mesh edit when switching to face mode. to Invalid material indices: Crash on simple mesh edit when switching to face mode..Mon, Nov 4, 10:51 AM

I don't know if this even corrupt, given that materials can be assigned per object or per mesh, and different object with the same mesh can have different numbers of materials.

I think it's just missing clamping in extract_tris_looptri_bmesh, which extract_tris_looptri_mesh does have.

"do you happen to know how you have run into this situation?"
Sorry, I don't really have a clue. It's part of a model that was started in 2.7x I think, so not an import.
Likely they are faces that are separated out from another object, possibly with solidify/bevel. With manual material cleanup since it's old.
I'll give the fix a try in a few days. Thanks for the quick fix.