33 releases (19 stable)

3.2.0 Feb 4, 2024
2.0.7 Jan 15, 2024
2.0.6 Jul 2, 2023
2.0.2 Jan 10, 2023
0.1.1 Dec 15, 2020

#30 in Rendering

Download history 8/week @ 2024-07-01 7/week @ 2024-07-08 13/week @ 2024-07-15 2/week @ 2024-07-22 42/week @ 2024-07-29 16/week @ 2024-08-05 25/week @ 2024-08-12 8/week @ 2024-08-19 7/week @ 2024-08-26 18/week @ 2024-09-02 5/week @ 2024-09-09 19/week @ 2024-09-16 57/week @ 2024-09-23 65/week @ 2024-09-30 2/week @ 2024-10-07 13/week @ 2024-10-14

140 downloads per month
Used in 2 crates

Custom license

125KB
3K SLoC

russimp russimp Crates.io

Rust bindings for Assimp (https://github.com/assimp/assimp)

Overview

Russimp is a library for talking to the assimp library which enables you to read 3d models in different formats to a common structure.

By default, russimp looks for the assimp library on your computer. To install it:

  • OSX: You will need to update brew and install assimp with it.
  • Linux: You will need to install assimp through your package manager of choice.
  • Windows: You can use the prebuilt version russimp = { version = "1.0.5", features = ["prebuilt"] }

Alternately, you may prefer to use prebuilt assimp binaries or compile it yourself; in either case russimp will statically link assimp into your binary. Russimp exposes the following Cargo features to manage the assimp dependency (this documentation is reproduced from russimp-sys):

prebuilt

Download prebuilt Assimp static library binaries from github and skip building from source.

Because Assimp build is slow and have build environment requirements. We provide prebuilt binaries for common platforms and features.

When a new version is released, github action automatically runs pre-build tasks, and all prebuilt binaries are saved in github releases.

The russimp-sys build script will try to download the prebuilt binaries from github first, and skip the full source build.

Enabling static-link feature without prebuilt feature will build assimp from source.

Builds from source need the following dependencies:

  • cmake
  • clang
  • Ninja for Linux and MacOS, Visual Studio 2019 for Windows

nozlib

By default russimp-sys will statically link zlibstatic, you can disable this feature if it conflicts with other dependencies.

Helping

You are very welcome to help with development, adding a feature, fixing a problem or just refactoring. Try to do it with tests =)

Make sure to run cargo fmt before creating a pull request.

How to use it?

Use Scene::from_file to load a scene from a given file or Scene::from_buffer to load the scene directly from memory. If you want, you can give PostProcess flags to change the scene structure according to your needs. From the scene, you will have access to the underlying structs.

let scene = Scene::from_file("myfile.blend",
vec![PostProcess::CalculateTangentSpace,
     PostProcess::Triangulate,
     PostProcess::JoinIdenticalVertices,
     PostProcess::SortByPrimitiveType]).unwrap();

// Progress The Scene...

Changelog

The Changelog can be found Here

Dependencies

~3–14MB
~197K SLoC