Well I went down the rabbit hole trying to make this work and I don't think it can be done with the current implementation, seems like the MPxFileResolver class is pretty old and hasn't been updated with the UDIM implementation.
I'm going to leave a summary of what I think that is happening, let's hope someone at Autodesk corrects me if I'm wrong:
Case: A file node where we are setting a URI path that we want to resolve via FileResolver with the file node uvTilingMode set to UDIM (Mari)
- First, the File Resolver get's called, and the resolveURI method receives the path, and the mode. This is important because the file node is a Input node, so the method will receive kInput as mode, and will check the return for existance, and here comes the issue.
- If you return a path with the <UDIM> token, the file node will raise an error since that path indeed does not exist, and the resolver will return an empty string because if flags the result as kFailure.
- If on the other hand you return the first found UDIM, e.g. 1001, the resolving will be succesfull BUT, a callback either from the file node or the AETemplate (not sure which one) will attempt to override the path with the <UDIM> token according to maya.app.general.fileTexturePathResolver. However, instead of doing this with the resolved filepath, it seems like it's doing it with the URI path, which does not work either.
One funny thing I found with this is that if you create another file node, and set the resolved path, the texture you had with the UDIM will suddenly find the udim textures, but it will also replace the path in the attribute to the resolved one instead of keeping the URI.
@qvisten The workaround I've found that seems to be working and I think we will be using, is creating a custom node just for the resolver and connecting the output to the fileTextureName attribute in the file node. If you pass the path with <UDIM> it does work as expected.