How to get material/0 and not surface/material/0 in MeshInstance?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Favkis

I’m trying to copy material from one MeshInstance to another. MeshInstance has materials inside of a .mesh and inside itself in Materials tab. I need to copy materials from Materials tab.
I’ve tried:

my_mesh_instance.get_surface_material(i)
my_mesh_instance.get_active_material(i)
my_mesh_instance.get("material/"+str(i)))
my_mesh_instance.mesh.surface_get_material(i)

All these methods return SURFACE material that is inside of a mesh. How do I get Material inside of a MeshInstance??

.

:bust_in_silhouette: Reply From: Favkis

nvm my mistake I was editing mesh vertices and removing surfaces