A C++ command-line tool for converting and editing proprietary 3D model files (.mod
format) from Pikmin 1 for the GameCube and Wii.
-
File Handling
- Load, parse, and write
.mod
files - Edit header data (date of creation / model flags)
- Delete specific data chunks (materials, textures, vertices) from loaded models
- Clear current model data
- Load, parse, and write
-
Import / Export
- Import / export material and TEV (Texture Environment) settings to human-readable text files
- Import / export model geometry to Wavefront
.obj
format - Import / export texture data from
.txe
files - Import / export trailing
.ini
data blocks - Export model data to
.dmd
format [WIP]
-
Modern C++ compiler (GCC, Clang, or MSVC)
-
CMake
Navigate to the project root directory:
mkdir build
cd build
cmake ..
cmake --build .
Execute the compiled binary to start the interactive shell:
./modconv[.exe]
The tool uses an interactive command-line interface. Once started, it displays available commands.
Basic workflow:
- Load a
.mod
file - Export data to editable formats or modify the file as needed
- Apply changes to the model
- Write the modified model to a new file
Example session:
load my_model.mod
export_materials materials.txt
# Edit materials.txt with a text editor
import_material materials.txt
write my_model_new.mod
close
# Windows
modconv.exe load model.mod export_obj model.obj
# Linux/Mac
./modconv load model.mod export_obj model.obj
modconv load model.mod export_textures ./textures/
modconv load model.mod export_materials materials.txt close load model2.mod import_material materials.txt write model2_updated.mod
# Delete collision data and save
modconv load model.mod delete_chunk 0x100 delete_chunk 0x110 write model_no_collision.mod
-
MOD
Class: Central class representing a loaded.mod
file, containing vectors and objects for all data chunks (vertices, materials, meshes) -
cmd
Namespace: Manages the interactive command-line interface, parsing user input and executing corresponding functions -
File I/O
util::fstream_reader
&util::fstream_writer
: Custom stream classes for binary file I/O with big-endian byte swappingMaterialReader
&MaterialWriter
: Classes for serializing material data to/from human-readable text format
-
Data Structures: There are a variety of
struct
s that directly map to binary structures in the.mod
file format (Material
,TEVInfo
,Mesh
,Joint
,CollTriInfo
, etc.)
- Complete work-in-progress
.obj
and.dmd
export functionality - Implement the stubbed
objToDmd
converter - Tidy the code further