pymel.core.rendering.uvLink¶
- uvLink(*args, **kwargs)¶
This command is used to make, break and query UV linking relationships between UV sets on objects and textures that use those UV sets. If no make, break or query flag is specified and both uvSet and texture flags are present, the make flag is assumed to be specified. If no make, break or query flag is specified and only one of the uvSet and texture flags is present, the query flag is assumed to be specified. The term texturein the context of UV linking is a bit of an oversimplification. In fact, UV sets can be linked to any node which takes UV coordinates as input. However in most cases it will be a texture to which you wish to link a UV set.
Flags:
Long Name / Short Name Argument Types Properties b / b bool The presence of this flag on the command indicates that the command is being invoked to break links between UV sets and textures. isValid / iv bool This flag is used to verify whether or not a texture or UV set is valid for the purposes of UV linking. It should be used in conjunction with either the -texture flag or the -uvSet flag, but not both at the same time. make / m bool The presence of this flag on the command indicates that the command is being invoked to make links between UV sets and textures. queryObject / qo PyNode This flag should only be used in conjunction with a query of a texture. This flag is used to indicate that the results of the query should be limited to UV sets of the object specified by this flag. texture / t PyNode The argument to the texture flag specifies the texture to be used by the command in performing the action. uvSet / uvs PyNode The argument to the uvSet flag specifies the UV set to be used by the command in performing the action. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.uvLink
Example:
import pymel.core as pm pm.uvLink( uvSet='pSphereShape1.uvSet[2].uvSetName', texture='checker1' ) # causes a UV link to be created between uvSet[2] on pSphereShape1 # and the checker1 texture. # Note that no make, break or query flag is specified so make is # assumed since both uvSet and texture are specified. pm.uvLink( make=True, uvSet='pCubeShape2.uvSet[0].uvSetName', texture='file8' ) # causes a UV link to be created between uvSet[0] of pCubeShape2 and # the file8 file texture. pm.uvLink( uvSet='pCubeShape2.uvSet[0].uvSetName', texture='file8' ) # causes a UV link to be created between uvSet[0] of pCubeShape2 and # the file8 file texture. Note: no make, break or query flag is # specified so the make flag is assumed since both uvSet # and texture are specified. pm.uvLink( query=True, uvSet='pCubeShape2.uvSet[0].uvSetName' ) # will return a string array of textures which use the UV set # pCubeShape2.uvSet[0].setName. For example, the return value might # be: # file8 file9 checker4 slimeMap pm.uvLink( query=True, texture='checker4' ) # will return a string array of the UV sets that are used by the # texture. For example, the return value might be # pCubeShape2.uvSet[0].setName pCylinderShape1.uvSet[4].setName # pCylinderShape2.uvSet[3].setName pm.uvLink( texture='checker4' ) # will return a string array of the UV sets that are used by the # texture. For example, the return value might be # pCubeShape2.uvSet[0].setName pCylinderShape1.uvSet[4].setName # pCylinderShape2.uvSet[3].setName # Note that no make, break or query flag is specified, so query is # assumed since no uvSet was specified. pm.uvLink( b=True, uvSet='pCylinderShape2.uvSet[3].uvSetName', texture='checker4' ) # causes the checker4 texture to no longer use the UV set # pCylinderShape2.uvSet[3].setName. # The texture will use the default UV set on pCylinderShape2 instead. # If checker4 wasn't using pCylinderShape2.uvSet[3].setName, # nothing changes and a warning is produced. pm.uvLink( isValid=True, texture='myTexture' ) # Returns true if myTexture is a texture to which a UV set can be # linked, or false otherwise. myPlug = getSomePlugFromSomewhere() pm.uvLink( isValid=True, uvSet=myPlug ) # Returns true if $myPlug is a UV set, or false otherwise.