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