History

start moving materials to rendering only

SamGondelman committed 7 years ago

Commit bed27321 parent efe276712 files · +278 −386Browse files

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

Unified · Split

interface/src/Application.cpp+4−35
@@ -1926,46 +1926,32 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1925 unmodified lines
19261926 }
19271927 });
19281928
1929− EntityTree::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
1929+ EntityTreeRenderer::setAddMaterialToEntityOperator([this](const QUuid& entityID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
19301930 if (_aboutToQuit) {
19311931 return false;
19321932 }
19331933
1934− // try to find the renderable
19351934 auto renderable = getEntities()->renderableForEntityId(entityID);
19361935 if (renderable) {
19371936 renderable->addMaterial(material, parentMaterialName);
19381937 }
19391938
1940− // even if we don't find it, try to find the entity
1941− auto entity = getEntities()->getEntity(entityID);
1942− if (entity) {
1943− entity->addMaterial(material, parentMaterialName);
1944− return true;
1945− }
19461939 return false;
19471940 });
1948− EntityTree::setRemoveMaterialFromEntityOperator([this](const QUuid& entityID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
1941+ EntityTreeRenderer::setRemoveMaterialFromEntityOperator([this](const QUuid& entityID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
19491942 if (_aboutToQuit) {
19501943 return false;
19511944 }
19521945
1953− // try to find the renderable
19541946 auto renderable = getEntities()->renderableForEntityId(entityID);
19551947 if (renderable) {
19561948 renderable->removeMaterial(material, parentMaterialName);
19571949 }
19581950
1959− // even if we don't find it, try to find the entity
1960− auto entity = getEntities()->getEntity(entityID);
1961− if (entity) {
1962− entity->removeMaterial(material, parentMaterialName);
1963− return true;
1964− }
19651951 return false;
19661952 });
19671953
1968− EntityTree::setAddMaterialToAvatarOperator([](const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
1954+ EntityTreeRenderer::setAddMaterialToAvatarOperator([](const QUuid& avatarID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
19691955 auto avatarManager = DependencyManager::get<AvatarManager>();
19701956 auto avatar = avatarManager->getAvatarBySessionID(avatarID);
19711957 if (avatar) {
@@ -1974,7 +1960,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 2 unmodified lines
19741960 }
19751961 return false;
19761962 });
1977− EntityTree::setRemoveMaterialFromAvatarOperator([](const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
1963+ EntityTreeRenderer::setRemoveMaterialFromAvatarOperator([](const QUuid& avatarID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
19781964 auto avatarManager = DependencyManager::get<AvatarManager>();
19791965 auto avatar = avatarManager->getAvatarBySessionID(avatarID);
19801966 if (avatar) {
@@ -1984,23 +1970,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 3 unmodified lines
19841970 return false;
19851971 });
19861972
1987− EntityTree::setAddMaterialToOverlayOperator([this](const QUuid& overlayID, graphics::MaterialLayer material, const std::string& parentMaterialName) {
1988− auto overlay = _overlays.getOverlay(overlayID);
1989− if (overlay) {
1990− overlay->addMaterial(material, parentMaterialName);
1991− return true;
1992− }
1993− return false;
1994− });
1995− EntityTree::setRemoveMaterialFromOverlayOperator([this](const QUuid& overlayID, graphics::MaterialPointer material, const std::string& parentMaterialName) {
1996− auto overlay = _overlays.getOverlay(overlayID);
1997− if (overlay) {
1998− overlay->removeMaterial(material, parentMaterialName);
1999− return true;
2000− }
2001− return false;
2002− });
2003−
20041973 // Keyboard focus handling for Web overlays.
20051974 auto overlays = &(qApp->getOverlays());
20061975 connect(overlays, &Overlays::overlayDeleted, [this](const OverlayID& overlayID) {