mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Add fbx upload on drop
This commit is contained in:
parent
2d12b2ba9a
commit
b666acdb26
4 changed files with 22 additions and 5 deletions
|
@ -157,6 +157,7 @@ static const QString SVO_EXTENSION = ".svo";
|
||||||
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
static const QString SVO_JSON_EXTENSION = ".svo.json";
|
||||||
static const QString JS_EXTENSION = ".js";
|
static const QString JS_EXTENSION = ".js";
|
||||||
static const QString FST_EXTENSION = ".fst";
|
static const QString FST_EXTENSION = ".fst";
|
||||||
|
static const QString FBX_EXTENSION = ".fbx";
|
||||||
|
|
||||||
static const int MIRROR_VIEW_TOP_PADDING = 5;
|
static const int MIRROR_VIEW_TOP_PADDING = 5;
|
||||||
static const int MIRROR_VIEW_LEFT_PADDING = 10;
|
static const int MIRROR_VIEW_LEFT_PADDING = 10;
|
||||||
|
@ -190,6 +191,15 @@ static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStanda
|
||||||
const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js";
|
||||||
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
Setting::Handle<int> maxOctreePacketsPerSecond("maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
|
||||||
|
|
||||||
|
const QHash<QString, Application::AcceptURLMethod> Application::_acceptedExtensions {
|
||||||
|
{ SNAPSHOT_EXTENSION, &Application::acceptSnapshot },
|
||||||
|
{ SVO_EXTENSION, &Application::importSVOFromURL },
|
||||||
|
{ SVO_JSON_EXTENSION, &Application::importSVOFromURL },
|
||||||
|
{ JS_EXTENSION, &Application::askToLoadScript },
|
||||||
|
{ FST_EXTENSION, &Application::askToSetAvatarUrl },
|
||||||
|
{ FBX_EXTENSION, &Application::askToUploadAsset }
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
class MyNativeEventFilter : public QAbstractNativeEventFilter {
|
||||||
public:
|
public:
|
||||||
|
@ -4072,6 +4082,14 @@ bool Application::askToLoadScript(const QString& scriptFilenameOrURL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "ui/AssetUploadDialogFactory.h"
|
||||||
|
bool Application::askToUploadAsset(const QString& filename) {
|
||||||
|
if (!filename.isEmpty()) {
|
||||||
|
AssetUploadDialogFactory::getInstance().showDialog(filename);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded,
|
ScriptEngine* Application::loadScript(const QString& scriptFilename, bool isUserLoaded,
|
||||||
bool loadScriptFromEditor, bool activateMainWindow, bool reload) {
|
bool loadScriptFromEditor, bool activateMainWindow, bool reload) {
|
||||||
|
|
||||||
|
|
|
@ -327,6 +327,7 @@ private slots:
|
||||||
bool acceptSnapshot(const QString& urlString);
|
bool acceptSnapshot(const QString& urlString);
|
||||||
bool askToSetAvatarUrl(const QString& url);
|
bool askToSetAvatarUrl(const QString& url);
|
||||||
bool askToLoadScript(const QString& scriptFilenameOrURL);
|
bool askToLoadScript(const QString& scriptFilenameOrURL);
|
||||||
|
bool askToUploadAsset(const QString& asset);
|
||||||
|
|
||||||
void setSessionUUID(const QUuid& sessionUUID);
|
void setSessionUUID(const QUuid& sessionUUID);
|
||||||
void domainChanged(const QString& domainHostname);
|
void domainChanged(const QString& domainHostname);
|
||||||
|
|
|
@ -29,10 +29,6 @@ AssetUploadDialogFactory& AssetUploadDialogFactory::getInstance() {
|
||||||
return staticInstance;
|
return staticInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetUploadDialogFactory::AssetUploadDialogFactory() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static const QString PERMISSION_DENIED_ERROR = "You do not have permission to upload content to this asset-server.";
|
static const QString PERMISSION_DENIED_ERROR = "You do not have permission to upload content to this asset-server.";
|
||||||
|
|
||||||
void AssetUploadDialogFactory::showDialog() {
|
void AssetUploadDialogFactory::showDialog() {
|
||||||
|
|
|
@ -27,12 +27,14 @@ public:
|
||||||
static AssetUploadDialogFactory& getInstance();
|
static AssetUploadDialogFactory& getInstance();
|
||||||
|
|
||||||
void setDialogParent(QWidget* dialogParent) { _dialogParent = dialogParent; }
|
void setDialogParent(QWidget* dialogParent) { _dialogParent = dialogParent; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showDialog();
|
void showDialog();
|
||||||
private slots:
|
private slots:
|
||||||
void handleUploadFinished(AssetUpload* upload, const QString& hash);
|
void handleUploadFinished(AssetUpload* upload, const QString& hash);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AssetUploadDialogFactory();
|
AssetUploadDialogFactory() = default;
|
||||||
|
|
||||||
void showErrorDialog(const QString& filename, const QString& additionalError);
|
void showErrorDialog(const QString& filename, const QString& additionalError);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue