Add Ground Zero weather exposure zones

This commit is contained in:
2026-05-16 03:08:12 -07:00
parent b5d13598f8
commit 8b0b5fff92
10 changed files with 291 additions and 5 deletions
+57
View File
@@ -258,6 +258,36 @@ WATER_SOURCE_ACTORS = [
},
]
WEATHER_EXPOSURE_ZONES = [
{
"label": "AGR_GZ_WeatherExposure_Ridge_01",
"zone_id": "ground_zero_ridge_exposed",
"location_xy": unreal.Vector(36000.0, 29200.0, 0.0),
"z_offset": 450.0,
"extent": unreal.Vector(11500.0, 9200.0, 2200.0),
"exposure_multiplier": 1.45,
"temperature_offset_c": -1.8,
},
{
"label": "AGR_GZ_WeatherExposure_CoastalWind_01",
"zone_id": "ground_zero_coastal_wind",
"location_xy": unreal.Vector(-31500.0, -14600.0, 0.0),
"z_offset": 350.0,
"extent": unreal.Vector(10500.0, 7600.0, 1600.0),
"exposure_multiplier": 1.25,
"temperature_offset_c": -0.9,
},
{
"label": "AGR_GZ_WeatherExposure_DrainageCool_01",
"zone_id": "ground_zero_drainage_cool",
"location_xy": unreal.Vector(-7200.0, 10400.0, 0.0),
"z_offset": 260.0,
"extent": unreal.Vector(7200.0, 5400.0, 1100.0),
"exposure_multiplier": 1.1,
"temperature_offset_c": -1.2,
},
]
ENVIRONMENT_VARIATION_ACTORS = [
{
"label": "AGR_GZ_EnvVar_Tree_Canopy_01",
@@ -690,6 +720,30 @@ def spawn_environment_variation_actor(spec, height_values, materials):
return actor
def spawn_weather_exposure_zone(spec, height_values):
location_xy = spec["location_xy"]
z = terrain_z_cm(height_values, location_xy.x, location_xy.y) + spec.get("z_offset", 0.0)
actor = unreal.AgrarianEditorAutomationLibrary.spawn_actor_in_editor_world(
unreal.AgrarianWeatherExposureZone,
unreal.Vector(location_xy.x, location_xy.y, z),
unreal.Rotator(0.0, 0.0, 0.0),
spec["label"],
)
if not actor:
raise RuntimeError(f"Could not spawn {spec['label']}")
set_actor_label(actor, spec["label"])
actor.set_editor_property("exposure_zone_id", spec["zone_id"])
actor.set_editor_property("exposure_multiplier", spec["exposure_multiplier"])
actor.set_editor_property("temperature_offset_c", spec["temperature_offset_c"])
actor.exposure_volume.set_box_extent(spec["extent"], True)
unreal.log(
f"Placed {spec['label']} at {actor.get_actor_location()} "
f"exposure x{spec['exposure_multiplier']} temp {spec['temperature_offset_c']} C"
)
return actor
def main():
if not unreal.EditorLevelLibrary.load_level(MAP_PATH):
raise RuntimeError(f"Could not load map: {MAP_PATH}")
@@ -700,6 +754,7 @@ def main():
labels.update(LEGACY_DEMO_LIGHTING_LABELS)
labels.update(spec["label"] for spec in BIOME_RESOURCE_ACTORS)
labels.update(spec["label"] for spec in WATER_SOURCE_ACTORS)
labels.update(spec["label"] for spec in WEATHER_EXPOSURE_ZONES)
labels.update(spec["label"] for spec in ENVIRONMENT_VARIATION_ACTORS)
labels.add(FOLIAGE_LABEL)
remove_existing_demo_actors(labels)
@@ -712,6 +767,8 @@ def main():
spawn_demo_actor(spec, height_values, materials)
for spec in WATER_SOURCE_ACTORS:
spawn_demo_actor(spec, height_values, materials)
for spec in WEATHER_EXPOSURE_ZONES:
spawn_weather_exposure_zone(spec, height_values)
for spec in ENVIRONMENT_VARIATION_ACTORS:
spawn_environment_variation_actor(spec, height_values, materials)
for spec in DEMO_ACTORS: