mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +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;
|
||||
}
|
||||
|
||||
QByteArray GooglePolyScriptingInterface::getAssetList(QString keyword, QString category, QString format) {
|
||||
QString 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");
|
||||
QByteArray json = parseJSON(url, 0).toJsonDocument().toJson();
|
||||
qCDebug(scriptengine) << "asset list as string is: " << json;
|
||||
return json;
|
||||
return (QString) json;
|
||||
} else {
|
||||
qCDebug(scriptengine) << "Invalid filters were specified.";
|
||||
//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) {
|
||||
QUrl url = formatURLQuery(keyword, category, "FBX");
|
||||
return getModelURL(url);
|
||||
|
|
|
@ -25,8 +25,7 @@ public slots:
|
|||
void testPrint(QString input);
|
||||
void setAPIKey(QString key);
|
||||
|
||||
//QJsonArray getAssetList(QString keyword, QString category, QString format);
|
||||
QByteArray getAssetList(QString keyword, QString category, QString format);
|
||||
QString getAssetList(QString keyword, QString category, QString format);
|
||||
QString getFBX(QString keyword, QString category);
|
||||
QString getOBJ(QString keyword, QString category);
|
||||
QString getBlocks(QString keyword, QString category);
|
||||
|
|
Loading…
Reference in a new issue