mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-19 14:01:02 +01:00
Replace the legacy Rust procedural library with clean-room native primitives, typed function execution and FX-Map graphs. Save supported content as native SBS and organize the model, evaluators, codecs and editors into focused modules. Add shared graph editing behavior, flat filtered node menus, frame and comment editing, named Explorer outputs and an original atomic sample. Document the tested scope and remaining interoperability work.
23 lines
675 B
Rust
23 lines
675 B
Rust
use crate::Node;
|
|
use crate::Value;
|
|
|
|
pub const MISSING_NODE: &str = "missing_node";
|
|
|
|
pub fn missing_ports(node: &Node) -> (Vec<String>, Vec<(String, bool)>) {
|
|
let list = |key: &str| -> Vec<String> {
|
|
match node.params.get(key) {
|
|
Some(Value::Text(s)) => s.split(',').map(str::trim).filter(|p| !p.is_empty()).take(64).map(str::to_string).collect(),
|
|
_ => Vec::new(),
|
|
}
|
|
};
|
|
|
|
let outputs = list("outputs")
|
|
.into_iter()
|
|
.map(|o| match o.split_once(':') {
|
|
Some((id, kind)) => (id.to_string(), kind == "gray"),
|
|
None => (o, false),
|
|
})
|
|
.collect();
|
|
(list("inputs"), outputs)
|
|
}
|