Without this condition the model stays in a state where the geometry is downloaded but not referenced That way, another call to setURL with update the geometry reference instead of returning.
Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1047,7 +1047,7 @@ int Model::getLastFreeJointIndex(int jointIndex) const { · 1046 unmodified lines | |||
| 1047 | 1047 | ||
| 1048 | void Model::setURL(const QUrl& url, const QUrl& fallback, bool retainCurrent, bool delayLoad) { | 1048 | void Model::setURL(const QUrl& url, const QUrl& fallback, bool retainCurrent, bool delayLoad) { |
| 1049 | // don't recreate the geometry if it's the same URL | 1049 | // don't recreate the geometry if it's the same URL |
| 1050 | if (_url == url) { | 1050 | if (_url == url && _geometry && _geometry->getURL() == url) { |
| 1051 | return; | 1051 | return; |
| 1052 | } | 1052 | } |
| 1053 | _url = url; | 1053 | _url = url; |