Resolve UDIM Pattern bug

Resolve UDIM Pattern bug

victorcm7
Explorer Explorer
69 Views
0 Replies
Message 1 of 1

Resolve UDIM Pattern bug

victorcm7
Explorer
Explorer

Hi! This is a bit of an edge case but when having a texture with a name that has 4 digits starting with 1 it will get replaced with the <UDIM> token and hence not be resolved when trying to use udim tiles.

I know maya uses maya.app.general.fileTexturePathResolver.getFilePatternString internally to resolve the passed filepath, but in case I already handled that token conversion it should recognize it and not try to replace it.

Also the UDIM tiles always go between dots, it looks like the regex pattern isn't recognizing it.

Eg: 

 

maya.app.general.fileTexturePathResolver.getFilePatternString('L:/test_1001.<UDIM>.jpg', False, 3)
# Result: 'L:/test_<UDIM>.<UDIM>.jpg'

 

I've checked this in both maya 2024.2 and 2026.1, it can be solved by scaping the dot in the regex string to 

_udimRegex = re.compile(".*[^\d]\.(1(?:[0-9][0-9][1-9]|[1-9][1-9]0|0[1-9]0|[1-9]00))(?:[^\d].*|$)")
0 Likes
70 Views
0 Replies
Replies (0)