pub struct MeshHandler<'a> { /* private fields */ }Expand description
MeshHandler(src, version) (helpers/MeshHelper.py:71-108).
Implementations§
Source§impl<'a> MeshHandler<'a>
impl<'a> MeshHandler<'a>
Sourcepub fn new(src: Source<'a>, version: Version) -> Self
pub fn new(src: Source<'a>, version: Version) -> Self
A handler of src at version, little-endian (UnityPy’s default,
and every caller’s).
Sourcepub fn little_endian(self, little: bool) -> Self
pub fn little_endian(self, little: bool) -> Self
The handler with endianess other than < (little false):
components are then not swapped, and read big-endian
(helpers/MeshHelper.py:363).
Sourcepub fn get_triangles(
&self,
use_16bit: bool,
index_buffer: Option<&[u32]>,
meter: &Arc<Meter>,
) -> Result<Triangles, MeshError>
pub fn get_triangles( &self, use_16bit: bool, index_buffer: Option<&[u32]>, meter: &Arc<Meter>, ) -> Result<Triangles, MeshError>
get_triangles() on the handler’s state as a caller holds it: the
index size and the index buffer process returned (or the caller’s
own), and the source’s submeshes as they are now. It is
Processed::get_triangles for a caller, such as the Python
binding, that keeps process’s results apart from the source.
Sourcepub fn process(
&self,
resources: Option<&dyn Resources>,
meter: &Arc<Meter>,
) -> Result<Processed<'a>, MeshError>
pub fn process( &self, resources: Option<&dyn Resources>, meter: &Arc<Meter>, ) -> Result<Processed<'a>, MeshError>
process() (module docs). resources reads m_StreamData;
None is a Mesh with no object reader. Every array is charged to
meter before it is allocated, and every loop’s work counted on it
before the loop runs (the crate’s docs). It changes nothing, so a
second call gives the first’s answer.