diff --git a/node-graph/graph-craft/src/document/value.rs b/node-graph/graph-craft/src/document/value.rs index 69c92db887..41bbe97da7 100644 --- a/node-graph/graph-craft/src/document/value.rs +++ b/node-graph/graph-craft/src/document/value.rs @@ -10,6 +10,7 @@ use core_types::{CacheHash, Color, ContextFeatures, MemoHash, Node, Type, TypeDe use dyn_any::DynAny; pub use dyn_any::StaticType; pub use glam::{DAffine2, DVec2, IVec2, UVec2}; +use graphene_application_io::resource::ResourceHash; use graphic_types::raster_types::{CPU, Image, Raster}; use graphic_types::vector_types::vector::style::{Fill, Gradient, GradientStops}; use graphic_types::vector_types::vector::{self, ReferencePoint}; @@ -90,6 +91,9 @@ macro_rules! tagged_value { ContextFeatures(ContextFeatures), #[serde(skip)] EditorApi(Arc), + /// Only used by the `resource` node, should never be serialized + #[serde(skip)] + ResourceHash(ResourceHash), } impl CacheHash for TaggedValue { @@ -117,6 +121,7 @@ macro_rules! tagged_value { Self::ContextFeatures(features) => features.cache_hash(state), Self::RenderOutput(x) => x.cache_hash(state), Self::EditorApi(x) => x.cache_hash(state), + Self::ResourceHash(x) => x.cache_hash(state), } } } @@ -170,6 +175,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => Box::new(node), Self::ContextFeatures(features) => Box::new(features), Self::EditorApi(x) => Box::new(x), + Self::ResourceHash(x) => Box::new(x), } } @@ -219,6 +225,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => Arc::new(node), Self::ContextFeatures(features) => Arc::new(features), Self::EditorApi(x) => Arc::new(x), + Self::ResourceHash(x) => Arc::new(x), } } @@ -246,6 +253,7 @@ macro_rules! tagged_value { Self::DocumentNode(_) => concrete!(DocumentNode), Self::ContextFeatures(_) => concrete!(ContextFeatures), Self::EditorApi(_) => concrete!(&PlatformEditorApi), + Self::ResourceHash(_) => concrete!(ResourceHash), } } @@ -351,6 +359,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => format!("DocumentNode({node:?})"), Self::ContextFeatures(features) => format!("ContextFeatures({features:?})"), Self::EditorApi(_) => "PlatformEditorApi".to_string(), + Self::ResourceHash(hash) => format!("ResourceHash({hash:?})"), } } } @@ -397,7 +406,6 @@ tagged_value! { VectorModification(Box), ImageData(Image), Resource(graphene_application_io::resource::ResourceId), - ResourceHash(graphene_application_io::resource::ResourceHash), // ========== // ENUM TYPES // ==========