Chain cache node and Clone to make them usable from the ui (#1032)

Chain cache node and Clone to make it a drop in replacement
This commit is contained in:
Dennis Kobert
2023-02-16 15:03:13 +01:00
committed by Keavon Chambers
parent e6a8d5c573
commit 3015a9c8af
3 changed files with 36 additions and 9 deletions

View File

@@ -84,7 +84,7 @@ pub mod dynamic {
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
pub struct CloneNode<O>(PhantomData<O>);
impl<'i, O: Clone + 'i> Node<'i, &'i O> for CloneNode<O> {
impl<'i, 'n: 'i, O: Clone + 'i> Node<'i, &'n O> for CloneNode<O> {
type Output = O;
fn eval<'s: 'i>(&'s self, input: &'i O) -> Self::Output {
input.clone()

View File

@@ -95,6 +95,7 @@ fn node_registry() -> HashMap<NodeIdentifier, HashMap<NodeIOTypes, NodeConstruct
register_node!(graphene_core::structural::ConsNode<_, _>, input: &u32, params: [&u32]),
register_node!(graphene_core::ops::AddNode, input: (u32, u32), params: []),
register_node!(graphene_core::ops::AddNode, input: (u32, &u32), params: []),
register_node!(graphene_core::ops::CloneNode<_>, input: &Image, params: []),
register_node!(graphene_core::ops::AddParameterNode<_>, input: u32, params: [u32]),
register_node!(graphene_core::ops::AddParameterNode<_>, input: &u32, params: [u32]),
register_node!(graphene_core::ops::AddParameterNode<_>, input: u32, params: [&u32]),