Expand description
Unity Mesh processing module
This module provides comprehensive Mesh processing capabilities, organized following UnityPy and unity-rs best practices.
§Architecture
The module is organized into several sub-modules:
types- Core data structures (Mesh, VertexData, SubMesh, etc.)parser- Mesh parsing from Unity objectsprocessor- High-level mesh processing and export
§Examples
use unity_asset_decode::mesh::{MeshProcessor, MeshConfig};
use unity_asset_decode::unity_version::UnityVersion;
// Create processor with custom configuration
let version = UnityVersion::parse_version("2020.3.12f1")?;
let config = MeshConfig {
extract_vertices: true,
extract_indices: true,
process_blend_shapes: true,
decompress_meshes: true,
max_vertex_count: Some(100000),
};
let processor = MeshProcessor::with_config(version, config);
// Note: In real usage, you would create a UnityObject from parsed data
// For demonstration, we'll just show the processor creation
println!("Mesh processed successfully");Re-exports§
pub use parser::MeshParser;pub use processor::MeshProcessor;pub use processor::MeshStats;pub use types::AABB;pub use types::BlendShape;pub use types::BlendShapeChannel;pub use types::BlendShapeData;pub use types::BlendShapeVertex;pub use types::ChannelInfo;pub use types::CompressedMesh;pub use types::Mesh;pub use types::MeshConfig;pub use types::MeshInfo;pub use types::MeshResult;pub use types::PackedFloatVector;pub use types::PackedIntVector;pub use types::StreamingInfo;pub use types::SubMesh;pub use types::VertexData;
Modules§
Structs§
- Mesh
Manager - Main mesh processing facade
- Processing
Options - Mesh processing options
Functions§
- create_
full_ manager - Create a mesh manager with full features
- create_
manager - Convenience functions for common operations Create a mesh manager with default settings
- create_
performance_ manager - Create a mesh manager optimized for performance
- export_
mesh_ to_ obj - Export mesh to OBJ format (convenience function)
- get_
mesh_ bounds - Get mesh bounds
- get_
recommended_ config - Get recommended mesh configuration for Unity version
- get_
triangle_ count - Get mesh triangle count
- get_
vertex_ count - Get mesh vertex count
- has_
blend_ shapes - Check if mesh has blend shapes
- has_
streaming_ data - Check if mesh has streaming data
- is_
compressed_ mesh - Check if mesh is compressed
- is_
mesh_ feature_ supported - Check if Unity version supports mesh feature
- parse_
mesh - Parse mesh from Unity object (convenience function)
- validate_
mesh - Validate mesh data (convenience function)