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

Generate a more unique texture name for glb embedded textures #606

Merged
merged 5 commits into from
May 8, 2024

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented May 8, 2024

🦟 Bug fix

Summary

For glb meshes, our assimp loader generates a unique texture name for each embedded texture by prepending the 'scene' or 'root node' name of the glb mesh. However, the generated name may not always be unique. It's possible that different glb files have the same scene and root name. This PR adds the file base name of the mesh to the generated texture name string to make it more unique.

I think this change is similar to the intention in #565 where it's also trying to make texture names unique.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@iche033 iche033 requested a review from marcoag as a code owner May 8, 2024 03:16
@github-actions github-actions bot added 🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic labels May 8, 2024
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.51%. Comparing base (2d06bf7) to head (6c43c95).
Report is 23 commits behind head on gz-common5.

❗ Current head 6c43c95 differs from pull request most recent head 4b07788. Consider uploading reports for the commit 4b07788 to get more accurate results

Additional details and impacted files
@@              Coverage Diff               @@
##           gz-common5     #606      +/-   ##
==============================================
- Coverage       83.65%   80.51%   -3.15%     
==============================================
  Files              90       93       +3     
  Lines           10273    13594    +3321     
==============================================
+ Hits             8594    10945    +2351     
- Misses           1679     2649     +970     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

unsigned _matIdx,
const std::string& _path) const;
const std::string &_path,
const std::string &_fileBaseName) const;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is breaking API in gz-common5, you should target main, isn't it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this function is in the private AssimpLoader::Implementation class and not exposed in header. So should be fine?

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

just a minor change

_filename.size());
auto fileBaseName = common::basename(_filename);
std::string extension;
std::size_t extIdx = _filename.rfind(".");
Copy link
Contributor

Choose a reason for hiding this comment

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

include <cstddef> and <string>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added. 163222b

@iche033 iche033 requested a review from ahcorde May 8, 2024 20:07
@ahcorde ahcorde merged commit 27f7017 into gz-common5 May 8, 2024
13 checks passed
@ahcorde ahcorde deleted the glb_tex_name branch May 8, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants