Converter for X3's .bod files to OBJs for 3D printing

Quick and dirty tool to convert X3 .bod files to OBJ for 3D printing.

No, really, it is probably the worst code I've ever written. Don't judge me on this please. I may tidy it up and make it a nice tool.

It currently doesn't support something in some ships, and will just fail on ships like the Colossus. It also doesn't yet support scene files, so larger ships won't have their hangers etc. Both of these are things that will be fixed.

It doesn't support exporting normals, texture data, collision volumes, or anything other than pure geometry, as I currently don't need this. It seems fairly simple to add, but unless it's needed, I won't add it.

This has been tested running in msys2 on Windows 10, compiling with GCC 11.2.0. I make zero promises that it will work elsewhere.

g++ -o bod2obj.exe bod2obj.cpp
./bod2obj.exe path/to/argon_m3.bod ArgonNova

This should give you four files in the current directory

ArgonNova_LOD0.obj
ArgonNova_LOD1.obj
ArgonNova_LOD2.obj
ArgonNova_LOD3.obj

Of course you probably only want LOD0, but the rest are there because it was easy to create them.

To get the .bod files, there are a few descriptions online, but a quick rundown is:

  • Load X3 data (probably 02.cat) in X3 Editor 2 and export the ship you want
  • Use x2bc to decompile the .bob file to a .bod
  • Use this tool to convert the .bod into a .obj
  • For 3D printing, you need to make it one continuous hull, so the easiest is to use Microsoft 3D Builder to automagically fix it

I've also added a quick bash script, bod2obj-batch.sh which can be passed a .csv in the form FACTION,CLASS,SHIP,FILENAME

For example:

Argon,M4,Elite,M4/Argon_m4p

And will output Argon/M4_Elite_LOD0.obj etc given that it is run in a directory containing objects/ships/M4/Argon_m4p.bod. This is useful for batch converting many ships at once.

This project was born out of the frustration of trying to export models via gmax, which is slow and has... issues.

Again, final disclaimer, it is absolutely terrible code. I was quickly hacking it together just to try to reverse engineer the format.

Owner
Similar Resources

I2C to WS2812 (RGB LED) converter

i2c_ws2812 I2C to WS2812 (RGB LED) converter MCU and Peripherals The code is tested on ATtiny 0 & 1 series (ATtiny212 & ATtiny402). I2C, CCL, SPI, and

Oct 15, 2021

usb to 5 din midi converter-filter-router, sound generator

usb to 5 din midi converter-filter-router, sound generator

multi What is multi? It's a PCB (shield/hat) hosting a seeeduino Xiao. It has 6 potentiometers, 2 pushbuttons and a 1/8" audio out connected to the Xi

Dec 31, 2022

Simple IEEE 754 float point to register converter

i3ecnv Simple IEEE 754 float point to register converter Usage IEEE 754 converter: Type: i3ecnv double value Example 1 ./i3ecnv 1.2 Value DO

Nov 28, 2021

A format converter for surface mesh intergrated with muli tools.

A format converter for surface mesh intergrated with muli tools.

MeshConverter A format converter for surface mesh intergrated with small tools for fast surface mesh modification in CFD application scenarios. Build

Jul 22, 2022

USB2Sun - USB keyboard/mouse to Sun Converter

USB2Sun While I've found many projects for connecting the Sun serial based keyboards to a modern machine via USB, I've never found anything to connect

Nov 24, 2022

A video input (V4L2) to NDI converter that works with Raspberry Pi (32-bit and 64-bit), and Intel/AMD CPUs

V4L2 to NDI V4L2 to NDI is an application that connects to attached V4L2 devices and encodes the video signal into NDI It uses the NDI library, allowi

Dec 30, 2022

File path converter for Windows & Git Bash

windows-git-bash-path-converter Motivation Made this because it was so mad to convert path between Windows and Git Bash How to use Windows file path t

Mar 15, 2022

Simple ATTiny85 based PS/2 to Amiga keyboard protocol converter that fits inside the keyboard.

