mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 12:13:40 +02:00
Enable support for baking JS files inside of the oven
This commit is contained in:
parent
5448099a93
commit
c555590e9b
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "ModelBakingLoggingCategory.h"
|
||||
#include "BakerCLI.h"
|
||||
#include "FBXBaker.h"
|
||||
#include "JSBaker.h"
|
||||
#include "TextureBaker.h"
|
||||
|
||||
BakerCLI::BakerCLI(OvenCLIApplication* parent) : QObject(parent) {
|
||||
|
@ -34,6 +35,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString&
|
|||
qDebug() << "Baking file type: " << type;
|
||||
|
||||
static const QString MODEL_EXTENSION { "fbx" };
|
||||
static const QString SCRIPT_EXTENSION { "js" };
|
||||
|
||||
QString extension = type;
|
||||
|
||||
|
@ -44,6 +46,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString&
|
|||
|
||||
// check what kind of baker we should be creating
|
||||
bool isFBX = extension == MODEL_EXTENSION;
|
||||
bool isScript = extension == SCRIPT_EXTENSION;
|
||||
|
||||
bool isSupportedImage = QImageReader::supportedImageFormats().contains(extension.toLatin1());
|
||||
|
||||
|
@ -57,6 +60,9 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString&
|
|||
outputPath)
|
||||
};
|
||||
_baker->moveToThread(Oven::instance().getNextWorkerThread());
|
||||
} else if (isScript) {
|
||||
_baker = std::unique_ptr<Baker> { new JSBaker(inputUrl, outputPath) };
|
||||
_baker->moveToThread(qApp->getNextWorkerThread());
|
||||
} else if (isSupportedImage) {
|
||||
_baker = std::unique_ptr<Baker> { new TextureBaker(inputUrl, image::TextureUsage::CUBE_TEXTURE, outputPath) };
|
||||
_baker->moveToThread(Oven::instance().getNextWorkerThread());
|
||||
|
|
Loading…
Reference in a new issue