didnt chech that a material existed before accessing it- crashed with null materials and mesh.getFromObject()