()
| 138 | |
| 139 | |
| 140 | def find_weather_presets(): |
| 141 | rgx = re.compile('.+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)') |
| 142 | name = lambda x: ' '.join(m.group(0) for m in rgx.finditer(x)) |
| 143 | presets = [x for x in dir(carla.WeatherParameters) if re.match('[A-Z].+', x)] |
| 144 | return [(getattr(carla.WeatherParameters, x), name(x)) for x in presets] |
| 145 | |
| 146 | |
| 147 | def get_actor_display_name(actor, truncate=250): |