I am trying to call the "Unfold" command from within a script and running into some un-expected difficulties.
It appears that directly passing in UV components to the command isn't the same as updating the selection list with the UV components.
It looks to me like the Unfold Command re-calls itself for each component in the list of UV Coordinates passed in, instead of operating on the entire list of components once.
for example, these two lines of code give different results:
import maya.cmds as cmds
uvCoords = ['surfaceShape.map[*]'
cmds.unfold(uvCoords)
uvCoords = ['mesh.map[0]', 'mesh.map[1]', 'mesh.map[2]']
cmds.unfold(uvCoords) # it looks like the unfold is called once per item in the list.
another example:
cmds.select(['mesh.map[0]', mesh.map[5:8], mesh.map[20], replace=True)
cmds.unfold()
uvCoords = cmds.ls(sl=True)
cmds.unfold(uvCoords) # this looks like it calls the unfold command once per item in the list
In both cases, direct selection does what I want and passing in the uv coordinates directly gives me strange results, especially when setting the PinSelected flag.
Anyone have experience using the Unfold Command and can shed some light on hwo to properly use it within a Scripting environment? For the time being, I am just updating the Selection inside my Loop (which I know is not a good habit to get into...)