Evolving soft locomotion in aquatic and terrestrial environments: effects of material properties and environmental transitions