diff --git a/node-graph/gcore/src/context.rs b/node-graph/gcore/src/context.rs index ef92b4d2bc..27d2a392f1 100644 --- a/node-graph/gcore/src/context.rs +++ b/node-graph/gcore/src/context.rs @@ -272,11 +272,9 @@ impl Default for OwnedContextImpl { impl core::hash::Hash for OwnedContextImpl { fn hash(&self, state: &mut H) { - debug!("Calculating hash for {:#?}", self); self.footprint.hash(state); - // TODO: Reenable before committing - // self.varargs.as_ref().map(|x| Arc::as_ptr(x).addr()).hash(state); - // self.parent.as_ref().map(|x| Arc::as_ptr(x).addr()).hash(state); + self.varargs.as_ref().map(|x| Arc::as_ptr(x).addr()).hash(state); + self.parent.as_ref().map(|x| Arc::as_ptr(x).addr()).hash(state); self.index.hash(state); self.real_time.map(|x| x.to_bits()).hash(state); self.animation_time.map(|x| x.to_bits()).hash(state); @@ -290,7 +288,10 @@ impl OwnedContextImpl { let index = value.try_index(); let time = value.try_time(); let frame_time = value.try_animation_time(); - let parent = value.arc_clone(); + let parent = match value.varargs_len() { + Ok(x) if x > 0 => value.arc_clone(), + _ => None, + }; OwnedContextImpl { footprint, varargs: None, diff --git a/node-graph/gcore/src/transform.rs b/node-graph/gcore/src/transform.rs index 27f2952896..bf563dd9f9 100644 --- a/node-graph/gcore/src/transform.rs +++ b/node-graph/gcore/src/transform.rs @@ -217,15 +217,29 @@ async fn boundless_footprint( Context -> GraphicGroupTable, Context -> ImageFrameTable, Context -> TextureFrameTable, + Context -> String, + Context -> f64, )] - transform_target: impl Node, Output = Instances>, -) -> Instances { - let ctx = OwnedContextImpl::from(ctx).with_footprint(Footprint::BOUNDLESS).with_real_time(0.).erase_parent(); - - let mut hasher = std::collections::hash_map::DefaultHasher::new(); - ctx.hash(&mut hasher); - let hash = hasher.finish(); - debug!("The context with hash {hash} is now: {ctx:#?}"); + transform_target: impl Node, Output = T>, +) -> T { + let ctx = OwnedContextImpl::from(ctx).with_footprint(Footprint::BOUNDLESS); + + transform_target.eval(ctx.into_context()).await +} +#[node_macro::node(category("Debug"))] +async fn freeze_real_time( + ctx: impl Ctx + CloneVarArgs + ExtractAll, + #[implementations( + Context -> VectorDataTable, + Context -> GraphicGroupTable, + Context -> ImageFrameTable, + Context -> TextureFrameTable, + Context -> String, + Context -> f64, + )] + transform_target: impl Node, Output = T>, +) -> T { + let ctx = OwnedContextImpl::from(ctx).with_real_time(0.); transform_target.eval(ctx.into_context()).await } diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index 36d72c3972..2976923574 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -307,6 +307,8 @@ fn node_registry() -> HashMap, input: Context, fn_params: [Context => wgpu_executor::WindowHandle]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => graphene_std::SurfaceFrame]), async_node!(graphene_core::memo::MemoNode<_, _>, input: UVec2, fn_params: [UVec2 => graphene_std::SurfaceFrame]), + async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => f64]), + async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => String]), async_node!(graphene_core::memo::MemoNode<_, _>, input: Context, fn_params: [Context => RenderOutput]), async_node!(graphene_core::memo::ImpureMemoNode<_, _, _>, input: Context, fn_params: [Context => GraphicElement]), async_node!(graphene_core::memo::ImpureMemoNode<_, _, _>, input: Context, fn_params: [Context => GraphicGroupTable]), diff --git a/node-graph/interpreted-executor/src/util.rs b/node-graph/interpreted-executor/src/util.rs index c0244acecb..5182b768d9 100644 --- a/node-graph/interpreted-executor/src/util.rs +++ b/node-graph/interpreted-executor/src/util.rs @@ -39,7 +39,7 @@ pub fn wrap_network_in_scope(mut network: NodeNetwork, editor_api: Arc