Module mesh

Module mesh 

Source
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 objects
  • processor - 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§

parser
Mesh parsing implementation
processor
Mesh processing implementation
types
Mesh type definitions

Structs§

MeshManager
Main mesh processing facade
ProcessingOptions
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)