Page MenuHome

Fix T89393: Crash when selecting edges when geometry nodes has "on cage" turned on.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jul 23 2021, 11:29 AM.

Details

Summary

The core problem is that the geometry nodes modifier sometimes support "mapping" (i.e. it remembers which new vertices correspond to edit mode vertices) and sometimes it does not, depending on what the nodes are doing. Also see rB07ce9910f7cc: Geometry Nodes: enabled supports-mapping in nodes modifier.

The solution here is that the fallback case in BKE_mesh_foreach_mapped_edge does not call the callback with "invalid" indices.

Alternative solutions:

  • Just don't implement the fallback solution for the case when CustomData_get_layer(&mesh->edata, CD_ORIGINDEX) returns null. This will probably result in a regression in other cases.
  • Make the "supports mapping" flag on modifiers more flexible to allow modifiers to sometimes support it and sometimes not. That's probably a better long term solution, but will require quite a bit more work.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jul 23 2021, 11:29 AM
Jacques Lucke (JacquesLucke) created this revision.

Well, I do like the alternative solution of not implementing the fallback. It seems like code should be able to check if a mapping is actually possible before wasting time looping through all of the edges.
I understand why this a valid solution for now though, so I'll accept this.

source/blender/blenkernel/intern/mesh_iterators.c
103

Suggest adding a comment here. Something like this maybe:

\param tot_edges: An override for the number of edges to compare, to avoid calling the callback when there isn't an evaluated edge for every original edge.

(Hopefully I understood the purpose correctly ; )

This revision is now accepted and ready to land.Jul 23 2021, 2:59 PM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
  • Merge branch 'master' into edge-selection-crash
  • comment
  • improve check