|
|
|
|
@ -91,23 +91,6 @@ def create_mesh_surface_entity_with_slopes(name, center_point, uniform_scale):
|
|
|
|
|
return surface_entity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_empty_spawner(name, center_point, box_size_x, box_size_y, box_size_z):
|
|
|
|
|
# Create a vegetation area entity to use as our test vegetation spawner
|
|
|
|
|
spawner_entity = EditorEntity.create_editor_entity_at(center_point, name=name)
|
|
|
|
|
spawner_entity.add_components(["Vegetation Layer Spawner", "Box Shape", "Vegetation Asset List"])
|
|
|
|
|
if spawner_entity.id.IsValid():
|
|
|
|
|
print(f"'{spawner_entity.get_name()}' created")
|
|
|
|
|
spawner_entity.components[1].set_component_property_value("Box Shape|Box Configuration|Dimensions",
|
|
|
|
|
math.Vector3(box_size_x, box_size_y, box_size_z))
|
|
|
|
|
|
|
|
|
|
# Set the vegetation area to an empty spawner
|
|
|
|
|
empty_spawner = vegetation.EmptyInstanceSpawner()
|
|
|
|
|
descriptor = spawner_entity.components[2].get_component_property_value("Configuration|Embedded Assets|[0]")
|
|
|
|
|
descriptor.spawner = empty_spawner
|
|
|
|
|
spawner_entity.components[2].set_component_property_value("Configuration|Embedded Assets|[0]", descriptor)
|
|
|
|
|
return spawner_entity
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_vegetation_area(name, center_point, box_size_x, box_size_y, box_size_z, dynamic_slice_asset_path):
|
|
|
|
|
# Create a vegetation area entity to use as our test vegetation spawner
|
|
|
|
|
spawner_entity = hydra.Entity(name)
|
|
|
|
|
|