Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

polyLayoutUV([caching=boolean], [constructionHistory=boolean], [flipReversed=boolean], [layout=int], [layoutMethod=int], [name=string], [nodeState=int], [percentageSpace=float], [rotateForBestFit=boolean], [scale=int], [separate=int], [uvSetName=string], [worldSpace=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

polyLayoutUV is undoable, queryable, and editable.

Move UVs in the texture plane to avoid overlaps.

Return value

stringThe node name.

In query mode, return type is based on queried flag.

Flags

caching, constructionHistory, flipReversed, layout, layoutMethod, name, nodeState, percentageSpace, rotateForBestFit, scale, separate, uvSetName, worldSpace
Long name (short name) Argument types Properties
flipReversed(fr) boolean createqueryedit
If this flag is turned on, the reversed UV pieces are fliped.
layout(l) int createqueryedit
How to move the UV pieces, after cuts are applied:
0 No move is applied.
1 Layout the pieces along the U axis.
2 Layout the pieces in a square shape.
percentageSpace(ps) float createqueryedit
When layout is set to square, this value is a percentage of the texture area which is added around each UV piece. It can be used to ensure each UV piece uses different pixels in the texture.
Maximum value is 5 percent.
scale(sc) int createqueryedit
How to scale the pieces, after move and cuts:
0 No scale is applied.
1 Uniform scale to fit in unit square.
2 Non proportional scale to fit in unit square.
separate(se) int createqueryedit
Which UV edges should be cut:
0 No cuts.
1 Cut only along folds.
2 Make all necessary cuts to avoid all intersections.
rotateForBestFit(rbf) boolean createqueryedit
If true, rotate horizontal UV pieces by 90 degrees, so that all pieces are vertical.
layoutMethod(lm) int createqueryedit
Which layout method to use:
0 Block Stacking.
1 Shape Stacking.
uvSetName(uvs) string createquery
Specifies the name of the uv set to edit uvs on. If not specified will use the current uv set if it exists.
worldSpace(ws) boolean createqueryedit
If true, performs the operation in world space coordinates as opposed to local space.
Common flags
name(n) string create
Give a name to the resulting node.
constructionHistory(ch) boolean createquery
Turn the construction history on or off (where applicable). If construction history is on then the corresponding node will be inserted into the history chain for the mesh. If construction history is off then the operation will be performed directly on the object.
Note: If the object already has construction history then this flag is ignored and the node will always be inserted into the history chain.
caching(cch) boolean createedit
Toggle caching for all attributes so that no recomputation is needed
nodeState(nds) int
Defines how to evaluate the node.
  • 0: Normal
  • 1: PassThrough
  • 2: Blocking
  • 3: Internally disabled. Will return to Normal state when enabled
  • 4: Internally disabled. Will return to PassThrough state when enabled
  • 5: Internally disabled. Will return to Blocking state when enabled

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Create a sphere.
cmds.polySphere( n='sph' )

# Use a plane projection on half the faces
cmds.select( 'sph.f[0:200]' )
cmds.polyProjection( type='Planar' )

# Layout all UVs in the texture plane.
cmds.polyLayoutUV( 'sph.f[*]', l=2, fr=True, se=2, sc=1 )