diff --git a/crates/bevy_render/src/mesh/mesh/mod.rs b/crates/bevy_render/src/mesh/mesh/mod.rs index b4fecc066ddb6..fde82287d1f56 100644 --- a/crates/bevy_render/src/mesh/mesh/mod.rs +++ b/crates/bevy_render/src/mesh/mesh/mod.rs @@ -116,6 +116,16 @@ impl Mesh { ); } + /// Removes the data for a vertex attribute + pub fn remove_attribute( + &mut self, + attribute: impl Into, + ) -> Option { + self.attributes + .remove(&attribute.into()) + .map(|data| data.values) + } + #[inline] pub fn contains_attribute(&self, id: impl Into) -> bool { self.attributes.contains_key(&id.into())