{"id":31274099,"url":"https://github.com/latias94/asset-importer","last_synced_at":"2026-01-20T17:33:46.943Z","repository":{"id":315249091,"uuid":"1057409396","full_name":"Latias94/asset-importer","owner":"Latias94","description":"A comprehensive Rust binding for the latest Assimp library.","archived":false,"fork":false,"pushed_at":"2025-09-17T15:11:01.000Z","size":830,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T15:25:25.824Z","etag":null,"topics":["assimp","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Latias94.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-15T17:28:55.000Z","updated_at":"2025-09-17T15:06:50.000Z","dependencies_parsed_at":"2025-09-17T15:37:06.056Z","dependency_job_id":null,"html_url":"https://github.com/Latias94/asset-importer","commit_stats":null,"previous_names":["latias94/asset-importer"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Latias94/asset-importer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Latias94%2Fasset-importer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Latias94%2Fasset-importer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Latias94%2Fasset-importer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Latias94%2Fasset-importer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Latias94","download_url":"https://codeload.github.com/Latias94/asset-importer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Latias94%2Fasset-importer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276662054,"owners_count":25682025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assimp","rust"],"created_at":"2025-09-23T22:36:19.271Z","updated_at":"2026-01-20T17:33:46.931Z","avatar_url":"https://github.com/Latias94.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# asset-importer\n\n[![Crates.io](https://img.shields.io/crates/v/asset-importer.svg)](https://crates.io/crates/asset-importer)\n[![Documentation](https://docs.rs/asset-importer/badge.svg)](https://docs.rs/asset-importer)\n[![Rust Version](https://img.shields.io/badge/rust-1.85+-blue.svg)](https://www.rust-lang.org)\n[![Crates.io Downloads](https://img.shields.io/crates/d/asset-importer.svg)](https://crates.io/crates/asset-importer)\n[![Made with Rust](https://img.shields.io/badge/made%20with-Rust-orange.svg)](https://www.rust-lang.org)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![License: BSD-3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nA comprehensive Rust binding for the latest [Assimp](https://github.com/assimp/assimp) 3D asset import library.\n\nThis crate provides safe, high-level Rust bindings for **Assimp v6.0.3**, implementing the vast majority of the C API with idiomatic Rust interfaces.\n\n## Example Application\n\nSee **[Model Viewer](https://github.com/Latias94/model-viewer)** (asset-importer + wgpu) - A practical model viewer built on top of this Assimp Rust binding. It serves as a real-world sample and testbed to validate asset-importer across common 3D formats.\n\n## Status\n\n⚠️ **Early Development**: This library is functional but lacks extensive real-world testing. Use with caution in production environments.\n\n## Features\n\n- **Comprehensive API Coverage**: Implements the vast majority of [Assimp v6.0.3](https://github.com/assimp/assimp/releases/tag/v6.0.3) C API\n- **Import Support**: 71+ 3D file formats (OBJ, FBX, glTF, DAE, etc.)\n- **Export Support**: 22+ output formats (optional)\n- **Memory Safe**: Safe Rust API over unsafe FFI bindings\n- **Modern Math (Optional)**: Interop with `glam` and `mint` via opt-in Cargo features\n- **Flexible Building**: Multiple build options for different use cases\n- **Cross-Platform**: Supports Windows, macOS, and Linux\n\n## Quick Start\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\n# Default – Use prebuilt binaries (fastest)\nasset-importer = \"0.6\"\n\n# Or build from source (best compatibility; mutually exclusive build mode)\nasset-importer = { version = \"0.6\", default-features = false, features = [\"build-assimp\"] }\n\n# Or link a system-installed Assimp (requires libclang/bindgen; mutually exclusive build mode)\nasset-importer = { version = \"0.6\", default-features = false, features = [\"system\"] }\n```\n\nBasic usage:\n\n```rust\nuse asset_importer::Importer;\nuse asset_importer::postprocess::PostProcessSteps;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let scene = Importer::new().import_file(\"model.obj\")?;\n    \n    println!(\"Loaded {} meshes\", scene.num_meshes());\n    \n    for mesh in scene.meshes() {\n        // Zero-copy options are available:\n        // - mesh.vertices_raw(): \u0026[asset_importer::raw::AiVector3D]\n        // - mesh.vertices_iter(): Iterator\u003cItem = Vector3D\u003e\n        let vertices = mesh.vertices();\n        println!(\"Mesh has {} vertices (copied)\", vertices.len());\n    }\n    \n    Ok(())\n}\n```\n\nBuilder-style usage (no repeated path):\n\n```rust\nuse asset_importer::{Importer, postprocess::PostProcessSteps};\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let scene = Importer::new().read_file(\"model.fbx\")\n        .with_post_process(PostProcessSteps::TRIANGULATE | PostProcessSteps::FLIP_UVS)\n        .import()?;\n    Ok(())\n}\n```\n\n## Thread Safety (Send/Sync)\n\n`Scene` and all scene-backed view types (`Mesh`, `Material`, `Node`, `Texture`, etc.) are `Send + Sync`\nand can be shared across threads (e.g. behind `Arc`) for read-only access.\n\nImportant: do not mutate Assimp-owned scene memory through raw Assimp bindings (`asset_importer::sys` with feature `raw-sys`,\nor the `asset-importer-sys` crate) while a `Scene` (or any\nscene-backed view type) is shared across threads. Doing so violates the crate's safety contract and may cause\nundefined behavior.\n\nPractical guidance:\n\n- Prefer the safe API for reading scene data (`Mesh::*_raw()` / `*_iter()` / `MaterialPropertyRef`, etc.).\n- Only enable `raw-sys` when you explicitly need raw bindings, and treat the returned pointers as read-only.\n- Do not call Assimp APIs that mutate or free the scene (e.g. post-processing, freeing, replacing pointers) on a scene that is still alive on the Rust side.\n\n## Build Options\n\n### Default: Prebuilt Binaries (Recommended)\n\n```toml\nasset-importer = \"0.6\"\n```\n\n- **Fastest**: No compilation time\n- **Convenient**: No native toolchain required\n- **Requires**: Available release artifacts from GitHub releases\n- **Note**: Only available for released versions\n\n### Build from Source\n\n```toml\nasset-importer = { version = \"0.6\", default-features = false, features = [\"build-assimp\"] }\n```\n\n- **Best compatibility**: Works on all platforms\n- **Full control**: Latest Assimp version with all features\n- **Requires**: CMake, C++ compiler (automatically handled by Cargo)\n\n### System Library\n\n```toml\nasset-importer = { version = \"0.6\", default-features = false, features = [\"system\"] }\n```\n\n- **Lightweight**: Uses existing system installation\n- **Setup required**: Install via `brew install assimp` (macOS), `apt install libassimp-dev` (Ubuntu)\n- **Version dependent**: Behavior may vary based on system library version\n\n### Additional Features\n\n```toml\nasset-importer = {\n    version = \"0.6\",\n    default-features = false,\n    features = [\n        \"build-assimp\",    # Choose exactly one build mode (or use default prebuilt)\n        \"export\",          # Enable export functionality\n        \"type-extensions\", # Enable convenience methods on types\n        \"raw-sys\",         # Expose raw bindings as `asset_importer::sys` (unsafe contract)\n        \"glam\",            # Enable `glam` conversions\n        \"mint\",            # Enable mint math library integration\n        \"bytemuck\",        # Enable zero-copy byte casts for raw views\n        \"static-link\",     # Prefer static linking (source/prebuilt)\n        \"nozlib\"           # Disable zlib compression support\n    ]\n}\n```\n\n## Examples\n\nSee `asset-importer/examples/README.md` for a guided, step-by-step set of examples and recommended\ncommands for each build mode.\n\n## Build Requirements\n\n### Source Build Dependencies\n\nWhen building from source (`build-assimp` feature), you'll need:\n\n- **CMake** (3.10 or later)\n- **C++ Compiler** (MSVC on Windows, GCC/Clang on Linux/macOS)\n- **Git** (for submodules)\n\n### Platform-Specific Setup\n\n- **Windows**: Install Visual Studio Build Tools or Visual Studio\n- **macOS**: Install Xcode Command Line Tools (`xcode-select --install`)\n- **Linux**: Install build essentials (`sudo apt install build-essential cmake` on Ubuntu)\n\nFor detailed platform-specific instructions and troubleshooting, see the [asset-importer-sys README](https://github.com/Latias94/asset-importer/blob/main/asset-importer-sys/README.md#build-requirements).\n\n## Windows Notes (MSVC CRT)\n\n- Default Rust (MSVC) uses dynamic CRT (/MD). Our build follows Rust’s choice automatically.\n- If you need static CRT (/MT), set a target-wide flag so all crates agree:\n\n```\n# .cargo/config.toml\n[target.x86_64-pc-windows-msvc]\nrustflags = [\"-C\", \"target-feature=+crt-static\"]\n```\n\nor per-build:\n\n```\nRUSTFLAGS=\"-C target-feature=+crt-static\" cargo build --release\n```\n\n- Prebuilt binaries: we publish both MD and MT variants on Windows. Filenames include a `-md` or `-mt` suffix, for example:\n  `asset-importer-\u003cversion\u003e-x86_64-pc-windows-msvc-\u003cstatic|dylib\u003e-md.tar.gz`.\n  The build script auto-selects the variant matching your current CRT and falls back to old names if needed.\n\n- vcpkg (with `features=[\"system\"]`):\n  - Choose triplet to match CRT:\n    - `x64-windows` → /MD (dynamic)\n    - `x64-windows-static` → /MT (static)\n  - Install: `vcpkg install assimp:x64-windows` or `assimp:x64-windows-static`.\n  - If using the static triplet, also enable `crt-static` to avoid LNK2038.\n\n## Why prebuilt binaries by default?\n\n- **Fast builds**: No compilation time for Assimp\n- **Easy setup**: No native toolchain required\n- **CI/CD friendly**: Faster builds in continuous integration\n- **Consistent**: Same binary across environments\n\nIf you need more control or compatibility, use:\n\n- `--no-default-features --features build-assimp` to build from source (best compatibility)\n- `--no-default-features --features system` to link an existing installation\n\n## Development and Testing\n\nFor development work or when prebuilt binaries are not available:\n\n```toml\n# Use this for development\nasset-importer = { version = \"0.6\", default-features = false, features = [\"build-assimp\"] }\n```\n\nThis ensures you can always build from source regardless of release availability.\n\n## Memory Import Notes\n\n`Importer::read_from_memory(\u0026[u8])` stores an owned copy internally so the builder can be `'static` and support `.import()`.\nIf you already have an owned buffer, prefer `Importer::read_from_memory_owned(Vec\u003cu8\u003e)` or\n`Importer::import_from_memory_owned(Vec\u003cu8\u003e, hint)` to avoid an extra copy.\n\n## Architecture\n\nThis crate provides a high-level safe API. For low-level FFI bindings, see [`asset-importer-sys`](asset-importer-sys/).\n\n## Platform Support\n\n- **Windows**: MSVC, MinGW\n- **macOS**: Intel, Apple Silicon  \n- **Linux**: x86_64, aarch64\n\n## Goals\n\nThis project aims to provide the most comprehensive and up-to-date Rust binding for Assimp, supporting both import and export functionality with modern Rust practices.\n\n## Versioning\n\nThis workspace uses independent versioning for each crate:\n\n- **`asset-importer-sys`**: Tracks Assimp versions and FFI binding changes\n- **`asset-importer`**: Tracks high-level API changes and features\n\nSee [VERSIONING.md](VERSIONING.md) for detailed versioning strategy and release process.\n\n## Limitations\n\n- **Limited Testing**: Needs more real-world usage validation\n- **API Stability**: May change before 1.0 release\n\n## Contributing\n\nContributions welcome! Areas needing help:\n\n- Real-world testing with various file formats\n- Performance benchmarking\n- Documentation improvements\n- Platform-specific testing\n\n## Related Projects\n\nIf you're working with graphics and UI in Rust, you might also be interested in:\n\n- **[dear-imgui](https://github.com/Latias94/dear-imgui)** - Comprehensive Dear ImGui bindings for Rust using C++ bindgen, providing immediate mode GUI capabilities for graphics applications\n\n## Acknowledgments\n\n- [Assimp](https://github.com/assimp/assimp) - The underlying C++ library\n- [russimp](https://github.com/jkvargas/russimp) - Inspiration and reference\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatias94%2Fasset-importer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flatias94%2Fasset-importer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flatias94%2Fasset-importer/lists"}