I'm in the midst of developing a plugin and part of the plugin creates custom attributes on various material nodes and allows the user to hook up file texture nodes to them. At the surface this appears to work but UV linking seems to be broken as a result. Once the file texture node is connected to my custom attribute, the relationship editor (UV-Centric UV Linking) doesn't allow me to actually select the UV set name and file node name. It highlights the file node name for a second and then unselects it. If the same file texture node is connected to one of my custom attributes *and* one of Maya's native attributes, then everything starts as expected (uv set names can be linked with file texture nodes and all is well).
Just to make sure I wasn't doing something wrong in my plugin, I've created a Lambert material and used the attribute editor to add a custom attribute (vector) and then hooked a file texture node up to it. Same exact results. I've done this all using standard Maya UI without even loading my plugin.
At first I thought this might just be a UI bug in Maya, I figured it was possible that Maya was doing the right thing it just wasn't drawing the selection highlight bars in the relationship editor... but it's more than a UI bug because it results in MFnMesh::getAssociatedUVSetTextures() always returning a zero length object array. Basically Maya doesn't know what UV set is being used with the file texture node (to be exact, Maya thinks that the UVSet isn't used with any textures). Again, when the file texture node is hooked up to both my custom attribute and a maya native attribute... then it all starts working again!
So, my questions is... what magic do I have to perform to get file texture nodes to correctly hook up to custom attributes on a material node and still get uv linking to work?
P.S. I'm using Maya 7.0