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
.modfiles - 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
.objformat - Import / export texture data from
.txefiles - Import / export trailing
.inidata blocks - Export model data to
.dmdformat [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
.modfile - 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.objmodconv 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-
MODClass: Central class representing a loaded.modfile, containing vectors and objects for all data chunks (vertices, materials, meshes) -
cmdNamespace: 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
structs that directly map to binary structures in the.modfile format (Material,TEVInfo,Mesh,Joint,CollTriInfo, etc.)
- Complete work-in-progress
.objand.dmdexport functionality - Implement the stubbed
objToDmdconverter - Tidy the code further