MEL Command Reference

The plugin comes with a MEL command that is used to create and edit the seUVBlendShape deformer. This command is immediately available after loading the seUVBlendShape plugin in Maya.

Also included is a Python module that provides more tools and higher level features that extend this MEL command.

The command name for the plugin is the same as the deformer name, seUVBlendShape. Calling the command with no flags or arguments will use the current selection to create a new deformer with the last mesh selected being the base geometry, receiving the deformation.

This MEL command can also be called using Python in the same style as Maya’s builtin commands. For example:

from maya import cmds
cmds.seUVBlendShape('targetA', 'baseMesh', name='myDeformer')

However it is best to use the included Python module instead of using this method.

Note

Undo operations are limited to only creating a new deformer node. It is not currently supported to undo any editing (adding, removing, rebinding, etc) operations.

Command flags

-edit, -e

Set the command in edit mode. This is used to let the command know you want to edit the deformer based on the other flags provided. You must select or pass the name of the seUVBlendShape deformer as the last argument.

-query, -q

Set the command in query mode. This is used to let the command know you want to request based on the other flags provided. You must select or pass the name of the seUVBlendShape deformer as the last argument.

-name <string>, -n <string>

When creating a deformer, it will set the name to the one provided. Not available in edit or query modes.

-addTarget <string>, -add <string>

Add the given mesh as a new target on an existing seUVBlendShape deformer. Only available with -edit flag.

-removeTarget, -rm

Remove a target from the deformer. This flag is used in combination with the -index flag. Only available with -edit flag.

-index <int>, -i <int>

Used in combination with -edit and -query flags for specific targets. The index is the weight plug array index on the deformer.

-rebind, -rb

This is used to rebind a target on the deformer. If the -index flag is provided, it will only rebind that target index. If no index flag is used, all targets will be rebound. Only available with -edit flag.

-keepOffset, -ko

When creating a new deformer, set the keepOffset attribute to 1.0. Though you can set this yourself on the deformer at any time, this is just a convenience. Not available in edit or query modes.

-tolerance <float>, -tol <float>

Set the search distance in UV space used during binding base UVs that are outside the borders of the target UVs. Setting the tolerance to zero will result only in base UVs being on the border or inside a target UV face being bound. Default is 0.01. Only available when creating a new deformer, rebinding, or adding a new target.

-baseUVSet <string>, -bs <string>

The name of the UV set to use on the base mesh for binding to the target UV set. If this flag is not provided, the first set found on the base mesh is used. If used in combination with the -index and -query flag, returns the name of the UV set.

-targetUVSet <string>, -ts <string>

The name of the target UV set to use for binding the base UV set. It is also used during deformation. If this flag is not provided, the first set found on the target mesh is used. If used in combination with the -index and -query flag, returns the name of the UV set.

-boundVertices, -bv

Returns a list of vertices on the base mesh that is bound by the deformer. You must use this in combination with the -index flag since each target may have different vertices bound to it. Only available with -query flag.

-targetCount, -tc

Returns the number of targets on the deformer. Only available with -query flag.

-targetIndexes, -ti

Returns a list of integers of the target indexes on the deformer. Only available with -query flag.

Examples

// create a seUVBlendShape deformer using selection. The last item is the base mesh.
select targetMesh;
select -add baseMesh;
seUVBlendShape;
// Result: seUVBlendShape1

// create a seUVBlendShape with a specific name and UV sets
seUVBlendShape -n "myUVBlend" -tuvs "commonUV" -buvs "commonUV" "targetMesh" "baseMesh";
// Result: myUVBlend

// add a new target
seUVBlendShape -e -addTarget "secondTargetMesh" "myUVBlend";

// get the number of targets
seUVBlendShape -q -targetCount "myUVBlend";
# Result: 2

// get the target indexes
seUVBlendShape -q -targetIndexes "myUVBlend";
# Result: {0,1}

// remove the first target (index 0)
seUVBlendShape -e -removeTarget -index 0 "myUVBlend";