Automasking and gradients - how-to?

Similar feature request here: