Page MenuHome

Fix T102318: crash smoothing vertex weights in editmode
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Nov 7 2022, 9:42 AM.

Details

Summary

Not quite sure why rBd37d17019c52: fix for vertex group blend - wasn't functional since the deform verts were… forcefully set the Mesh to NULL if
in editmode, but this caused the attribute lookup to fail/crash.

Now only use the attribute if we have the mesh (reducing the scope where it is used), bmesh editmode case does not rely on it.

Diff Detail

Repository
rB Blender

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Nov 7 2022, 9:42 AM
Philipp Oeser (lichtwerk) created this revision.

Thanks for looking into this. I think it probably set the mesh to null as a way to guarantee that only edit mode data was used when the user is in edit mode. The selection attributes on Mesh (object->data) might not match the selection in the edit BMesh.

I did miss this though, and it's weird. Just using a smaller scope for the variable would be much better than setting it to null in some cases.

In this case it probably makes sense to lower the scope of the attribute lookup, or skip it when the mesh is null.

Thanks for looking into this. I think it probably set the mesh to null as a way to guarantee that only edit mode data was used when the user is in edit mode. The selection attributes on Mesh (object->data) might not match the selection in the edit BMesh.

I did miss this though, and it's weird. Just using a smaller scope for the variable would be much better than setting it to null in some cases.

In this case it probably makes sense to lower the scope of the attribute lookup, or skip it when the mesh is null.

IS_ME_VERT_WRITE uses the attribute (indirectly) though, so you mean we`d rely on the BM_ELEM_SELECT in editmode instead?

Only IS_BM_VERT_READ should be used in the BMesh edit mode case, which doesn't use the attribute.

Only IS_BM_VERT_READ should be used in the BMesh edit mode case, which doesn't use the attribute.

OK, got it, will update shortly

reduce scope of attribute usage

This revision is now accepted and ready to land.Nov 8 2022, 3:35 PM