I found my Wacom eraser could work on Texture Paint. so maybe there is a shortcut assigning to it? but I cannot find it in preference
2 Answers
I don't use the eraser on my tablet(mine doesn't come with one) but Texture Paint mode has a mix mode in the brush controls called 'Erase Alpha', and that generally does what you expect in that it seems to erase the paint - BUT if you also then switch to 'Add Alpha', you can then recover what you thought was erased.
I don't know about setting up an operator to swap to the Erase Alpha mix mode and back to the last used brush mix mode, but that might be possible, and then you woudl have to map it to the eraser input. I use an add-on called EZ Paint that enables me to toggle erase/add alpha with a short cut key, but that isn't what you are looking for.
Okay i finally figured out how to make a shortcut to an eraser for Texture Paint.
The idea is that i needed to figure out the correct function id for the Blend modes (MIX + Erase-Alpha) and input that into the custom keymap menu
But usually when using digital art softwares for drawing you can have an eraser key that will erase only when pressed. So i made 2 diferent keymaps one change to Erase-Alpha when PRESED and the other to switch back to Mix when Released. This basically restore my workflow and avoid so much frustration while Texture painting.
Go in the preferences - > Keymaps -> 3d View -> Image Paint Go on the bottom and create a new key slot by pressing : Add New then click on the little arrow next to none to open the tab of the shortcut
Then in the field where its written "none" type :
wm.context_toggle_enum
new fields will appear, in Context Attribute, type :
tool_settings.image_paint.brush.blend
in the first "Value" field, type :
ERASE_ALPHA
and in the second, type :
MIX
Now set a key for your shortcut and set the key mode to : PRESS
Repeat the whole operation a second type (create another keymap in the same place) but this time, revert the 2 Values first : MIX second : ERASE_ALPHA
set the same key as before, but this time set it to RELEASE
that way you will be able to erase only while holding the eraser key, but you can also simply make only one keymap and click it to switch between modes.
Hope it Helps !
-
$\begingroup$ THANK YOU for the basis You actually don't need the second one, pressing the hotkey twice will toggle from one mode to another $\endgroup$– GummyCommented Jan 8 at 22:33
-
$\begingroup$ Yeah, my setup was meant to be able to erase only when i kept the erase key pressed then automatically switching back when released. but after some testing, this is probably not a good approach, and you should make a toggle key. $\endgroup$– FabulaCommented Mar 3 at 19:49