Texture fullpath

Hi all,

I am trying to get the full path in this way material.m_textures[ti].m_image_file_reference.FullPath().
The problem is that if I copy paste the project in another folder the path does not update and I get the previous one.
Is there a way to get the correct one?
Thanks

G.

As long as the original file exists you’ll get that path.

We have find this solution

ON_wString found_file_full_path;
ON_FileReference::FindFilePreference res = material.m_textures[ti].m_image_file_reference.FindFile((LPCWSTR) ::RhinoApp().ActiveDoc()->GetPathName(), true, found_file_full_path);

HI @gennaro ,
i am trying to modify my texture to any picture and fails ,then i see your question and solution.
May i ask for what’s your “ti” means for ?
Are you Set a Texture table already then put your picture inside. Then add it into ‘ON_material’ ?
I write like this

decal_textire.m_image_file_reference.FindFileAndUpdateReference(L"D:\A.bmp",true,true);
…(other information)…
material.AddTexture(decal_textire);

but i always just got a black ground.

I’ve replied to your prior post…

This is the full snippet

int ti = material.FindTexture(0, ON_Texture::TYPE::bitmap_texture);
if (ti >= 0){
    ON_wString found_file_full_path;
    ON_FileReference::FindFilePreference res =  material.m_textures[ti].m_image_file_reference.FindFile((LPCWSTR) ::RhinoApp().ActiveDoc()->GetPathName(), true, found_file_full_path);
}

@dale and @gennaro Thanks very much. that’s very helpful !!