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

PBR file paths cannot be relative #286

Closed
nkoenig opened this issue Aug 12, 2020 · 4 comments
Closed

PBR file paths cannot be relative #286

nkoenig opened this issue Aug 12, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@nkoenig
Copy link
Contributor

nkoenig commented Aug 12, 2020

Material maps within an SDF file require model://. For example:

          <pbr>
            <metal>
              <albedo_map>model://UnderwaterWorld/materials/textures/Rock_Albedo.png</albedo_map>
              <normal_map>model://UnderwaterWorld/materials/textures/Rock_Normal.png</normal_map>
              <roughness_map>model://UnderwaterWorld/materials/textures/Rock_Roughness.png</roughness_map>
            </metal>
          </pbr>

It would be nice if these paths could be relative like <mesh><uri>.

@iche033
Copy link
Contributor

iche033 commented Aug 12, 2020

This is the place in code that parses these sdf params:
https://github.com/ignitionrobotics/ign-gazebo/blob/master/src/rendering/SceneManager.cc#L428

looks like common::findFile is not sufficient. I noticed that other places use asFullPath, e.g. for parsing mesh path, so may be that'll help

@nkoenig
Copy link
Contributor Author

nkoenig commented Sep 2, 2020

See #328.

@chapulina
Copy link
Contributor

Reopening this issue because the fix only affected the client, but not the server. To reproduce the remaining issue, use a world that has rendering sensors, for example:

  1. ign gazebo -v 1 -r sensors_demo.sdf
  2. Drag this model into simulation: https://app.ignitionrobotics.org/chapulina/fuel/models/Rescue%20Randy%20-%20relative%20paths
  3. The model will look good on the GUI but not for the sensors. And you'll also see these errors:
[Err] [SceneManager.cc:450] Unable to find file [materials/textures/rescue_randy_roughness.png]
[Err] [SystemPaths.cc:453] Could not resolve file [materials/textures/rescue_randy_metalness.png]
[Err] [SceneManager.cc:461] Unable to find file [materials/textures/rescue_randy_metalness.png]
[Err] [SystemPaths.cc:453] Could not resolve file [materials/textures/rescue_randy_albedo.png]
[Err] [SceneManager.cc:483] Unable to find file [materials/textures/rescue_randy_albedo.png]
[Err] [SystemPaths.cc:453] Could not resolve file [materials/textures/rescue_randy_normal.png]
[Err] [SceneManager.cc:494] Unable to find file [materials/textures/rescue_randy_normal.png]

image

@chapulina
Copy link
Contributor

Sounds like it's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants