Hi,
I'm building a ShaderData plugin, that at first just reads a TEXTURE parameter, extracts a BaseBitmap from it on InitRender() and samples it on Output(). I added it to a material's Color Texture, but the result is strange.
As I understand, the TEXTURE resource parameter is internally a STRING. When I get from the node, it contains only the file name, not the path. Then we need to use GenerateTexturePath() to find out where it is.
How can we resolve a texture that is not on the same path as the project, as the parameter does not know where it came from?
In my case, the texture IS o the same folder.
The attribute preview works, it can sample the texture.
The material's Texture shader link preview also works.
The material preview doesn't, it does not find the texture.
And objects in the scene using the material also do not get the texture.
What's missing here?
This is how I get the texture path:
sh->GetParameter( textureParamId, data, DESCFLAGS_GET_0 );
const auto textureName = data.GetString(); // This returns only the file name, not the path
auto doc = sh->GetDocument();
Filename textureFullPath;
GenerateTexturePath( doc->GetDocumentPath() + doc->GetDocumentName(), Filename( textureName ), Filename(), &textureFullPath );
Thanks,
Roger