Page MenuHome

Fix T81268: Crash when undo from Sculpt Mode to Edit Mode
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Sep 28 2020, 11:12 PM.

Details

Summary

This was introduced in 6c9ec1c893f9. The overlays can now be drawn when
PBVH drawing is not enabled, but the PBVH should still exist in the
SculptSession in order to draw them. Before, it was avoiding the crash
by checking use_pbvh as BKE_sculptsession_use_pbvh_draw also checks if
the PBVH exists.

Diff Detail

Repository
rB Blender
Branch
T81268 (branched from master)
Build Status
Buildable 10479
Build 10479: arc lint + arc unit

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Sep 28 2020, 11:12 PM
Pablo Dobarro (pablodp606) created this revision.
Sergey Sharybin (sergey) requested changes to this revision.Sep 29 2020, 10:06 AM

Please use early outputs.
You can structure this in the following way:

if (pbvh == NULL) {
  /* It is possible to have SculptSession without PBVH. Happes, for example, when toggling
   * objetc mode to sculpt them to edit mode.
   * <Can even give more details about overlays> */
  return;
}

if (!pbvh_has_mask(pbvh) && !pbvh_has_face_sets(pbvh)) {
  /* <explanation why the cache is only populated for mask and face sets, as it is not
   * obviously clear why generic sounding function only handles these two cases> */
  return;
}
This revision now requires changes to proceed.Sep 29 2020, 10:06 AM
Evan Wilson (EAW) added inline comments.
source/blender/draw/engines/overlay/overlay_sculpt.c
58

Happes to This happens
them to then

This revision is now accepted and ready to land.Sep 30 2020, 11:54 AM