Fix #124484: Debug assert on undoing out of Sculpt Mode #124640

Merged
Sean Kim merged 2 commits from Sean-Kim/blender:fix-124484 into main 2024-07-16 21:27:31 +02:00

View File

@ -911,6 +911,12 @@ static void restore_list(bContext *C, Depsgraph *depsgraph, StepData &step_data)
return;
}
/* Switching to sculpt mode does not push a particular type.
* See #124484. */
if (step_data.type == Type::None && step_data.nodes.is_empty()) {
Review

Wouldn't it be more fitting to move this as BLI_assert(step_data.nodes.is_empty()) into the switch statement below?

Wouldn't it be more fitting to move this as `BLI_assert(step_data.nodes.is_empty())` into the switch statement below?
Review

I think that's an option, certainly. To me this case seemed to be something we should explicitly handle instead of conditionally asserting based on the state of the node data. I don't have a particularly strong opinion here though.

I think that's an option, certainly. To me this case seemed to be something we should explicitly handle instead of conditionally asserting based on the state of the node data. I don't have a particularly strong opinion here though.
Review

I also don't really have strong opinion. For the simplicity can just go with the current version of the patch.

I also don't really have strong opinion. For the simplicity can just go with the current version of the patch.
return;
}
const bool tag_update = ID_REAL_USERS(object.data) > 1 ||
!BKE_sculptsession_use_pbvh_draw(&object, rv3d) || ss.shapekey_active ||
ss.deform_modifiers_active;