How to edit all 3dmesh nodes under one parent 3d Node

Question

I have a scene set up where I add a Packed Scene of 3DMeshes and instansiate it into a 3DNode “holder” that holds the instance of the 3d Meshes

The Packed sence will instance into the “Holder” 3DNode in the main scene, are laid out as such in the tree:

image

I am wanting to essentually fade in and out the meshes visually, so something like

func fade_out(time):
    var tween := create_tween()
	tween.tween_property(*target of mesh nodes in the holder*, "alpha", 0.0, time)\
    .set_trans(Tween.TRANS_SINE)\
	.set_ease(Tween.EASE_IN_OUT)

    await tween.finished

# The words in the ** for the tween are just a holder for the example,
# this is not code I've actually written and tried

I’ve tried adjusting the mesh’s standard material individually through a for loop, but it barely worked and was a lot of code. I’ve got a feeling that it has to be a lot simpler than that, as fading objects seems like something that should be easy.

Anyways, I’m at a lost. Any help is appriciated

You MUST set the Mesh’s Material’s transparency to Alpha for this code to work.

## Fades all MeshInstance3D child nodes recursively to fade.
## Setting fade_goal = 0.0 will fade the node out.
## Setting fade_goal = 1.0 will fade the node in.
## You MUST set the Mesh's Material's transparency to Alpha
## for this code to work.
func fade(node: Node, fade_goal: float, time: float) -> void:
	if node is MeshInstance3D:
		var material: Material = node.get_active_material(0)
		var tween := create_tween()
		tween.tween_property(material, "albedo_color:a", fade_goal, time).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_IN_OUT)
	
	
	for subnode in node.get_children():
		fade(subnode, fade_goal, time)