calculate_random_values

Function calculate_random_values 

Source
pub fn calculate_random_values(
    manifest: &NodeManifest,
    _ctx: &ActionContext<'_>,
    seed: u64,
) -> Result<Vec<ParamUpdate>, String>
Expand description

Calculate random values within parameter ranges

Generates parameter updates with randomized values respecting widget constraints.

§Arguments

  • manifest - Node manifest containing parameter definitions and widget configs
  • _ctx - Action context (unused for random, but kept for API consistency)
  • seed - Random seed for reproducible randomization

§Returns

  • Ok(Vec<ParamUpdate>) - List of parameter updates to apply
  • Err(String) - Error message if randomization fails

§Example

use std::time::{SystemTime, UNIX_EPOCH};
let seed = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs();
let updates = calculate_random_values(&manifest, &ctx, seed)?;