JLouis-B / RedTools

Unpack and convert 3D models from CD Projekt games
http://jlouisb.users.sourceforge.net/
74 stars 10 forks source link

load multiple files via arguments #5

Closed athompson673 closed 3 years ago

athompson673 commented 3 years ago

New feature request: provide multiple file paths as an argument, and attempt to load each one using loadFileGeneric.

I don't have an environment to build / test this, but it seems like this could be a simple edit to main.cpp:

#include "GUI_MainWindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    GUI_MainWindow w;
    w.show();
    w.initIrrlicht();

    int n_arguments = QCoreApplication::arguments().size()
    if (n_arguments > 1)
    {
        for (int i = 1; i < n_arguments; i++)
            w.loadFileGeneric(QCoreApplication::arguments().at(i));
    }

    return a.exec();
}
JLouis-B commented 3 years ago

Hi, Thanks for the suggestion, it seems to be a good idea indeed. However it should be noted that currently the loading of several meshes in the software is limited and goes through the "Add mesh" button which actually merges the extra mesh to the first one. I would like to have a real scene management in the future, but I can still implement your suggestion for the next version, it won't be extremely complicated.

JLouis-B commented 3 years ago

Implemented in the 2.13 release