10#include <QtCore/QDebug>
11#include <QtCore/QHash>
13#include <QtCore/QList>
14#include <QtCore/QString>
25 m_assetImporters.append(importer);
27 for (
const auto &
extension : importer->inputExtensions()) {
31 qWarning() <<
"Failed to load asset import plugin with key: " <<
key;
38 for (
auto importer : m_assetImporters) {
45 const QDir &outputPath,
52 const QDir &outputPath,
75 auto errorString = importer->import(fileInfo.
absoluteFilePath(), outputPath, options, &generatedFiles);
77 if (!errorString.isEmpty()) {
86 for (
const auto &
file : generatedFiles)
105 auto it = m_assetImporters.cbegin();
106 const auto end = m_assetImporters.cend();
113 const auto &importer = *
it;
114 const auto ret = importer->import(
url, options,
scene);
115 if (!
ret.isEmpty()) {
139 options = importer->importOptions();
148 for (
const auto importer : m_assetImporters)
149 options.insert(importer->inputExtensions().join(QChar::fromLatin1(
':')), importer->importOptions());
155 QHash<QString, QStringList> extensionMap;
156 for (
const auto importer : std::as_const(m_assetImporters))
157 extensionMap.
insert(importer->typeDescription(), importer->inputExtensions());
163 QList<QSSGAssetImporterPluginInfo>
output;
167 plugin.name = importer->name();
168 plugin.inputExtensions = importer->inputExtensions();
169 plugin.outputExtension = importer->outputExtension();
170 plugin.type = importer->type();
171 plugin.importOptions = importer->importOptions();
172 plugin.typeDescription = importer->typeDescription();
QString suffix() const
Returns the suffix (extension) of the file.
QString absoluteFilePath() const
bool exists() const
Returns true if the file system entry this QFileInfo refers to exists; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
\inmodule QtCore\reentrant
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
QSSGAssetImportManager(QObject *parent=nullptr)
QList< QSSGAssetImporterPluginInfo > getImporterPluginInfos() const
QJsonObject getOptionsForFile(const QString &filename)
PluginOptionMaps getAllOptions() const
QHash< QString, QJsonObject > PluginOptionMaps
QHash< QString, QStringList > getSupportedExtensions() const
~QSSGAssetImportManager()
ImportState importFile(const QString &filename, const QDir &outputPath, QString *error=nullptr)
static QStringList keys()
static QSSGAssetImporter * create(const QString &name, const QStringList &args)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString toLower() const &
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
DBusConnection const char DBusError * error
#define QStringLiteral(str)
QT_BEGIN_NAMESPACE typedef uchar * output
QUrl url("example.com")
[constructor-url-reference]