diff --git a/editor/src/messages/portfolio/document/utility_types/network_interface.rs b/editor/src/messages/portfolio/document/utility_types/network_interface.rs index fd86ebe2..52cae9b6 100644 --- a/editor/src/messages/portfolio/document/utility_types/network_interface.rs +++ b/editor/src/messages/portfolio/document/utility_types/network_interface.rs @@ -6649,7 +6649,7 @@ struct InputTransientMetadata { } /// Persistent metadata for each node in the network, which must be included when creating, serializing, and deserializing saving a node. -#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[derive(Default, Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct DocumentNodePersistentMetadata { /// The name of the node definition, as originally set by [`DocumentNodeDefinition`], used to display in the UI and to display the appropriate properties if no display name is set. // TODO: Used during serialization/deserialization to prevent storing implementation or inputs (and possible other fields) if they are the same as the definition. @@ -6676,21 +6676,6 @@ pub struct DocumentNodePersistentMetadata { pub network_metadata: Option, } -impl Default for DocumentNodePersistentMetadata { - fn default() -> Self { - DocumentNodePersistentMetadata { - reference: None, - display_name: String::new(), - input_metadata: Vec::new(), - output_names: Vec::new(), - pinned: false, - locked: false, - node_type_metadata: NodeTypePersistentMetadata::default(), - network_metadata: None, - } - } -} - impl DocumentNodePersistentMetadata { pub fn is_layer(&self) -> bool { matches!(self.node_type_metadata, NodeTypePersistentMetadata::Layer(_)) diff --git a/editor/src/messages/portfolio/document/utility_types/network_interface/deserialization.rs b/editor/src/messages/portfolio/document/utility_types/network_interface/deserialization.rs index 3b416713..c1099a0f 100644 --- a/editor/src/messages/portfolio/document/utility_types/network_interface/deserialization.rs +++ b/editor/src/messages/portfolio/document/utility_types/network_interface/deserialization.rs @@ -23,7 +23,13 @@ impl From for DocumentNodePersistentMe fn from(old: DocumentNodePersistentMetadataInputNames) -> Self { DocumentNodePersistentMetadata { input_metadata: Vec::new(), - ..old.into() + reference: old.reference, + display_name: old.display_name, + output_names: old.output_names, + locked: old.locked, + pinned: old.pinned, + node_type_metadata: old.node_type_metadata, + network_metadata: old.network_metadata, } } }