Hey guys,
Tough one to search on the list since I'm not sure of the right way to put
it...but I was trying to setup a button that would toggle shaders to
"Generate Preview" for UDIM textures. I wasn't able to finalize exactly
what the command is that the button is running since echo all commands
returned this:
import maya.app.general.fileTexturePathResolver
maya.app.general.fileTexturePathResolver.findAllFilesForPattern(
So I wrote something around it:
import pymel.core as pm
import re
import maya.app.general.fileTexturePathResolver
udim_re = '(1[0-9]{3})'
for filenode in [file for file in pm.ls(type='file') if file.uvTilingMode.
get() == 3]:
filepath = filenode.fileTextureName.get()
tokenized_path = ''
for tile in re.findall(udim_re, filepath):
tokenized_path = filepath.replace(tile, '<UDIM>')
files = maya.app.general.fileTexturePathResolver.findAllFilesForPattern(
tokenized_path, None)
maya.app.general.fileTexturePathResolver.computeUVForFiles(files,
tokenized_path)
But then I realized this doesn't actually update the viewport at all. If
anyone has any pointers I'm all ears. Also if anyone has advice for this
situation...when you are looking to find the code executed by a button but
can't quite find the applicable code...where to turn or the best way to
google-fu it with the proper search term.
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/b75746da-03ca-4d23-a2e5-2e963606086a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.