Easiest way to query full path for a file texture? (ie, file.fileTextureName)

213 views
Skip to first unread message

Paul Molodowitch

unread,
Apr 4, 2019, 9:14:20 PM4/4/19
to python_inside_maya
Ie, if file.fileTextureName contains a relative path, how do I get the full path that maya will resolve that to?

If it's using udims, I think you can use computedFileTextureNamePattern instead... but if not, the best solution I can come up with is to:

1) query cmds.workspace(q=1, rootDirectory=1)
2) append cmds.workspace(fileRuleEntry="sourceImages")
3) append your relative file.fileTextureName

For some reason, I thought there was a single command that would do this (or something similar).  Am I misremembering? Alternatively, does anyone know if the fileRuleEntry is always "sourceImages"? Does it every check "just" the workspace rootDirectory? If so, which takes precedence?

Thanks!

 - Paul

Paul Molodowitch

unread,
Apr 5, 2019, 12:45:30 PM4/5/19
to python_inside_maya
In case anyone else ever finds this post - the method I was looking for is:

MRenderUtil::exactFileTextureName







Reply all
Reply to author
Forward
0 new messages