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

Synopsis

polyCollapseTweaks([hasVertexTweaks=boolean])

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

polyCollapseTweaks is undoable, queryable, and NOT editable.

A command that updates a mesh's vertex tweaks by applying its tweak data (stored on the mesh node) onto its respective vertex data.

This command is only useful in cases where no construction history is associated with the shape node.

If a mesh name is not specified as input, a singly selected mesh (if any) will have its tweaked vertices baked.

Return value

None

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

Flags

hasVertexTweaks
Long name (short name) Argument types Properties
hasVertexTweaks(hvt) boolean createquery
Determines whether an individual mesh has vertex tweaks.

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 plane.
cmds.polyPlane( sx=10, sy=10, h=20, w=20, ch=0 )

# Query the existence of vertex tweaks for pPlane1
cmds.polyCollapseTweaks ( 'pPlane1', q=True, hvt=True )
# Result: 0

# Move a vertex,
cmds.select( 'pPlane1.vtx[8]', r=True )
cmds.move( 10, 20, 30, r=True )

# Query vertex tweaks for vertex id 8
cmds.getAttr( 'pPlane1.vtx[8]' );
# Result: [(10.0, 20.0, 30.0)]

# Query the existence of vertex tweaks for pPlane1
cmds.polyCollapseTweaks ( 'pPlane1', q=True, hvt=True )
# Result: 1

# Bake all vertex tweaks into their respective vertices.
cmds.polyCollapseTweaks( 'pPlane1' )

# Query vertex tweaks for vertex id 8
cmds.getAttr( 'pPlane1.vtx[8]' );
# Result: [(0.0, 0.0, 0.0)]

# Query the existence of vertex tweaks for pPlane1
cmds.polyCollapseTweaks ( 'pPlane1', q=True, hvt=True )
# Result: 0