Figured out how to get the mesh(f variable) and texture from materials(r variable). The position of the generated mesh is off, but not to big of an issue, but the main issue I face now is the texture being generated seems pretty low quality? Also the UVs I am assuming of the meshes aren't matching the generated texture, as the meshes are just transparent when using it.
https://gdl.space/ezewucaray.cs