mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:36:56 +02:00
fixed getAssetList()
This commit is contained in:
parent
8a9e5bc39d
commit
34d8fe307d
2 changed files with 3 additions and 20 deletions
|
@ -40,14 +40,13 @@ void GooglePolyScriptingInterface::setAPIKey(QString key) {
|
||||||
authCode = key;
|
authCode = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
|
QString GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
|
||||||
QUrl url = formatURLQuery(keyword, category, format);
|
QUrl url = formatURLQuery(keyword, category, format);
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
//QJsonArray json = parseJSON(url, 0).toJsonArray();
|
//QJsonArray json = parseJSON(url, 0).toJsonArray();
|
||||||
//qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");
|
//qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");
|
||||||
QByteArray json = parseJSON(url, 0).toJsonDocument().toJson();
|
QByteArray json = parseJSON(url, 0).toJsonDocument().toJson();
|
||||||
qCDebug(scriptengine) << "asset list as string is: " << json;
|
return (QString) json;
|
||||||
return json;
|
|
||||||
} else {
|
} else {
|
||||||
qCDebug(scriptengine) << "Invalid filters were specified.";
|
qCDebug(scriptengine) << "Invalid filters were specified.";
|
||||||
//return QJsonArray();
|
//return QJsonArray();
|
||||||
|
@ -55,21 +54,6 @@ QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*QJsonArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
|
|
||||||
QUrl url = formatURLQuery(keyword, category, format);
|
|
||||||
if (!url.isEmpty()) {
|
|
||||||
//QJsonArray json = parseJSON(url, 0).toJsonArray();
|
|
||||||
//qCDebug(scriptengine) << "first asset name: " << json.at(0).toObject().value("displayName");
|
|
||||||
QJsonArray json = parseJSON(url, 0).toJsonArray();
|
|
||||||
qCDebug(scriptengine) << "asset list as array is: " << json;
|
|
||||||
return json;
|
|
||||||
} else {
|
|
||||||
qCDebug(scriptengine) << "Invalid filters were specified.";
|
|
||||||
return QJsonArray();
|
|
||||||
//return "";
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
QString GooglePolyScriptingInterface::getFBX(QString keyword, QString category) {
|
QString GooglePolyScriptingInterface::getFBX(QString keyword, QString category) {
|
||||||
QUrl url = formatURLQuery(keyword, category, "FBX");
|
QUrl url = formatURLQuery(keyword, category, "FBX");
|
||||||
return getModelURL(url);
|
return getModelURL(url);
|
||||||
|
|
|
@ -25,8 +25,7 @@ public slots:
|
||||||
void testPrint(QString input);
|
void testPrint(QString input);
|
||||||
void setAPIKey(QString key);
|
void setAPIKey(QString key);
|
||||||
|
|
||||||
//QJsonArray getAssetList(QString keyword, QString category, QString format);
|
QString getAssetList(QString keyword, QString category, QString format);
|
||||||
QByteArray getAssetList(QString keyword, QString category, QString format);
|
|
||||||
QString getFBX(QString keyword, QString category);
|
QString getFBX(QString keyword, QString category);
|
||||||
QString getOBJ(QString keyword, QString category);
|
QString getOBJ(QString keyword, QString category);
|
||||||
QString getBlocks(QString keyword, QString category);
|
QString getBlocks(QString keyword, QString category);
|
||||||
|
|
Loading…
Reference in a new issue