diff options
Diffstat (limited to 'src/library.rs')
| -rw-r--r-- | src/library.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/library.rs b/src/library.rs index 18c0ef9..ef161be 100644 --- a/src/library.rs +++ b/src/library.rs @@ -1051,7 +1051,8 @@ impl fmt::Display for AnyConstant { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum Input { UV, - // Resolution, + Resolution, + Time, } impl ConcreteNode for Input { @@ -1067,7 +1068,13 @@ impl ConcreteNode for Input { } fn signature(&self, _connected: &[Option<Type>]) -> TypeSignature { - TypeSignature::new([], [Vector(Float(Single), D2)]) + TypeSignature::new( + [], + [match self { + Input::UV | Input::Resolution => Vector(Float(Single), D2), + Input::Time => Scalar(Float(Single)), + }], + ) } fn compile( @@ -1084,6 +1091,8 @@ impl ConcreteNode for Input { "{out_typ} {out_name} = {};", match self { Input::UV => "in_uv", + Input::Resolution => "in_resolution", + Input::Time => "in_time", } ) } @@ -1092,17 +1101,15 @@ impl NodeIndex for Input { const TITLE: &'static str = "Inputs"; fn all() -> impl Iterator<Item = Input> { - [ - Input::UV, - // Input::Resolution, - ] - .into_iter() + [Input::UV, Input::Resolution, Input::Time].into_iter() } } impl fmt::Display for Input { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Input::UV => write!(f, "UV Coordinates"), + Input::Resolution => write!(f, "Output Resolution"), + Input::Time => write!(f, "Time in Seconds"), } } } |
