I struggled a bit to find the solution, but here it is:
Briefly explained:
What you want to do is access the AnimationPlayer's Animations. Then you want to access the respective Animations' tracks and alter the INTERPOLATION_MODE property of each track. You can do this during runtime or, better yet, create a script that works from within the editor, without running the game. I am going to explain the latter.
Detailed Instructions
1) Go to the Script workspace (near the 3D workspace on the top)
2) Create a new script resource (File--> New Script)
3) Write the following code in the newly created script:
tool # makes script run from within the editor
extends EditorScript # gives you access to editor functions
func _run(): # this is the main function
var selection = get_editor_interface().get_selection() * the selected node. In your case, select the AnimationPlayer
selection = selection.get_selected_nodes() # get the actual AnimationPlayer node
if selection.size()!=1 and not selection is AnimationPlayer: # if the wrong node is selected, do nothing
return
else:
interpolation_change(selection) # run the funstion in question
func interpolation_change(selection):
var anim_track_1 = selection[0].get_animation("default") # get the Animation that you are interested in (change "default" to your Animation's name)
var count = anim_track_1.get_track_count() # get number of tracks (bones in your case)
print(count)
for i in count:
anim_track_1.track_set_interpolation_type(i, 1) # change interpolation mode for every track
print(anim_track_1.track_get_interpolation_type(i))
4) Go to File-->Run. You should see the Interpolation mode change from linear to nearest.
How it works:
This script iterates through the tracks of your Animation and it changes the INTERPOLATION_MODE for each of them to 0 (nearest).
Check the doc fro more info here:
https://docs.godotengine.org/en/3.1/classes/class_animation.html#class-animation-method-track-get-interpolation-type
For more info on EditorScript, namely scripts that run from the editor, check this out:
https://www.youtube.com/watch?v=IsZjUFA30WQ
If this helps you, please mark the answer as best.