History

Merge remote-tracking branch 'upstream/master' into feature/quest

Brad Davis committed 7 years ago

Commit d60dcb92 parents 44851bb 051ab6182 files · +2091 −1749Browse files

Showing the changes to interface/src/Application.cpp (1 of 82 files). Show all

Unified · Split

interface/src/Application.cpp+13−23
@@ -1918,46 +1918,34 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1917 unmodified lines
19181918 }
19191919 }, Qt::QueuedConnection);
19201920
1921− EntityTree::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
1921+ EntityTreeRenderer::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
19221922 if (_aboutToQuit) {
19231923 return false;
19241924 }
19251925
1926− // try to find the renderable
19271926 auto renderable = getEntities()->renderableForEntityId(entityID);
19281927 if (renderable) {
19291928 renderable->addMaterial(material, parentMaterialName);
1930− }
1931−
1932− // even if we don't find it, try to find the entity
1933− auto entity = getEntities()->getEntity(entityID);
1934− if (entity) {
1935− entity->addMaterial(material, parentMaterialName);
19361929 return true;
19371930 }
1931+
19381932 return false;
19391933 });
1940− EntityTree::setRemoveMaterialFromEntityOperator([this](const QUuid& entityID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
1934+ EntityTreeRenderer::setRemoveMaterialFromEntityOperator([this](const QUuid& entityID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
19411935 if (_aboutToQuit) {
19421936 return false;
19431937 }
19441938
1945− // try to find the renderable
19461939 auto renderable = getEntities()->renderableForEntityId(entityID);
19471940 if (renderable) {
19481941 renderable->removeMaterial(material, parentMaterialName);
1949− }
1950−
1951− // even if we don't find it, try to find the entity
1952− auto entity = getEntities()->getEntity(entityID);
1953− if (entity) {
1954− entity->removeMaterial(material, parentMaterialName);
19551942 return true;
19561943 }
1944+
19571945 return false;
19581946 });
19591947
1960− EntityTree::setAddMaterialToAvatarOperator([](const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
1948+ EntityTreeRenderer::setAddMaterialToAvatarOperator([](const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
19611949 auto avatarManager = DependencyManager::get<AvatarManager>();
19621950 auto avatar = avatarManager->getAvatarBySessionID(avatarID);
19631951 if (avatar) {
@@ -1966,7 +1954,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2 unmodified lines
19661954 }
19671955 return false;
19681956 });
1969− EntityTree::setRemoveMaterialFromAvatarOperator([](const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
1957+ EntityTreeRenderer::setRemoveMaterialFromAvatarOperator([](const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
19701958 auto avatarManager = DependencyManager::get<AvatarManager>();
19711959 auto avatar = avatarManager->getAvatarBySessionID(avatarID);
19721960 if (avatar) {
@@ -2289,7 +2277,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 316 unmodified lines
22892277
22902278 // Setup the mouse ray pick and related operators
22912279 {
2292− auto mouseRayPick = std::make_shared<RayPick>(Vectors::ZERO, Vectors::UP, PickFilter(PickScriptingInterface::PICK_ENTITIES()), 0.0f, true);
2280+ auto mouseRayPick = std::make_shared<RayPick>(Vectors::ZERO, Vectors::UP, PickFilter(PickScriptingInterface::PICK_ENTITIES() | PickScriptingInterface::PICK_LOCAL_ENTITIES()), 0.0f, true);
22932281 mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>();
22942282 mouseRayPick->setJointState(PickQuery::JOINT_STATE_MOUSE);
22952283 auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick);
@@ -6999,17 +6987,19 @@ void Application::nodeActivated(SharedNodePointer node) { · 4703 unmodified lines
69996987
70006988 #if !defined(DISABLE_QML)
70016989 auto offscreenUi = getOffscreenUI();
7002− auto assetDialog = offscreenUi ? offscreenUi->getRootItem()->findChild<QQuickItem*>("AssetServer") : nullptr;
70036990
7004− if (assetDialog) {
6991+ if (offscreenUi) {
70056992 auto nodeList = DependencyManager::get<NodeList>();
70066993
70076994 if (nodeList->getThisNodeCanWriteAssets()) {
70086995 // call reload on the shown asset browser dialog to get the mappings (if permissions allow)
7009− QMetaObject::invokeMethod(assetDialog, "reload");
6996+ auto assetDialog = offscreenUi ? offscreenUi->getRootItem()->findChild<QQuickItem*>("AssetServer") : nullptr;
6997+ if (assetDialog) {
6998+ QMetaObject::invokeMethod(assetDialog, "reload");
6999+ }
70107000 } else {
70117001 // we switched to an Asset Server that we can't modify, hide the Asset Browser
7012− assetDialog->setVisible(false);
7002+ offscreenUi->hide("AssetServer");
70137003 }
70147004 }
70157005 #endif