Simple ATTiny85 based PS/2 to Amiga keyboard protocol converter that fits inside the keyboard.

Simple ATTiny85 based PS/2 to Amiga keyboard protocol converter that fits inside the keyboard.

Dec 23, 2022

Proof of Concept 'GeoPackage' to Arrow Converter

gpkg The goal of gpkg is to provide a proof-of-concept reader for SQLite queries into Arrow C Data interface structures. Installation You can install

May 20, 2022
Comments
  • Noob cant understand how to use your tool

    Noob cant understand how to use your tool

    Thank you for making this tool to help extract the ship files from x3 to .obj for printing. I however must not have the technical skills to understand your Readme.

    1. I do not understand where the file bin/bod2obj.exe is. Do I need to compile the src code to use this?
    2. your instructions are "make bin/bod2obj.exe path/to/argon_m3.bod ArgonNova". I do not see a file named make?

    I have some time programming in python but for the life of me there must be something im missing. If you could help me out and give me a little more info on how to use your tool that would be great thank you.

    Nick the perpetual noob.

  • archive support

    archive support

    No real reason for this, but might be nice to add in a hook to read/write from a .cat archive, so you don't have to export the files with X3 Editor 2 first.

  • bob support

    bob support

    I would assume that the binary .bob files are probably a similar format to .bod, but as binary. It should therefore be pretty easy to add read/write for these files without needing to work with plaintext .bod files

  • obj2bod?

    obj2bod?

    I should be able to fairly easily write the reverse tool with the same code.

    There are a few fields that are currently unknown, and the metadata at the top of the file is currently totally unparsed. These would have to be totally understood before I could consider outputting a bod file.

A header-only library for C++(0x) that allows automagic pretty-printing of any container.

cxx-prettyprint =============== A pretty printing library for C++ containers. Synopsis: Simply by including this header-only library in your sourc

Nov 26, 2022
Pattern Printing For beginners!

Patterns Project on Patterns Installation Download the source files and compile it. Linux g++ main.cpp -o patterns.out ./patterns.out Windows g++ mai

Oct 17, 2021
Dec 29, 2022
MKS TinyBee is a mainboard for 3d printing, based on ESP32 module
MKS TinyBee is a mainboard for 3d printing, based on ESP32 module

MKS-TinyBee MKS TinyBee is a mainboard for 3d printing, based on ESP32 module. Support Marlin2.0 firmware, in addition to ordinary LCD2004, 12864 scre

Dec 20, 2022
Generate code for pretty-printing C++ enums

enums Generate code for pretty-printing C++ enums. Supported platforms Only Linux x86/x86_64 systems are supported. For the missing platforms, the too

Jan 31, 2022
PRINT++ is a simple, open source print library for C++, the main usage of PRINT++ is printing out "log" messages
PRINT++ is a simple, open source print library for C++, the main usage of PRINT++ is printing out

note that for now, print++ is using std::cout. In future it will be using own print function. Windows version can be unstable That library is in alpha

Jan 23, 2022
Xmodelconverter - A converter for xmodel & xanim files for Call of Duty

xmodelconverter A converter for xmodel & xanim files for Call of Duty. It converts xmodel & xanim files back into xmodel_export and xanim_export text

May 13, 2022
per - Simple unix permission viewer and converter

Per is a simple utility that can verbosely print unix permissions and convert between symbolic and numeric notations and vice-versa.

Oct 23, 2022
CRServoF - The CSRF serial protocol to PWM servo converter
 CRServoF - The CSRF serial protocol to PWM servo converter

CRServoF - The CSRF serial protocol to PWM servo converter I wanted to create a small project to mess around with PWM servo output for ExpressLRS, and

Dec 28, 2022
IR2USB - IR to USB HID Converter based on ATtiny45/85
 IR2USB - IR to USB HID Converter based on ATtiny45/85

IR2USB - IR to USB HID Converter based on ATtiny45/85 IR2USB receives signals from an infrared remote control and converts them into keyboard inputs,

Dec 21, 2022