8 releases (breaking)

0.8.0 Apr 27, 2024
0.7.0 Mar 15, 2024
0.6.0 Feb 16, 2024
0.5.0 Jan 27, 2024
0.1.0 Oct 29, 2023

#1 in #xenoblade

Download history 22/week @ 2024-01-16 29/week @ 2024-01-23 151/week @ 2024-02-13 11/week @ 2024-02-20 37/week @ 2024-02-27 1/week @ 2024-03-05 125/week @ 2024-03-12 18/week @ 2024-03-19 27/week @ 2024-04-02 298/week @ 2024-04-23 19/week @ 2024-04-30

317 downloads per month
Used in 2 crates

MIT license

400KB
8K SLoC

xc3_lib GitHub release (latest by date including pre-releases)

Rust libraries and tools for working with rendering related file formats for Xenoblade Chronicles X, Xenoblade Chronicles 1 DE, Xenoblade Chronicles 2, and Xenoblade Chronicles 3.

Report any bugs or request new features in issues. Download precompiled binaries for the tools in releases. Python bindings for xc3_model are available with xc3_model_py. See the xenoblade rendering research website for information on topics related to in game rendering.

Formats

xc3_lib supports a number of in game formats. All formats support reading. Write support is still a WIP for some formats. Click on the links to open the corresponding Rust module in xc3_lib. Extensions starting with wi are for the Switch like wimdo or wismt. Extensions starting with pc are for PC builds like pcmdo or pcsmt. Extensions starting with ca are for the Wii U like camdo or casmt.

Format Magic Extensions Write
Apmd DMPA wimdo ✔️
Bc BC anm, motstm_data ✔️*
Beb beb ✔️
Bmn BMN bmn
Dhal LAHD wilay ✔️*
Eva eva eva ✔️*
Lagp LAGP wilay ✔️*
Laps LAPS wilay ✔️*
Ltpc LTPC ✔️
Mibl LBIM witex, witx ✔️
Msmd DMSM wismhd
Msrd DRSM wismt ✔️*
Mtxt MTXT catex, calut, caavp ✔️
Mxmd DMXM wimdo ✔️*
MxmdLegacy MXMD camdo
Sar1 1RAS arc, chr, mot ✔️
Spch HCPS wishp ✔️
Xbc1 xbc1 wismt ✔️

* Some files are not binary identical with the originals after saving.

Projects

See Architecture for a design overview of the various projects. Click on the docs.rs links below to see the generated rustdoc documentation.

Libraries

  • Crates.io docs.rs - file format library
  • Crates.io docs.rs - higher level API for xc3_lib
  • Crates.io docs.rs - model and map renderer
  • Crates.io docs.rs - binary writing and layout

Binaries

  • xc3_gltf - convert models and maps to glTF
  • xc3_test - test against files in an extracted dump
  • xc3_tex - convert textures to and from common formats and replace textures in wilay and wimdo files
  • xc3_viewer - simple model viewer for testing xc3_wgpu
  • xc3_wgpu_batch - batch render models and maps to PNG

Usage

These projects are still highly unstable. When using the latest version from github, specify a specific git revision or commit the Cargo.lock file to source control. This locks the version and avoids any breaking changes. The debug or JSON output has not stabilized and should not be assumed to be the same between commits.

xc3_model = { git = "https://github.com/ScanMountGoat/xc3_lib", rev = "commit_hash" }
xc3_wgpu = { git = "https://github.com/ScanMountGoat/xc3_lib", rev = "commit_hash" }
xc3_lib = { git = "https://github.com/ScanMountGoat/xc3_lib", rev = "commit_hash" }

Building

After installing the Rust toolchain, run cargo build --release in the repository directory to build the tools to target/release. Running cargo build without the --release will result in faster compile times during development but dramatically worse runtime performance. The tools can also be run using cargo run --release -p <project> <args>. xc3_tex uses image_dds, which supports Windows x86, Linux x86, MacOS x86, and MacOS Apple Silicon due to using precompiled kernels for DDS encoding. Other projects should build on other platforms without issues.

Credits

This project is based on previous reverse engineering work, including work done for Xenoblade X and Xenoblade 2. Special thanks go to members of the World Tree Research discord (formerly the World of Alrest discord) for their assistance.

Dependencies

~22MB
~218K SLoC