Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable StoreResolvedURIs when loading SDF #2323

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
auto &parserConfig = sdf::ParserConfig::GlobalConfig();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is modifying the global config. The comment on the commit says otherwise 🙃

Copy link
Contributor Author

@iche033 iche033 Mar 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah the comment is meant to say "do no overwrite the findFile callbacks in global config". The original implementation passed an empty ParserConfig so it overwrote the callbacks set earlier in the function

parserConfig.SetStoreResolvedURIs(true);
errors = sdfRoot.Load(filePath, parserConfig);
if (errors.empty()) {
if (sdfRoot.Model() == nullptr) {
this->dataPtr->sdfRoot = std::move(sdfRoot);
Expand Down
3 changes: 0 additions & 3 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading