-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
unsigned _matIdx, | ||
const std::string& _path) const; | ||
const std::string &_path, | ||
const std::string &_fileBaseName) const; |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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?
There was a problem hiding this 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("."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <cstddef>
and <string>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added. 163222b
Signed-off-by: Ian Chen <[email protected]>
🦟 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
codecheck
passed (See contributing)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.