Adapt the cutover to the reviewed core-types API

This commit is contained in:
Dennis Kobert
2026-07-31 23:39:39 +02:00
parent 76ec799496
commit fa29ddf357
24 changed files with 170 additions and 145 deletions

22
test.rs Normal file
View File

@@ -0,0 +1,22 @@
trait Attr {
fn name() -> &'static str
}
impl Attr for bool {
fn name() {"condition"}
}
struct Opacity(f64);
impl Attr for Opacity {
fn name() {"opacity"}
}
#[node]
fn opacity<T>(_: impl Ctx, input: T, x: ReadAttr<bool>, opacity: WriteAttr<Opacity>) -> T {
if x {
*opacity = 1.;
}
input
}