pymel.core.modeling.polyCollapseTweaks¶
- polyCollapseTweaks(*args, **kwargs)¶
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. In query mode, return type is based on queried flag.
Flags:
Long Name / Short Name Argument Types Properties hasVertexTweaks / hvt bool Determines whether an individual mesh has vertex tweaks. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.polyCollapseTweaks
Example:
- ::
import pymel.core as pm
# Create a plane. pm.polyPlane( sx=10, sy=10, h=20, w=20, ch=0 )
# Query the existence of vertex tweaks for pPlane1 pm.polyCollapseTweaks ( ‘pPlane1’, q=True, hvt=True ) # Result: 0
# Move a vertex, pm.select( ‘pPlane1.vtx[8]’, r=True ) pm.move( 10, 20, 30, r=True )
# Query vertex tweaks for vertex id 8 pm.getAttr( ‘pPlane1.vtx[8]’ ); # Result: [(10.0, 20.0, 30.0)]
# Query the existence of vertex tweaks for pPlane1 pm.polyCollapseTweaks ( ‘pPlane1’, q=True, hvt=True ) # Result: 1
# Bake all vertex tweaks into their respective vertices. pm.polyCollapseTweaks( ‘pPlane1’ )
# Query vertex tweaks for vertex id 8 pm.getAttr( ‘pPlane1.vtx[8]’ ); # Result: [(0.0, 0.0, 0.0)]
# Query the existence of vertex tweaks for pPlane1 pm.polyCollapseTweaks ( ‘pPlane1’, q=True, hvt=True ) # Result: 0