From 80c7f76f861f29de2ce4a84295f614c727669b95 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 23 Feb 2024 21:22:30 +0000 Subject: [PATCH 1/2] store resolve uris Signed-off-by: Ian Chen --- src/Server.cc | 4 +++- src/rendering/SceneManager.cc | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Server.cc b/src/Server.cc index 28a3d01725..ee8070020c 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -119,7 +119,9 @@ Server::Server(const ServerConfig &_config) // resources are downloaded. Blocking here causes the GUI to block with // a black screen (search for "Async resource download" in // 'src/gui_main.cc'. - errors = sdfRoot.Load(filePath); + sdf::ParserConfig parserConfig; + parserConfig.SetStoreResolvedURIs(true); + errors = sdfRoot.Load(filePath, parserConfig); if (errors.empty()) { if (sdfRoot.Model() == nullptr) { this->dataPtr->sdfRoot = std::move(sdfRoot); diff --git a/src/rendering/SceneManager.cc b/src/rendering/SceneManager.cc index 5684d4b047..39ef9cf2eb 100644 --- a/src/rendering/SceneManager.cc +++ b/src/rendering/SceneManager.cc @@ -711,9 +711,6 @@ rendering::GeometryPtr SceneManager::LoadGeometry(const sdf::Geometry &_geom, common::basename(_geom.MeshShape()->Uri()) : asFullPath(_geom.MeshShape()->Uri(), _geom.MeshShape()->FilePath()); - auto a = asFullPath(_geom.MeshShape()->Uri(), - _geom.MeshShape()->FilePath()); - descriptor.meshName = meshUri; descriptor.subMeshName = _geom.MeshShape()->Submesh(); descriptor.centerSubMesh = _geom.MeshShape()->CenterSubmesh(); From 2e74d50a093e7c64043d379634b0779e66be8765 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Fri, 1 Mar 2024 20:08:38 +0000 Subject: [PATCH 2/2] do not overwrite global config Signed-off-by: Ian Chen --- src/Server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server.cc b/src/Server.cc index ee8070020c..905f5f24b2 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -119,7 +119,7 @@ Server::Server(const ServerConfig &_config) // resources are downloaded. Blocking here causes the GUI to block with // a black screen (search for "Async resource download" in // 'src/gui_main.cc'. - sdf::ParserConfig parserConfig; + auto &parserConfig = sdf::ParserConfig::GlobalConfig(); parserConfig.SetStoreResolvedURIs(true); errors = sdfRoot.Load(filePath, parserConfig); if (errors.empty()) {