diff --git a/crates/bevy_render/src/mesh/mesh/mod.rs b/crates/bevy_render/src/mesh/mesh/mod.rs index 0b732a3ab8..61c9f71143 100644 --- a/crates/bevy_render/src/mesh/mesh/mod.rs +++ b/crates/bevy_render/src/mesh/mesh/mod.rs @@ -350,6 +350,12 @@ impl Mesh { self.indices.as_mut() } + /// Removes the vertex `indices` from the mesh and returns them. + #[inline] + pub fn remove_indices(&mut self) -> Option { + std::mem::take(&mut self.indices) + } + /// Computes and returns the index data of the mesh as bytes. /// This is used to transform the index data into a GPU friendly format. pub fn get_index_buffer_bytes(&self) -> Option<&[u8]> {