Fix T83504: Cancel trim operators when there is no geometry
The boolean solver crashes when there is no geometry in the mesh. Also, using the trimming tools without a valid intersection in the PBVH will make the orientation and position functionality of the trimming shape not work, so this is the safer solution. Reviewed By: mont29 Maniphest Tasks: T83504 Differential Revision: https://developer.blender.org/D9777
This commit is contained in:
parent
c9de65679b
commit
288f2efbd4
Notes:
blender-bot
2023-02-14 00:29:15 +01:00
Referenced by issue #83504, Crash using sculpt trim tools
|
@ -1552,6 +1552,11 @@ static int sculpt_trim_gesture_box_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (ss->totvert == 0) {
|
||||
/* No geometry to trim or to detect a valid position for the trimming shape. */
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
SculptGestureContext *sgcontext = sculpt_gesture_init_from_box(C, op);
|
||||
if (!sgcontext) {
|
||||
return OPERATOR_CANCELLED;
|
||||
|
@ -1589,6 +1594,11 @@ static int sculpt_trim_gesture_lasso_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (ss->totvert == 0) {
|
||||
/* No geometry to trim or to detect a valid position for the trimming shape. */
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
SculptGestureContext *sgcontext = sculpt_gesture_init_from_lasso(C, op);
|
||||
if (!sgcontext) {
|
||||
return OPERATOR_CANCELLED;
|
||||
|
|
Loading…
Reference in New Issue