diff --git a/armoury/src/singlegearview.cpp b/armoury/src/singlegearview.cpp index 140c11a..b677ec9 100644 --- a/armoury/src/singlegearview.cpp +++ b/armoury/src/singlegearview.cpp @@ -3,6 +3,8 @@ #include "singlegearview.h" +#include +#include #include #include #include @@ -321,6 +323,16 @@ void SingleGearView::importModel(const QString &filename) gearView->part().reloadModel(0); + KConfig config(QStringLiteral("novusrc")); + KConfigGroup game = config.group("Armoury"); + QString outputDirectory = game.readEntry("PenumbraOutputDirectory"); + + auto buffer = physis_mdl_write(&mdl.model); + QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath())); + file.open(QIODevice::WriteOnly); + file.write(reinterpret_cast(buffer.data), buffer.size); + file.close(); + qInfo() << "Successfully imported model!"; }