I'm recently trying to use AnimationPlayers instead of AnimatedSprite3Ds for some more control over my characters. I'm trying to manipulate the AnimationPlayers through code now, and some things are going well, but others I cannot find any documentation for or mention of.

I want to add a "texture" keyframe for a parent Sprite3D and set it to a specific sprite sheet like this person does in this video at 6:53

I'm able to set values like

var anim = Animation.new()
var frame = anim.add_track(Animation.TYPE_VALUE)
for i in animlength:
	anim.track_insert_key(frame, time, i)
player.add_animation("animname", anim)

But it's kind of worthless without being able to switch between my sprite sheets. Since the normal way of doing it has you reference the Sprite in the hierarchy and select a variable from there, I assume I need to reference my sprite somehow in add_track? Probably a different TYPE_? I'm pretty lost on the logic here. Any AnimationPlayer wisdom is appreciated. Thanks!

So I both solved this and haven't. My initial issue was that I wanted to apply a shader to an AnimatedSprite3D. For whatever reason, you can't do this, but you can with a Sprite3D. I did not figure out how to manipulate an AnimationPlayer through code, but I did manage to apply a shader to my sprite.

I scrapped having an AnimationPlayer altogether and just copied the sprite data from my AnimatedSprite3D to a blank Sprite3D with a shader on it. Both its texture and a shader_param for a texture_albedo are set to:
sprite.get_sprite_frames().get_frame(curanim,sprite.get_frame())
I just make the original AnimatedSprite3D invisible and this new one draws in its place.

I'm sure that will take some tweaking to work in your project, and depending on what you need this for, it may not be very efficient, but I won't be drawing enough characters to the screen to have this impact performance much. Hope that helps anyone who runs into a similar problem.

    Sushibee175 My initial issue was that I wanted to apply a shader to an AnimatedSprite3D. For whatever reason, you can't do this, but you can with a Sprite3D.

    Probably because animated sprite already makes use of a dedicated specialized shader for it's function. It basically is a sprite with a built-in shader.