History

Implement test scene loading

Brad Davis committed 9 years ago

Commit be6b0981 parent e58623b1 file · +15 −18Browse files

Showing the changes to interface/src/scripting/TestScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/TestScriptingInterface.cpp+15−18
@@ -14,6 +14,7 @@ · 13 unmodified lines
14#include <DependencyManager.h>14#include <DependencyManager.h>
15#include <Trace.h>15#include <Trace.h>
16#include <StatTracker.h>16#include <StatTracker.h>
17#include <OffscreenUi.h>
17 18
18#include "Application.h"19#include "Application.h"
19 20
@@ -54,24 +55,20 @@ void TestScriptingInterface::waitIdle() { · 34 unmodified lines
54}55}
55 56
56bool TestScriptingInterface::loadTestScene(QString scene) {57bool TestScriptingInterface::loadTestScene(QString scene) {
57 // FIXME implement58 static const QString TEST_ROOT = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/";
58 // qApp->postLambdaEvent([isClient] {59 static const QString TEST_BINARY_ROOT = "https://hifi-public.s3.amazonaws.com/test_scene_data/";
59 // auto tree = qApp->getEntityClipboard();60 static const QString TEST_SCRIPTS_ROOT = TEST_ROOT + "scripts/";
60 // tree->setIsClient(isClient);61 static const QString TEST_SCENES_ROOT = TEST_ROOT + "scenes/";
61 // });62 return DependencyManager::get<OffscreenUi>()->returnFromUiThread([scene]()->QVariant {
62 /*63 ResourceManager::setUrlPrefixOverride("atp:/", TEST_BINARY_ROOT + scene + ".atp/");
63 Test.setClientTree(false);64 auto tree = qApp->getEntities()->getTree();
64 Resources.overrideUrlPrefix("atp:/", TEST_BINARY_ROOT + scene + ".atp/");65 auto treeIsClient = tree->getIsClient();
65 if (!Clipboard.importEntities(TEST_SCENES_ROOT + scene + ".json")) {66 // Force the tree to accept the load regardless of permissions
66 return false;67 tree->setIsClient(false);
67 }68 auto result = tree->readFromURL(TEST_SCENES_ROOT + scene + ".json");
68 var position = { x: 0, y: 0, z: 0 };69 tree->setIsClient(treeIsClient);
69 var pastedEntityIDs = Clipboard.pasteEntities(position);70 return result;
70 for (var id in pastedEntityIDs) {71 }).toBool();
71 print("QQQ ID imported " + id);
72 }
73 */
74 return false;
75}72}
76 73
77bool TestScriptingInterface::startTracing(QString logrules) {74bool TestScriptingInterface::startTracing(QString logrules) {