Showing the changes to libraries/render-utils/src/Model.cpp (1 of 2 files). Show all
Unified · Split
| @@ -74,6 +74,21 @@ Model::~Model() { · 73 unmodified lines | |||
| 74 | 74 | ||
| 75 | AbstractViewStateInterface* Model::_viewState = NULL; | 75 | AbstractViewStateInterface* Model::_viewState = NULL; |
| 76 | 76 | ||
| 77 | bool Model::needsFixupInScene() { | ||
| 78 | if (readyToAddToScene()) { | ||
| 79 | // Once textures are loaded, fixup if they are now transparent | ||
| 80 | if (!_needsReload && _needsUpdateTransparentTextures && _geometry->isLoadedWithTextures()) { | ||
| 81 | _needsUpdateTransparentTextures = false; | ||
| 82 | if (_hasTransparentTextures != _geometry->hasTransparentTextures()) { | ||
| 83 | return true; | ||
| 84 | } | ||
| 85 | } | ||
| 86 | if (!_readyWhenAdded) { | ||
| 87 | return true; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | return false; | ||
| 91 | } | ||
| 77 | 92 | ||
| 78 | void Model::setTranslation(const glm::vec3& translation) { | 93 | void Model::setTranslation(const glm::vec3& translation) { |
| 79 | _translation = translation; | 94 | _translation = translation; |
| @@ -728,6 +743,8 @@ void Model::setURL(const QUrl& url) { · 648 unmodified lines | |||
| 728 | } | 743 | } |
| 729 | 744 | ||
| 730 | _needsReload = true; | 745 | _needsReload = true; |
| 746 | _needsUpdateTransparentTextures = true; | ||
| 747 | _hasTransparentTextures = false; | ||
| 731 | _meshGroupsKnown = false; | 748 | _meshGroupsKnown = false; |
| 732 | invalidCalculatedMeshBoxes(); | 749 | invalidCalculatedMeshBoxes(); |
| 733 | deleteGeometry(); | 750 | deleteGeometry(); |