3 releases (breaking)
Uses new Rust 2024
| 0.4.0 | May 5, 2026 |
|---|---|
| 0.3.0 | Jul 28, 2025 |
| 0.2.0 | May 27, 2025 |
#9 in #assimp
39 downloads per month
Used in 5 crates
125KB
2.5K
SLoC
asset-importer-rs-core
Core functionality for 3D asset import/export
The foundation of the asset-importer-rs ecosystem
📖 Table of Contents
Table of Contents
![]()
📝 About The Crate
asset-importer-rs-core is the foundational crate of the asset-importer-rs project, providing the core functionality for importing and exporting 3D assets. Inspired by the Assimp library, this crate establishes the fundamental building blocks that all format-specific importers and exporters rely upon.
This crate provides the essential infrastructure for:
- Import Pipeline - Defines the AiImporter trait and related interfaces for loading 3D assets
- Export Pipeline - Defines the AiExport trait and related interfaces for writing 3D assets
- Post-Processing - Defines post-processing steps and operations for asset transformations
- Configuration - Provides configuration constants for import/export behavior
![]()
☁️ Features
- Flexible Asset System - Configurable import/export pipelines for various 3D formats
- Post-Processing Capabilities - Built-in support for asset transformations and optimizations
- Error Handling - Comprehensive error handling and reporting system
- Format Support - Extensible architecture supporting multiple file formats
- Configuration Management - Fine-grained control over import/export operations
- Extensible Architecture - Easy to extend with new format support
![]()
💾 Main Components
Core Modules
- Import System - Defines the AiImporter trait for format-specific importers
- Export System - Defines the AiExport trait for format-specific exporters
- Post-Processing - Defines AiPostProcessSteps enum for asset transformations
- Configuration - Provides configuration constants for import/export settings
- Importer Metadata - AiImporterDesc for format-specific importer descriptions
![]()
📖 Getting Started
Add the following to your Cargo.toml:
[dependencies]
asset-importer-rs-core = "0.2.0"
# Or for development from source:
asset-importer-rs-core = { path = "../path/to/asset-importer-rs-core" }
![]()
🔸 Usage Examples
Basic usage example:
use asset_importer_rs_core::{
AiImporter,
AiImporterInfo
};
use std::path::Path;
// Define a custom importer
struct MyImporter;
impl AiImporterInfo for MyImporter {
fn info(&self) -> asset_importer_rs_core::AiImporterDesc {
// Implementation details...
unimplemented!()
}
}
impl AiImporter for MyImporter {
type Error = AiReadError;
fn can_read_dyn(&self, path: &Path, loader: &dyn Fn(&Path) -> std::io::Result>) -> bool {
// Check if this importer can handle the file
unimplemented!()
}
fn read_file_dyn(&self, path: &Path, loader: &dyn Fn(&Path) -> std::io::Result>) -> Result {
// Import the file
unimplemented!()
}
}
Using post-processing steps:
use asset_importer_rs_core::AiPostProcessSteps;
use enumflags2::BitFlags;
// Define post-processing operations
let post_process_steps = BitFlags::from(
AiPostProcessSteps::Triangulate |
AiPostProcessSteps::GenNormals |
AiPostProcessSteps::CalcTangentSpaces
);
![]()
🔸 Architecture
The core crate provides the fundamental building blocks for asset import/export operations. It establishes the interfaces and abstractions that all format-specific implementations must follow, ensuring consistency and interoperability across the entire asset-importer-rs ecosystem.
![]()
🔸 Dependencies
Core Dependencies
- enumflags2 - For flag-based enums and bit manipulation in post-processing
- asset-importer-rs-scene - For scene data structures and types
Standard Library Dependencies
- std::io - For I/O operations and error handling
- std::path - For path handling
![]()
📜 License
This project is part of the asset-importer-rs workspace and follows its licensing terms. See the main project LICENSE file for details.
Copyright (c) 2024 Jackson Levitt
Dependencies
~3.5MB
~69K SLoC