From 4317406562d8a45855a415882c404bdcabfb6f8b Mon Sep 17 00:00:00 2001 From: SamG-Coder <13449963+SamG-Coder@users.noreply.github.com> Date: Fri, 13 Nov 2026 07:30:39 +1100 Subject: [PATCH 1/3] Bake: one place for plants' materials; the circuit's grass and woods sway; circuit and terrain refuse each other The woods in land.rs and circuit.rs were the same thirty lines, and forest.rs made the same bark, leaf and blade materials again. They are now in foliage.rs: grow() puts a wood's species into a scene, Grown::place() an instance of one, and bark(), leaves() and blades() make the materials. The circuit's copies had never been given the sway flags, so its verge grass and its woods stood still in any wind. Through the shared materials they now sway as the cove's and the forest's do. A scene file with both terrain and circuit built both, one inside the other, and the terrain's heights won as the ground cars drive on. It is now an error. Co-Authored-By: Claude Opus 5.5 --- apps/bake/src/circuit.rs | 75 ++++++------------------- apps/bake/src/foliage.rs | 106 ++++++++++++++++++++++++++++++++++++ apps/bake/src/forest.rs | 30 ++-------- apps/bake/src/land.rs | 59 ++------------------ apps/bake/src/main.rs | 1 + apps/bake/src/scene_file.rs | 27 +++++++++ 6 files changed, 159 insertions(+), 139 deletions(-) create mode 100644 apps/bake/src/foliage.rs diff --git a/apps/bake/src/circuit.rs b/apps/bake/src/circuit.rs index 470263d..acd0ab6 100644 --- a/apps/bake/src/circuit.rs +++ b/apps/bake/src/circuit.rs @@ -30,9 +30,7 @@ use rustc_hash::FxHashMap; use solstice_asset::{Heightfield, Instance, Material, SceneAsset}; use solstice_builder::{build_virtual_mesh, BuildOptions, Mesh}; use solstice_game::{Blocker, Track}; -use solstice_procgen::foliage::bark::BARK_TILE_METRES; use solstice_procgen::foliage::grass::Meadow; -use solstice_procgen::foliage::tree::Species; use solstice_procgen::foliage::Rng; use solstice_procgen::noise::fbm; use solstice_procgen::surface::TILE_METRES; @@ -686,14 +684,7 @@ fn blades(scene: &mut SceneAsset, meadow: &Meadow) -> u32 { scene .textures .push(meadow.atlas(0).bake(scene.texture_size)); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: layer, - flags: Material::TWO_SIDED | Material::FOLIAGE, - ..Default::default() - }); + scene.materials.push(crate::foliage::blades(layer)); scene.materials.len() as u32 - 1 } @@ -729,60 +720,15 @@ pub fn build(scene: &mut SceneAsset, track: &Track, size: f32) -> Built { // ---- Woods beyond the barriers: thick inland, thinning to open ground towards the cliffs. println!(" trees..."); - let mut grown = Vec::new(); - for (name, variants) in [("oak", 2u32), ("birch", 2), ("fir", 2), ("bush", 2)] { - let species = Species::by_name(name).expect("a built-in species"); - let first_mesh = scene.meshes.len() as u32; - for seed in 0..variants { - let plant = species.grow(seed); - scene - .meshes - .push(build_virtual_mesh(&plant.wood, &BuildOptions::default())); - scene - .meshes - .push(build_virtual_mesh(&plant.leaves, &BuildOptions::default())); - } - let (bark, leaf) = (species.bark, species.leaves.kind); - let bark_layer = scene.textures.len() as i32; - scene - .textures - .push(bark.surface(0).bake(scene.texture_size)); - let leaf_layer = scene.textures.len() as i32; - scene.textures.push(leaf.atlas(0).bake(scene.texture_size)); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - uv_scale: 1.0 / BARK_TILE_METRES, - normal_strength: 1.0, - texture_layer: bark_layer, - ..Default::default() - }); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: leaf_layer, - flags: Material::TWO_SIDED | Material::FOLIAGE, - ..Default::default() - }); - let leaves = scene.materials.len() as u32 - 1; - grown.push((first_mesh, variants, leaves - 1, leaves)); - } + let grown = crate::foliage::grow(scene, &[("oak", 2), ("birch", 2), ("fir", 2), ("bush", 2)]); let plant = |scene: &mut SceneAsset, kind: usize, x: f32, z: f32, k: u32| { - let (first_mesh, variants, bark, leaves) = grown[kind]; - let mesh = first_mesh + (hash(x as i32, z as i32, k + 2) % variants) * 2; + let copy = hash(x as i32, z as i32, k + 2); let turn = (hash(x as i32, z as i32, k) % 1000) as f32 / 1000.0 * std::f32::consts::TAU; let scale = 0.8 + (hash(x as i32, z as i32, k + 1) % 1000) as f32 / 1000.0 * 0.5; let transform = Mat4::from_translation(Vec3::new(x, land.at(x, z) - 0.05, z)) * Mat4::from_rotation_y(turn) * Mat4::from_scale(Vec3::splat(scale)); - for (mesh, material) in [(mesh, bark), (mesh + 1, leaves)] { - scene.instances.push(Instance { - mesh, - material, - transform, - }); - } + grown[kind].place(scene, copy, transform); }; // Whether a tree may stand here: on dry, gentle ground, clear of the barrier. let open = |x: f32, z: f32, clear: f32| { @@ -994,6 +940,19 @@ mod tests { Track::new("Ring", samples, vec![140, 280]).unwrap() } + #[test] + fn the_verge_grass_sways_as_grass() { + let mut scene = SceneAsset { + texture_size: 16, + ..Default::default() + }; + let verge = Meadow::by_name("verge").expect("a built-in grass"); + let blade = blades(&mut scene, &verge) as usize; + let flags = scene.materials[blade].flags; + assert_eq!(flags & Material::SWAYS, Material::SWAYS); + assert_eq!(flags & Material::TREE, 0, "grass sways as grass"); + } + #[test] fn the_land_is_level_with_the_road_and_becomes_its_own_further_off() { let track = ring(30.0); diff --git a/apps/bake/src/foliage.rs b/apps/bake/src/foliage.rs new file mode 100644 index 0000000..6e4c2ca --- /dev/null +++ b/apps/bake/src/foliage.rs @@ -0,0 +1,106 @@ +//! What the scene builders that plant things share: the materials of bark, leaves and grass +//! blades, each flagged to sway in the wind, and a wood's species grown into a scene. + +use glam::Mat4; +use solstice_asset::{Instance, Material, SceneAsset}; +use solstice_builder::{build_virtual_mesh, BuildOptions}; +use solstice_procgen::foliage::bark::BARK_TILE_METRES; +use solstice_procgen::foliage::tree::Species; + +/// A tree's wood: its trunk leans and sways, its branches bob. +pub fn bark(texture_layer: i32) -> Material { + Material { + base_color: [1.0; 4], + roughness: 1.0, + uv_scale: 1.0 / BARK_TILE_METRES, + normal_strength: 1.0, + texture_layer, + flags: Material::SWAYS | Material::TREE, + ..Default::default() + } +} + +/// A tree's leaves: they sway with the wood they hang from, and flutter. +pub fn leaves(texture_layer: i32) -> Material { + Material { + base_color: [1.0; 4], + roughness: 1.0, + normal_strength: 1.0, + texture_layer, + flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS | Material::TREE, + ..Default::default() + } +} + +/// Grass blades, which sway as grass. +pub fn blades(texture_layer: i32) -> Material { + Material { + base_color: [1.0; 4], + roughness: 1.0, + normal_strength: 1.0, + texture_layer, + flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS, + ..Default::default() + } +} + +/// A species grown into a scene: copies from different seeds, each two meshes, wood then +/// leaves, and its two materials. +#[derive(Clone, Copy, Debug)] +pub struct Grown { + pub first_mesh: u32, + pub variants: u32, + pub bark: u32, + pub leaves: u32, +} + +impl Grown { + /// Places copy `copy` (taken modulo the copies there are) where `transform` puts it. + pub fn place(&self, scene: &mut SceneAsset, copy: u32, transform: Mat4) { + let mesh = self.first_mesh + (copy % self.variants) * 2; + for (mesh, material) in [(mesh, self.bark), (mesh + 1, self.leaves)] { + scene.instances.push(Instance { + mesh, + material, + transform, + }); + } + } +} + +/// Grows each built-in species named, that many copies of each, into `scene`: their meshes, +/// their bark and leaf textures, and their materials. +pub fn grow(scene: &mut SceneAsset, plants: &[(&str, u32)]) -> Vec { + plants + .iter() + .map(|&(name, variants)| { + let species = Species::by_name(name).expect("a built-in species"); + let first_mesh = scene.meshes.len() as u32; + for seed in 0..variants { + let plant = species.grow(seed); + let options = BuildOptions::default(); + scene.meshes.push(build_virtual_mesh(&plant.wood, &options)); + scene + .meshes + .push(build_virtual_mesh(&plant.leaves, &options)); + } + let bark_layer = scene.textures.len() as i32; + scene + .textures + .push(species.bark.surface(0).bake(scene.texture_size)); + let leaf_layer = scene.textures.len() as i32; + scene + .textures + .push(species.leaves.kind.atlas(0).bake(scene.texture_size)); + scene.materials.push(bark(bark_layer)); + scene.materials.push(leaves(leaf_layer)); + let leaves = scene.materials.len() as u32 - 1; + Grown { + first_mesh, + variants, + bark: leaves - 1, + leaves, + } + }) + .collect() +} diff --git a/apps/bake/src/forest.rs b/apps/bake/src/forest.rs index 533a03d..53bd858 100644 --- a/apps/bake/src/forest.rs +++ b/apps/bake/src/forest.rs @@ -5,7 +5,7 @@ use glam::{Mat4, Vec3}; use solstice_asset::scene::Viewpoint; use solstice_asset::{Instance, Material, SceneAsset}; use solstice_builder::{build_virtual_mesh, BuildOptions}; -use solstice_procgen::foliage::bark::{Bark, BARK_TILE_METRES}; +use solstice_procgen::foliage::bark::Bark; use solstice_procgen::foliage::grass::Meadow; use solstice_procgen::foliage::leaf::LeafKind; use solstice_procgen::foliage::tree::Species; @@ -133,14 +133,7 @@ pub fn build(texture_size: u32) -> SceneAsset { macro_variation: 1.0, ..Default::default() }, - Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: 1, - flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS, - ..Default::default() - }, + crate::foliage::blades(1), ]; // Each plant is two meshes, wood then leaves, placed together. @@ -163,23 +156,8 @@ pub fn build(texture_size: u32) -> SceneAsset { let leaf: LeafKind = species.leaves.kind; let bark_layer = layers.layer(bark.name(), || bark.surface(0)); let leaf_layer = layers.layer(leaf.name(), || leaf.atlas(0)); - materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - uv_scale: 1.0 / BARK_TILE_METRES, - normal_strength: 1.0, - texture_layer: bark_layer, - flags: Material::SWAYS | Material::TREE, - ..Default::default() - }); - materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: leaf_layer, - flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS | Material::TREE, - ..Default::default() - }); + materials.push(crate::foliage::bark(bark_layer)); + materials.push(crate::foliage::leaves(leaf_layer)); grown.push(Grown { first_mesh, variants, diff --git a/apps/bake/src/land.rs b/apps/bake/src/land.rs index addbe38..602db1f 100644 --- a/apps/bake/src/land.rs +++ b/apps/bake/src/land.rs @@ -23,9 +23,7 @@ use glam::{Mat4, Vec2, Vec3}; use solstice_asset::{Instance, Material, SceneAsset}; use solstice_builder::{build_virtual_mesh, BuildOptions, Mesh}; -use solstice_procgen::foliage::bark::BARK_TILE_METRES; use solstice_procgen::foliage::grass::Meadow; -use solstice_procgen::foliage::tree::Species; use solstice_procgen::foliage::Rng; use solstice_procgen::noise::fbm; use solstice_procgen::surface::TILE_METRES; @@ -438,14 +436,7 @@ fn add_meadow( first_mesh + PATCH_VARIANTS + which * SHAPE_VARIANTS + seed }; let blades = layer(scene, meadow.atlas(0)); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: blades, - flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS, - ..Default::default() - }); + scene.materials.push(crate::foliage::blades(blades)); let material = scene.materials.len() as u32 - 1; let cells = (radius * 2.0 / size) as i32; let quarter = std::f32::consts::FRAC_PI_2; @@ -556,58 +547,16 @@ fn add_woods( kind_at: &dyn Fn(Vec2) -> usize, ) { println!(" growing the woods..."); - // Each plant: its meshes, wood then leaves for each grown copy, and its two materials. - let mut grown = Vec::new(); - for (name, variants) in [("oak", 2u32), ("birch", 2), ("bush", 2)] { - let species = Species::by_name(name).expect("a built-in species"); - let first_mesh = scene.meshes.len() as u32; - for seed in 0..variants { - let plant = species.grow(seed); - scene - .meshes - .push(build_virtual_mesh(&plant.wood, &BuildOptions::default())); - scene - .meshes - .push(build_virtual_mesh(&plant.leaves, &BuildOptions::default())); - } - let bark = layer(scene, species.bark.surface(0)); - let leaf = layer(scene, species.leaves.kind.atlas(0)); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - uv_scale: 1.0 / BARK_TILE_METRES, - normal_strength: 1.0, - texture_layer: bark, - flags: Material::SWAYS | Material::TREE, - ..Default::default() - }); - scene.materials.push(Material { - base_color: [1.0; 4], - roughness: 1.0, - normal_strength: 1.0, - texture_layer: leaf, - flags: Material::TWO_SIDED | Material::FOLIAGE | Material::SWAYS | Material::TREE, - ..Default::default() - }); - let leaves = scene.materials.len() as u32 - 1; - grown.push((first_mesh, variants, leaves - 1, leaves)); - } + let grown = crate::foliage::grow(scene, &[("oak", 2), ("birch", 2), ("bush", 2)]); let mut rng = Rng::new(11, 5); let mut trees: Vec = Vec::new(); let mut bushes: Vec = Vec::new(); let place = |scene: &mut SceneAsset, which: usize, at: Vec2, rng: &mut Rng| { - let (first_mesh, variants, bark, leaves) = grown[which]; - let mesh = first_mesh + rng.index(variants as usize) as u32 * 2; + let copy = rng.index(grown[which].variants as usize) as u32; let transform = Mat4::from_translation(Vec3::new(at.x, height(at.x, at.y) - 0.05, at.y)) * Mat4::from_rotation_y(rng.range(0.0, std::f32::consts::TAU)) * Mat4::from_scale(Vec3::splat(rng.range(0.8, 1.25))); - for (mesh, material) in [(mesh, bark), (mesh + 1, leaves)] { - scene.instances.push(Instance { - mesh, - material, - transform, - }); - } + grown[which].place(scene, copy, transform); }; for &(centre, radius, spacing) in &plan.woods { for _ in 0..(radius * radius * 2.0) as u32 { diff --git a/apps/bake/src/main.rs b/apps/bake/src/main.rs index ec3154a..6585038 100644 --- a/apps/bake/src/main.rs +++ b/apps/bake/src/main.rs @@ -24,6 +24,7 @@ mod circuit; mod collision_view; +mod foliage; mod forest; mod gallery; mod land; diff --git a/apps/bake/src/scene_file.rs b/apps/bake/src/scene_file.rs index 7728be2..c02f9d4 100644 --- a/apps/bake/src/scene_file.rs +++ b/apps/bake/src/scene_file.rs @@ -1089,6 +1089,11 @@ pub fn build(path: &Path, texture_size: Option) -> Result<(SceneAsset, Vec< // A circuit's land, road and planting are built from its track, which also gives the // ground to drive on and the barriers to stop at. if let Some(size) = circuit { + // Both would be built, one inside the other, and the terrain's heights would be the + // ground cars drive on, not the circuit's. + if terrain.is_some() { + return Err("`circuit` builds its own land: leave out the `terrain` line".to_owned()); + } let name = gameplay .game .track @@ -1595,6 +1600,28 @@ mod tests { assert_eq!(scene.gameplay.len(), 1); } + #[test] + fn a_circuit_and_a_terrain_are_not_both_built() { + let folder = Folder::with(&[ + ( + "scene.txt", + b"terrain 400 64 0.3 52 +track c.track +circuit 900 +", + ), + ( + "c.track", + b"p 0 0 0 1 0 0 6 6 +p 0 0 50 1 0 0 6 6 +p 50 0 50 1 0 0 6 6 +", + ), + ]); + let error = build(&folder.0.join("scene.txt"), None).unwrap_err(); + assert!(error.contains("leave out the `terrain` line"), "{error}"); + } + #[test] fn a_scene_without_actors_has_no_gameplay() { let (gltf, bin) = two_triangles(); From 801204ca26d19ce90169937889052818708b52d5 Mon Sep 17 00:00:00 2001 From: SamG-Coder <13449963+SamG-Coder@users.noreply.github.com> Date: Fri, 13 Nov 2026 08:10:13 +1100 Subject: [PATCH 2/3] Bake: refuse land lines with a circuit as soon as both are read; tests for foliage From review: the terrain check came after every model was imported, and land, path, yard, clear, meadow, wood and water lines were silently dropped beside a circuit too. Each is now refused at the line that brings the two together, before anything is imported. Co-Authored-By: Claude Opus 5.5 --- apps/bake/src/foliage.rs | 34 ++++++++++++++++++++ apps/bake/src/scene_file.rs | 62 +++++++++++++++++++++++++++++-------- 2 files changed, 83 insertions(+), 13 deletions(-) diff --git a/apps/bake/src/foliage.rs b/apps/bake/src/foliage.rs index 6e4c2ca..7c77b6c 100644 --- a/apps/bake/src/foliage.rs +++ b/apps/bake/src/foliage.rs @@ -104,3 +104,37 @@ pub fn grow(scene: &mut SceneAsset, plants: &[(&str, u32)]) -> Vec { }) .collect() } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn a_copy_is_placed_as_its_wood_then_its_leaves() { + let grown = Grown { + first_mesh: 10, + variants: 2, + bark: 4, + leaves: 5, + }; + let mut scene = SceneAsset::default(); + // Copy 3 of two is copy 1: meshes 12 and 13. + grown.place(&mut scene, 3, Mat4::IDENTITY); + let placed: Vec<(u32, u32)> = scene + .instances + .iter() + .map(|i| (i.mesh, i.material)) + .collect(); + assert_eq!(placed, [(12, 4), (13, 5)]); + } + + #[test] + fn every_plant_material_sways_and_only_trees_sway_as_trees() { + for material in [bark(0), leaves(0), blades(0)] { + assert_ne!(material.flags & Material::SWAYS, 0); + } + assert_ne!(bark(0).flags & Material::TREE, 0); + assert_ne!(leaves(0).flags & Material::TREE, 0); + assert_eq!(blades(0).flags & Material::TREE, 0); + } +} diff --git a/apps/bake/src/scene_file.rs b/apps/bake/src/scene_file.rs index c02f9d4..15d267b 100644 --- a/apps/bake/src/scene_file.rs +++ b/apps/bake/src/scene_file.rs @@ -834,6 +834,8 @@ pub fn build(path: &Path, texture_size: Option) -> Result<(SceneAsset, Vec< let mut land_plan = crate::land::Plan::default(); let mut water = None; let mut circuit = None; + // Whether there has been a circuit, and a line of land, to refuse the two together. + let (mut has_land, mut has_circuit) = (false, false); // Grouped by file, keeping first-seen order, so that each model is imported only once. let mut order: Vec = Vec::new(); let mut models: HashMap = HashMap::new(); @@ -847,6 +849,31 @@ pub fn build(path: &Path, texture_size: Option) -> Result<(SceneAsset, Vec< for (number, line) in text.lines().enumerate() { let at = |e: String| format!("{}:{}: {e}", path.display(), number + 1); let command = parse_line(line).map_err(at)?; + // A circuit builds its own land, ground and planting: the lines that would build + // another, one inside it, are refused wherever in the file they come. + let lands = matches!( + command, + Some( + Command::Terrain { .. } + | Command::Land { .. } + | Command::Path { .. } + | Command::Yard { .. } + | Command::Clear { .. } + | Command::Meadow(_) + | Command::Wood { .. } + | Command::Water { .. } + ) + ); + let circuits = matches!(command, Some(Command::Circuit(_))); + has_land |= lands; + has_circuit |= circuits; + if (lands || circuits) && has_land && has_circuit { + let word = line.split_whitespace().next().unwrap_or_default(); + return Err(at(format!( + "`{word}` with `circuit`: a circuit builds its own land, so leave out `terrain`, \ + `water` and the land's lines" + ))); + } match command { None => {} Some(Command::TextureSize(size)) => scene.texture_size = size, @@ -1089,11 +1116,6 @@ pub fn build(path: &Path, texture_size: Option) -> Result<(SceneAsset, Vec< // A circuit's land, road and planting are built from its track, which also gives the // ground to drive on and the barriers to stop at. if let Some(size) = circuit { - // Both would be built, one inside the other, and the terrain's heights would be the - // ground cars drive on, not the circuit's. - if terrain.is_some() { - return Err("`circuit` builds its own land: leave out the `terrain` line".to_owned()); - } let name = gameplay .game .track @@ -1600,26 +1622,40 @@ mod tests { assert_eq!(scene.gameplay.len(), 1); } + /// A circuit's track: three points. + const TRACK: &[u8] = b"p 0 0 0 1 0 0 6 6 +p 0 0 50 1 0 0 6 6 +p 50 0 50 1 0 0 6 6 +"; + #[test] fn a_circuit_and_a_terrain_are_not_both_built() { let folder = Folder::with(&[ ( "scene.txt", - b"terrain 400 64 0.3 52 -track c.track -circuit 900 -", + b"terrain 400 64 0.3 52\ntrack c.track\ncircuit 900\n", ), ( "c.track", - b"p 0 0 0 1 0 0 6 6 -p 0 0 50 1 0 0 6 6 -p 50 0 50 1 0 0 6 6 + b"p 0 0 0 1 0 0 6 6\np 0 0 50 1 0 0 6 6\np 50 0 50 1 0 0 6 6\n", + ), + ]); + let error = build(&folder.0.join("scene.txt"), None).unwrap_err(); + assert!(error.contains("a circuit builds its own land"), "{error}"); + assert!(error.contains(":3:"), "on the circuit's line: {error}"); + // And the other way round, with a line of the land's after the circuit. + let folder = Folder::with(&[ + ( + "scene.txt", + b"track c.track +circuit 900 +wood 0 0 40 9 ", ), + ("c.track", TRACK), ]); let error = build(&folder.0.join("scene.txt"), None).unwrap_err(); - assert!(error.contains("leave out the `terrain` line"), "{error}"); + assert!(error.contains(":3: `wood` with `circuit`"), "{error}"); } #[test] From 9275900a942ab2696126b0f5f2078efa0080a04c Mon Sep 17 00:00:00 2001 From: SamG-Coder <13449963+SamG-Coder@users.noreply.github.com> Date: Fri, 13 Nov 2026 08:13:32 +1100 Subject: [PATCH 3/3] Bake: --only without --plants is an error, not ignored A follow-up from the review of #75. Co-Authored-By: Claude Opus 5.5 --- apps/bake/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/bake/src/main.rs b/apps/bake/src/main.rs index 6585038..d4567bb 100644 --- a/apps/bake/src/main.rs +++ b/apps/bake/src/main.rs @@ -210,6 +210,12 @@ fn parse_args() -> Result { other => return Err(format!("unknown argument: {other}")), } } + if options.only && !options.plants { + return Err( + "--only keeps just the species and grass files given: it needs --plants, --species or --grass" + .to_owned(), + ); + } Ok(options) }