<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the full texture path using python? in VRED Forum</title>
    <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9555144#M4148</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have you tried this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from os.path import abspath&lt;/P&gt;&lt;P&gt;filename = abspath('../../mypath/myfile.txt')&lt;/P&gt;&lt;P&gt;print(filename)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;every ../ should be a folder a step up from the current vpb file location&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2020 15:40:21 GMT</pubDate>
    <dc:creator>Christian_Garimberti</dc:creator>
    <dc:date>2020-06-02T15:40:21Z</dc:date>
    <item>
      <title>How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9554518#M4147</link>
      <description>&lt;P&gt;If I select a material in the material editor and look for the path to one of it's texture I see a relative path like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;../../../../path/to/texture/subfolder/texture_bump.png&lt;/LI-CODE&gt;&lt;P&gt;I tried to access the path using this script&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mat = findMaterial("myMaterial")
image = vrFieldAccess(mat.fields().getFieldContainer("bumpMap"))
print image.getString("name")&lt;/LI-CODE&gt;&lt;P&gt;but it generates the same output.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;../../../../path/to/texture/subfolder/texture_bump.png&lt;/LI-CODE&gt;&lt;P&gt;How do I get the full path? Even if it is a network path? Something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;N:\path/to/texture/subfolder/texture_bump.png&lt;/LI-CODE&gt;&lt;P&gt;or this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;\\netdrv/path/to/texture/subfolder/texture_bump.png&lt;/LI-CODE&gt;&lt;P&gt;I know that VRED sees the full path because the textures are rendering properly in the viewport.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 11:04:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9554518#M4147</guid>
      <dc:creator>kristoffer.helander</dc:creator>
      <dc:date>2020-06-02T11:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9555144#M4148</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have you tried this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from os.path import abspath&lt;/P&gt;&lt;P&gt;filename = abspath('../../mypath/myfile.txt')&lt;/P&gt;&lt;P&gt;print(filename)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;every ../ should be a folder a step up from the current vpb file location&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 15:40:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9555144#M4148</guid>
      <dc:creator>Christian_Garimberti</dc:creator>
      <dc:date>2020-06-02T15:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556768#M4149</link>
      <description>&lt;P&gt;While I don´t know how this path was created just note that VRED doesn´t care about the path by default since all textures are inlined. So unless you have explicitly turned the inlining of textures off in the preferences before saving the file VRED will render correctly even if you delete the texture file on disk.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 06:51:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556768#M4149</guid>
      <dc:creator>michael_nikelsky</dc:creator>
      <dc:date>2020-06-03T06:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556788#M4150</link>
      <description>&lt;P&gt;Do you mean that the textures are stored inside the .vpb-file? That would explain some of the confusion I've been experiencing that some texture does not show up in the folders that are specified in the material editor after I've copied the .vpb-file to anther directory, yet it was still rendering properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for pointing that out!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:13:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556788#M4150</guid>
      <dc:creator>kristoffer.helander</dc:creator>
      <dc:date>2020-06-03T07:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556795#M4151</link>
      <description>&lt;P&gt;Keeping in mind the above considerations, note that the functions i wrote can returns a path that not exists.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:17:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556795#M4151</guid>
      <dc:creator>Christian_Garimberti</dc:creator>
      <dc:date>2020-06-03T07:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556821#M4152</link>
      <description>&lt;P&gt;Yes, by default the textures are always embedded in the vpb so you can easily take the vpb with you and don´t need to care about textures. What is not embedded are HTML files if you use them and image sequences if you have not set the inline sequence option in the material.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556821#M4152</guid>
      <dc:creator>michael_nikelsky</dc:creator>
      <dc:date>2020-06-03T07:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the full texture path using python?</title>
      <link>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556855#M4153</link>
      <description>&lt;P&gt;Thank you for that code it does the job! But as has been pointed out to me, the textures are stored in the scene file so the path is not always correct, especially not if you move the scene file around. But still, you gave me a solution to my problem. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 07:38:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vred-forum/how-to-get-the-full-texture-path-using-python/m-p/9556855#M4153</guid>
      <dc:creator>kristoffer.helander</dc:creator>
      <dc:date>2020-06-03T07:38:30Z</dc:date>
    </item>
  </channel>
</rss>

