Go to: Synopsis. Return value. Related. Flags. Python examples.
polyContourProjection([caching=boolean], [constructionHistory=boolean], [createNewMap=boolean], [flipRails=boolean], [insertBeforeDeformers=boolean], [method=int], [name=string], [nodeState=int], [offset0=linear], [offset1=linear], [offset2=linear], [offset3=linear], [reduceShear=float], [smoothness0=float], [smoothness1=float], [smoothness2=float], [smoothness3=float], [userDefinedCorners=boolean], [worldSpace=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
polyContourProjection is undoable, queryable, and editable.
Performs a contour stretch UV projection onto an object.
In query mode, return type is based on queried flag.
polyClipboard, polyCylindricalProjection, polyEditUV, polyForceUV, polyMapCut, polyMapDel, polyMapSew, polyMoveFacetUV, polyMoveUV, polyPlanarProjection, polyProjection, polySphericalProjection, polyUVSet, untangleUV
caching, constructionHistory, createNewMap, flipRails, insertBeforeDeformers, method, name, nodeState, offset0, offset1, offset2, offset3, reduceShear, smoothness0, smoothness1, smoothness2, smoothness3, userDefinedCorners, worldSpace
Long name (short name) |
Argument types |
Properties |
|
createNewMap(cm)
|
boolean
|
|
|
This flag when set true will create a new map with
the name passed in, if the map does not already exist.
|
|
flipRails(fr)
|
boolean
|
|
|
If true, flip which curves are the rails of the birail surface.
|
|
insertBeforeDeformers(ibd)
|
boolean
|
|
|
This flag specifies if the projection node should be inserted before
or after deformer nodes already applied to the shape. Inserting the
projection after the deformer leads to texture swimming during
animation and is most often undesirable.
C: Default is on.
|
|
method(m)
|
int
|
|
|
Sets which projection method to use. Valid values are
0: Walk Contours
1: NURBS Projection
|
|
offset0(o0)
|
linear
|
|
|
Sets the offset on edge 0 of the NURBS surface.
|
|
offset1(o1)
|
linear
|
|
|
Sets the offset on edge 1 of the NURBS surface.
|
|
offset2(o2)
|
linear
|
|
|
Sets the offset on edge 2 of the NURBS surface.
|
|
offset3(o3)
|
linear
|
|
|
Sets the offset on edge 3 of the NURBS surface.
|
|
reduceShear(rs)
|
float
|
|
|
Sets the 'reduce shear' parameter of the projection.
|
|
smoothness0(s0)
|
float
|
|
|
Sets the smoothness of edge 0 of the NURBS surface.
|
|
smoothness1(s1)
|
float
|
|
|
Sets the smoothness of edge 1 of the NURBS surface.
|
|
smoothness2(s2)
|
float
|
|
|
Sets the smoothness of edge 2 of the NURBS surface.
|
|
smoothness3(s3)
|
float
|
|
|
Sets the smoothness of edge 3 of the NURBS surface.
|
|
userDefinedCorners(udc)
|
boolean
|
|
|
If true, the four vertices specified by user will be taken as corners to do the projection.
|
|
worldSpace(ws)
|
boolean
|
|
|
This flag specifies which reference to use.
If on : all geometrical values are taken in world reference.
If off : all geometrical values are taken in object reference.
C: Default is off.
Q: When queried, this flag returns an int.
|
|
Common flags |
caching(cch)
|
boolean
|
|
|
Toggle caching for all attributes so that no recomputation is needed.
|
|
constructionHistory(ch)
|
boolean
|
|
|
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.
|
|
name(n)
|
string
|
|
|
Give a name to the resulting node.
|
|
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.
|
import maya.cmds as cmds
# Create a plane.
cmds.polyPlane( n='plane', sx=10, sy=10 )
# Deform the plane and planar project UVs onto it.
cmds.softMod( 'plane', falloffRadius=1 )
cmds.move( 0, 0, -0.5, r=True, os=True, wd=True )
cmds.select( 'plane', r=True )
cmds.delete( 'plane', ch=True )
cmds.polyProjection( 'plane.f[0:99]', ch=1, type='Planar', ibd=0, md='y' )
# Create a lambert node.
cmds.shadingNode( 'lambert', n='myLambert', asShader=True )
cmds.sets( renderable=True, noSurfaceShader=True, empty=True, name='myLambertSG' )
cmds.connectAttr( 'myLambert.outColor', 'myLambertSG.surfaceShader', f=True )
# Create a texture checker.
cmds.shadingNode( 'checker', asTexture=True )
cmds.shadingNode( 'place2dTexture', asUtility=True )
cmds.connectAttr( 'place2dTexture1.outUV', 'checker1.uv' )
cmds.setAttr( 'place2dTexture1.repeatU', 4 )
cmds.setAttr( 'place2dTexture1.repeatV', 4 )
# Assign the texture the the lambert node.
cmds.connectAttr( 'checker1.outColor', 'myLambert.color', f=True )
# Set the textured display mode.
currentPanel = cmds.getPanel(withFocus= True)
if currentPanel != '':
cmds.modelEditor(currentPanel, edit=True, da='smoothShaded', displayTextures=True, dl='default')
# Assign the lambert shader to the plane.
cmds.sets('plane', edit=True, forceElement= 'myLambertSG' )
# Use the contour stretch projection to assign 'rectangular' UVs to a strip of faces
cmds.polyContourProjection( 'plane.f[30:69]', ch=1, m=0 )