diff --git a/include/light/light.hh b/include/light/light.hh index 29960090..fe51e7d6 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -459,6 +459,7 @@ public: setting_bool litonly{this, "litonly", false, &output_group, "only write .lit file, don't modify BSP"}; setting_bool nolights{this, "nolights", false, &output_group, "ignore light entities (only sunlight/minlight)"}; setting_int32 facestyles{this, "facestyles", 4, &output_group, "max amount of styles per face; requires BSPX lump"}; + setting_bool exportobj{this, "exportobj", false, &output_group, "export an .OBJ for inspection"}; inline void CheckNoDebugModeSet() { diff --git a/light/light.cc b/light/light.cc index 737681c7..d059e5e8 100644 --- a/light/light.cc +++ b/light/light.cc @@ -1092,9 +1092,9 @@ int light_main(int argc, const char **argv) bsp.dlightdata.clear(); } -#if 0 - ExportObj(source, bsp); -#endif + if (options.exportobj.value()) { + ExportObj(fs::path{source}.replace_extension(".obj"), &bsp); + } WriteEntitiesToString(options, &bsp); /* Convert data format back if necessary */