I have referenced node, which path of the texture used is an image sequence:
path\file.< f >.iff (I put it separated so that the editor doesn't change it)
When i do getAttr
texture_path = cmds.getAttr('{}.fileTextureName'.format(file_node))
I get:
path\file.0001.iff
Which is the first image of the sequence. It is not the regular sequence, but it is an animated texture, meaning sometimes it is 0001, other times 0002... etc, depending on an animation curve attached to the image Sequence.
How do I get the generic name set for the texture with the wildcard?
If I edit that attribute, Arnold Render tells me is an invalid token. Seems like there's something else happening underneath.
EDITED:
import pymel.core as pc
obj = pc.PyNode( 'textureFileNode')
obj.fileTextureName.get()
Returns the path without the wildcard also.
Seems like there are hidden attributes not shown in the Attribute Editor. Took me a very long time to figure all this out.
Searching in the code executed to update the path when you activate "Use Image Sequence" checkbox, I found these three attributes:
Modifying fileTextureNamePattern will not change computedFileTextureNamePattern . To change it, you need to force Maya to regenerate it modifying fileTextureNamePattern first, then the attribute textureFileNode (in that order!).
Important: The files should exist in order to let Maya regenerate the third parameter. Otherwise, It will not be changed and a mix of paths will be there until you update the UI by doing some change. If you are writing a batch script, it will be all mixed!
Why is that third parameter important, why not use just the fileTextureNamePattern attribute? computedFileTextureNamePattern is used by Arnold Render, for example, to generate the ASS file. To get the pattern, the internal algorithm in maya tries to get each of them, the last, the textureFileNode. In general, if maya regenerates the third attribute, the second one is empty after that, so it's a better idea to get the generated one.