@weizhen I'd need to look into it a bit more to be certain, but the point about duplicate objects was just a way for it to be more likely to happen. IIRC it was a race condition with the depsgraph…
Sounds good to me, just a thought from skimming through the code initially.
Main concern is the extra return
I pointed out in the grids method. Otherwise just small nits.
What do you think about adding an !.is_empty()
set of asserts here?
Maybe make a shared helper method for this and mask_decrease_contrast
?
Would it be possible to extract the undo / scatter / mark update into a separate function and then apply it outside of this function? The goal here is to make it seem less like the other mask filter operations are missing these steps, since at first glance it seems like they are. Alternatively, I think a bit of documentation could fix this too, stating that only these methods are guaranteed to have changes, etc etc.
Either the return should be deleted or the method should be deleted