gazebosim / gz-common

An audio-visual library supports processing audio and video files, a graphics library can load a variety 3D mesh file formats into a generic in-memory representation, and the core library of Gazebo Common contains functionality that spans Base64 encoding/decoding to thread pools.
https://gazebosim.org
Apache License 2.0
15 stars 39 forks source link

Use scene name for material name #564

Closed luca-della-vedova closed 11 months ago

luca-della-vedova commented 11 months ago

🦟 Bug fix

Summary

https://github.com/gazebosim/gz-common/pull/563 rebased to main.

When importing assimp scenes, the name of the generated texture used the name of the root node as a prefix. This worked well in simple GLB assets where there is only one node and the name would be its name but the moment a user was to import a scene with more than one node assimp would automatically create a new node and hardcode its name to ROOT as shown here.

This creates issues when running gz with ogre2 since we use the texture name to share textures between different assets, so different files would result in textures called ROOT_[...] and would cause the wrong texture to be displayed.

The fix is to use the scene name instead of the root node name (which was probably the right implementation in the first place).

Checklist

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.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8816a65) 83.64% compared to head (4e5bba5) 83.64%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #564 +/- ## ======================================= Coverage 83.64% 83.64% ======================================= Files 79 79 Lines 10214 10214 ======================================= Hits 8543 8543 Misses 1671 1671 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.