UDIM tag doesn't work with file paths set to Relative!

Hello,

Using latest VRay 6 here, I have a project with UDIM textures and I’m using the <UDIM> tag in a ‘VRayBitmap’ and every thing is working fine except for one thing…

I have all my projects and Max it self in the settings set to “Convert local file paths to Relative” so all my textures are in the format of “sceneassets\images\etc…” and that doesn’t work with the <UDIM> tag!

What happens is that at the first time I load the texture in to the VRayBitmap and edit the name with the <UDIM> tag, the full path is used (i.e: "C:\Project_001\sceneassets\images\etc…"and the textures are working fine, and that remains the case as long as the file is opened… Once I save and close the Max file and then reopen it, all the local paths are converted automatically to ‘Relative’ (It Becomes: “sceneassets\images\etc…”) which is exactly how I want them to be so I can move the project folder freely, the problem is that this breaks all the <UDIM> tagged textures and I have to manually go to each one of them and insert the full path for it to work, or just disable the ‘Relative’ feature completely and have the full path used all the time (which is not the way I want to handle my project folders actually…).

Is there a work around to get this to work properly with ‘Relative’ paths? or a potential fix?

Thanks for your help in advance, keep up the great work guys.
Best regards.

Just tested this and it seems to work as expected on my end even if I restart 3ds Max. Could you double-check your paths? If the issue persists, do send the project (simplified) so we can take a look.

Hello, thanks for your reply,

If by “work as expected” you mean that the textures appear loaded fine in the Slate Material Editor or the Compact Material Editor then that is deceiving… Cause if you just press render the object will render textureless, and if you right-click the VRayBitmap node and click ‘Update Preview’ it will turn black.

My guess is that this is some sort of caching that makes the VRayBitmap load with the texture appearing in the thumbnail preview, while in truth it is actually broken and won’t appear in render.

Either way I simplified the file as possible and ready to send it if needed!, it is a 350MB ZIP file due to the textures size, I’m using 3Ds Max 2022, let me know if I should upload it still.

Thanks for your help.

As I said, it renders fine on my end. Preview too.

Yes, please. Send the scene through the contact form I linked.

File uploaded…

And I tested again twice to be sure, every time I close 3Ds Max and reopen it, the moment I press render the object render texturelss!, and I have to insert the full path again!, could be a setting missing somewhere!

Thanks for you help.

Thanks for the provided scene. Quite odd. The textures I tested with are working fine even when they are in the same folder as yours. I’ll continue debugging and write back with more information.

Thanks for your effort and time. That’s odd indeed!, though, after all these years in 3D field I tend to expect the unexpected from the software, all good.

My guess would be that it’s some sort of information stored in your texture file from how it was created that is missing from mine!, try recreating your textures in Photoshop through copy/pasting the texture in a new document and save it with desired format, so it would be a fresh file with no stored info, and test with it, see if the UDIM tag still works with it or will it break?.

We had something similar with a Maya project. But never found out what was the reason. I hope you find the cause.

After a conversation with the developers, it turns out UDIM tags cannot be found if the file paths are relative to the project folder. There is a workaround - setting the texture files to be relative to the scene file. You can do that by applying a “..” in front of the regular relative path (sceneassets\Images → ..\sceneassets\Images). I wrote a little script that does that automatically for all textures that match the keyword “sceneassets” (run it once, otherwise it will apply the symbols multiple times):

EDIT: updated script in next post.

I tried to run the scrip but I got an error in Line number: 3 “Call needs function or class,”, however, I manually added the “..” to the path (..\sceneassets\images\etc…) and now it works perfectly, even after closing 3Ds Max and reopening it, the files load just fine.

So, if the trick is to just add the <UDIM> tag and “..” then that would be fine by me, and I can call it a job excellently done here. :slight_smile:

Thanks a lot for your help, it is much appreciated, and keep up the great work guys.

Best Regards.

Glad it worked. Just so you know, I’ve logged the issue (internal bug-tracker id: VMAX-12863) for developer investigation. I’ve updated the script with a UI to ease the process until the issue is fixed.
VBPA.7z (690 Bytes)

Just tested the new script with UI and it is working perfectly. For any one wondering how to use that script, here is how I use it: in ‘Prefix’ I typed " ..\ " (without the double quotes) and in the ‘Only for paths containing’ I typed “sceneassets\images\*<UDIM>*” (again, without the double quotes), this made sure that only the textures with the <UDIM> tag are the ones changed to have the " ..\ " at the start of the path so they would work fine for projects with local files set to relative to the project folder…

It’s simple and brilliant, I’m loving it, thanks.