pymel.core.modeling.polyForceUV¶
- polyForceUV(*args, **kwargs)¶
A set of functionalities can be called through this command. The input for this command is a set of faces. Based on the arguments passed, the UVs for these selected faces can be created. Project UVs based on the camera:(UV creation) Based on the current view direction/orientation, the UVs are generated and assigned to the faces. Any previously assigned UV information will be lost. Best Plane Projection:(UV creation) The UVs are computed based on the plane defined by the user, and is applied to the selected faces. This tool has 2 phases. In the first phase, the faces to be mapped (faces to which UVs are to be created) are selected. In the second phase, the points (vertices, CVs) that define the projecting plane are selected. Any previously assigned UV information will be lost. Unitize:(UV creation) A new set of unitized UVs are generated and assigned to the faces. Any previously assigned UV information will be lost. Unshare:(UV creation) Force the specified UV to be unshared by possibly creating new UVs. Any previously assigned UV information will be lost.
Flags:
Long Name / Short Name Argument Types Properties cameraProjection / cp bool Project the UVs based on the camera position/orientation createNewMap / cm bool Create new map if it does not exist. flipHorizontal / fh bool OBSOLETE flag. Use polyFlipUV instead. flipVertical / fv bool OBSOLETE flag. Use polyFlipUV instead. g / g bool OBSOLETE flag. local / l bool OBSOLETE flag. normalize / nor unicode OBSOLETE flag. Use polyNormalizeUV instead. numItems / ni int This flag is only used for the best plane texturingof polygonal faces. This flag should be followed by a selection list. If not specified, the selected objects will be used (in the order they were selected). This flag specifies the number of items (leading) in the selection list that should be used for the mapping. The trailing items will be used for computing the plane (See example below). The best plane texturingis better suited for using interactively from within its context. You can type setToolTo polyBestPlaneTexturingContextin the command window OR (EditPolygons-Texture- BestPlaneTexturing from the Menu) to enter its context. preserveAspectRatio / par bool OBSOLETE flag. unitize / uni bool To unitize the UVs of the selected faces unshare / u bool To unshare tye specified UV uvSetName / uvs unicode Specifies name of the uv set to work on Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.polyForceUV
Example:
import pymel.core as pm pm.polyForceUV( uni=True ) # unitize the UV values of the selected faces separately pm.polyForceUV( cp=True ) # create UVs on the selected faces based on the current camera pm.polyForceUV( 'pCylinder1.f[11:14]', 'pCylinder1.vtx[33:34]', 'pCylinder1.vtx[13:14]', ni=1 ) # create the UVs for the first item (ie, 4 polygonal faces, in this case) # in the selection list, by computing the plane using the rest of the # items in the list