Page MenuHome

Fix T96424: Don't register undo step for empty knife cut
ClosedPublic

Authored by Pratik Borhade (PratikPB2123) on Mar 14 2022, 9:44 AM.

Details

Summary

Prevents undo push when no cut has been made.

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.EditedMar 25 2022, 12:00 PM

This seems a nice improvement, although instead of becoming responsible for the undo push, the operator can return OPERATOR_CANCELLED to prevent the undo push, then the operator's flag can be left as-is.

This revision now requires changes to proceed.Mar 25 2022, 12:00 PM

Make requested change

Edit: can we simply use ternary conditional operator?

return (kcd->totkvert == 0) ? OPERATOR_CANCELLED : OPERATOR_FINISHED;

This revision is now accepted and ready to land.Apr 5 2022, 7:17 AM