Showing the changes to interface/src/Application.cpp (1 of 82 files). Show all
Unified · Split
| @@ -1918,46 +1918,34 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1917 unmodified lines | ||
| 1918 | 1918 | } |
| 1919 | 1919 | }, Qt::QueuedConnection); |
| 1920 | 1920 | |
| 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) { | |
| 1922 | 1922 | if (_aboutToQuit) { |
| 1923 | 1923 | return false; |
| 1924 | 1924 | } |
| 1925 | 1925 | |
| 1926 | − // try to find the renderable | |
| 1927 | 1926 | auto renderable = getEntities()->renderableForEntityId(entityID); |
| 1928 | 1927 | if (renderable) { |
| 1929 | 1928 | 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); | |
| 1936 | 1929 | return true; |
| 1937 | 1930 | } |
| 1931 | + | |
| 1938 | 1932 | return false; |
| 1939 | 1933 | }); |
| 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) { | |
| 1941 | 1935 | if (_aboutToQuit) { |
| 1942 | 1936 | return false; |
| 1943 | 1937 | } |
| 1944 | 1938 | |
| 1945 | − // try to find the renderable | |
| 1946 | 1939 | auto renderable = getEntities()->renderableForEntityId(entityID); |
| 1947 | 1940 | if (renderable) { |
| 1948 | 1941 | 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); | |
| 1955 | 1942 | return true; |
| 1956 | 1943 | } |
| 1944 | + | |
| 1957 | 1945 | return false; |
| 1958 | 1946 | }); |
| 1959 | 1947 | |
| 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) { | |
| 1961 | 1949 | auto avatarManager = DependencyManager::get<AvatarManager>(); |
| 1962 | 1950 | auto avatar = avatarManager->getAvatarBySessionID(avatarID); |
| 1963 | 1951 | if (avatar) { |
| @@ -1966,7 +1954,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2 unmodified lines | ||
| 1966 | 1954 | } |
| 1967 | 1955 | return false; |
| 1968 | 1956 | }); |
| 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) { | |
| 1970 | 1958 | auto avatarManager = DependencyManager::get<AvatarManager>(); |
| 1971 | 1959 | auto avatar = avatarManager->getAvatarBySessionID(avatarID); |
| 1972 | 1960 | if (avatar) { |
| @@ -2289,7 +2277,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 316 unmodified lines | ||
| 2289 | 2277 | |
| 2290 | 2278 | // Setup the mouse ray pick and related operators |
| 2291 | 2279 | { |
| 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); | |
| 2293 | 2281 | mouseRayPick->parentTransform = std::make_shared<MouseTransformNode>(); |
| 2294 | 2282 | mouseRayPick->setJointState(PickQuery::JOINT_STATE_MOUSE); |
| 2295 | 2283 | auto mouseRayPickID = DependencyManager::get<PickManager>()->addPick(PickQuery::Ray, mouseRayPick); |
| @@ -6999,17 +6987,19 @@ void Application::nodeActivated(SharedNodePointer node) { · 4703 unmodified lines | ||
| 6999 | 6987 | |
| 7000 | 6988 | #if !defined(DISABLE_QML) |
| 7001 | 6989 | auto offscreenUi = getOffscreenUI(); |
| 7002 | − auto assetDialog = offscreenUi ? offscreenUi->getRootItem()->findChild<QQuickItem*>("AssetServer") : nullptr; | |
| 7003 | 6990 | |
| 7004 | − if (assetDialog) { | |
| 6991 | + if (offscreenUi) { | |
| 7005 | 6992 | auto nodeList = DependencyManager::get<NodeList>(); |
| 7006 | 6993 | |
| 7007 | 6994 | if (nodeList->getThisNodeCanWriteAssets()) { |
| 7008 | 6995 | // 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 | + } | |
| 7010 | 7000 | } else { |
| 7011 | 7001 | // we switched to an Asset Server that we can't modify, hide the Asset Browser |
| 7012 | − assetDialog->setVisible(false); | |
| 7002 | + offscreenUi->hide("AssetServer"); | |
| 7013 | 7003 | } |
| 7014 | 7004 | } |
| 7015 | 7005 | #endif |