Relative paths not working for some assets

   438   1   1
User Avatar
Member
129 posts
Joined: 8月 2017
オフライン
Hey I'm trying to export a flattened stage file with materials that have texture files linked to them.

In the source HIP file those textures appear as relative paths.

I export a USD file with Use Relative Paths.

I import this USD file into a new HIP file.

Some assets have relative paths @../../../myfile.png@

Some have absolute paths baked in @V:/_library/tree.png@. The assets that used to be relative now are absolute.

I can't figure out why. They're all on the same drive (deeply nested far from each other).
User Avatar
スタッフ
4589 posts
Joined: 7月 2005
オフライン
When doing the conversion to relative paths, if you have to ".." your way all the way to the root of the drive before diving back down again, we throw away all the ".."s and just put in an absolute path. The "relativeness" of these paths is basically useless at this point and just makes it hard to see how to get from one file to another. That was the thinking anyway. Perhaps that's what is going on here?

If this is the problem, and you don't like this behavior, the "relativepaths" output processor is very easy to change so that it generates relative paths even in this case. Just change the `allow_relative_path_from_root` parameter from False to True in the call to `relpath`.
  • Quick Links