pymel.core.nodetypes.BlendShape

Inheritance diagram of BlendShape

class BlendShape(*args, **kwargs)

class counterpart of mel function blendShape

This command creates a blendShape deformer, which blends in specified amounts of each target shape to the initial base shape. Each base shape is deformed by its own set of target shapes. Every target shape has an index that associates it with one of the shape weight values.In the create mode the first item on the selection list is treated as the base and the remaining inputs as targets. If the first item on the list has multiple shapes grouped beneath it, the targets must have an identical shape hierarchy. Additional base shapes can be added in edit mode using the deformers -g flag.

HistoryLocation = Enum( EnumValue('HistoryLocation', 0, 'frontOfChain'), EnumValue('HistoryLocation', 1, 'normal'))
Origin = Enum( EnumValue('Origin', 0, 'localOrigin'), EnumValue('Origin', 1, 'worldOrigin'))
addBaseObject(object)

Adds a new base object to the deformer. This object will be deformed as targets are added for it and the deformation parameters change.

Parameters :
object : PyNode

new base object

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.addBaseObject

Undo is not currently supported for this method

addTarget(baseObject, weightIndex, newTarget, fullWeight)

Adds a new target object for the given base object. The weight index says which of the deformer’s weight values will control this target’s affects on the base object. The full weight argument determines at what weight the target is in full effect. If a base object has no other targets and the weight is set to the ‘full weight’, then the base object will look just like the target object.

Parameters :
baseObject : PyNode

base object for the target

weightIndex : int

weight index to use for target’s effect

newTarget : PyNode

new target object for the given base

fullWeight : float

weight value at which the target is in full effect

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.addTarget

Undo is not currently supported for this method

after(val=True, **kwargs)

If the default behavior for insertion/appending into/onto the existing chain is not what you want then you can use this flag to force the command to stick the deformer node after the selected node in the chain even if a new geometry shape has to be created in order to do so. Works in create mode (and edit mode if the deformer has no geometry added yet).

Derived from mel command maya.cmds.blendShape

afterReference(val=True, **kwargs)

The -afterReference flag is used to specify deformer ordering in a hybrid way that choses between -before and -after automatically. If the geometry being deformed is referenced then -after mode is used in adding the new deformer otherwise -before mode is used. The net effect when using -afterReference to build deformer chains is that internal shape nodes in the deformer chain will only appear at reference file boundaries, leading to lightweight deformer networks that may be more amicable to reference swapping.

Derived from mel command maya.cmds.blendShape

before(val=True, **kwargs)

If the default behavior for insertion/appending into/onto the existing chain is not what you want then you can use this flag to force the command to stick the deformer node before the selected node in the chain even if a new geometry shape has to be created in order to do so. Works in create mode (and edit mode if the deformer has no geometry added yet).

Derived from mel command maya.cmds.blendShape

frontOfChain(val=True, **kwargs)

This command is used to specify that the new deformer node should be placed ahead (upstream) of existing deformer and skin nodes in the shape’s history (but not ahead of existing tweak nodes). The input to the deformer will be the upstream shape rather than the visible downstream shape, so the behavior of this flag is the most intuitive if the downstream deformers are in their reset (hasNoEffect) position when the new deformer is added. Works in create mode (and edit mode if the deformer has no geometry added yet).

Derived from mel command maya.cmds.blendShape

getBaseObjects()

Get a list of all of the base objects for this deformer. The objects returned will be the deformed versions of the base objects.

Return type:PyNode list

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.getBaseObjects

getDeformerTools(**kwargs)

Returns the name of the deformer tool objects (if any) as string string ...

Derived from mel command maya.cmds.blendShape

getExclusive(**kwargs)

Puts the deformation set in a deform partition.

Derived from mel command maya.cmds.blendShape

getGeometry(**kwargs)

The specified object will be added to the list of objects being deformed by this deformer object, unless the -rm flag is also specified. When queried, this flag returns string string string ...

Derived from mel command maya.cmds.blendShape

getGeometryIndices(**kwargs)

Complements the -geometry flag in query mode. Returns the multi index of each geometry.

Derived from mel command maya.cmds.blendShape

getNormalizationGroups(**kwargs)

Returns a list of the used normalization group IDs.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.blendShape

getOrigin()

Gets the origin space. It defines the point around which the differences in the geometry are calculated.

Return type:BlendShape.Origin

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.origin

getTarget(**kwargs)

Set target object as the index target shape for the base shape base object. The full influence of target shape takes effect when its shape weight is targetValue.Parameter list: string: the base objectint: indexstring: the target objectdouble: target value

Derived from mel command maya.cmds.blendShape

getTargets(baseObject, weightIndex)

Get a list of all of the target objects for the given base object that affect it based on the given weight index.

Parameters :
baseObject : PyNode

The base shape of interest.

weightIndex : int

The index of the weight attribute. Since the weight indices may be sparse, the weightIndexList method should be used to find the weight indices used by a given blendShape.

Return type:

PyNode list

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.getTargets

getWeight(index)

Get the weight value at the given index. To be valid, a weight value should only be requested at index values returned by MFnBlendShapeDeformer::weightIndexList .

Parameters :
index : int

index of weight value

Return type:

float

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.weight

getWeightCount(**kwargs)

Set the number of shape weight values.

Derived from mel command maya.cmds.blendShape

inBetween(val=True, **kwargs)

Indicate that the specified target should serve as an inbetween. An inbetween target is one that serves as an intermediate target between the base shape and another target.

Derived from mel command maya.cmds.blendShape

numWeights()

Return the number of weight values that this blend shape deformer has. The number of weight values is equal to the number of targets. Targets are either shapes in the dag or baked data on the blendShape node (when a target shape is deleted).

Return type:int

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.numWeights

parallel(val=True, **kwargs)

Inserts the new deformer in a parallel chain to any existing deformers in the history of the object. A blendShape is inserted to blend the parallel results together. Works in create mode (and edit mode if the deformer has no geometry added yet).

Derived from mel command maya.cmds.blendShape

prune(val=True, **kwargs)

Removes any points not being deformed by the deformer in its current configuration from the deformer set.

Derived from mel command maya.cmds.blendShape

remove(val=True, **kwargs)

Specifies that objects listed after the -g flag should be removed from this deformer.

Derived from mel command maya.cmds.blendShape

removeTarget(baseObject, weightIndex, target, fullWeight)

Remove a target object for the given base object. The weight index specifies the index at which target is connected. The full weight argument specifies at what weight the target is in full effect.

Parameters :
baseObject : PyNode

base object for the target

weightIndex : int

weight index corresponding to the target

target : PyNode

target object for the given base to be removed

fullWeight : float

weight value at which the target is in full effect

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.removeTarget

Undo is not currently supported for this method

setGeometry(val=True, **kwargs)

The specified object will be added to the list of objects being deformed by this deformer object, unless the -rm flag is also specified. When queried, this flag returns string string string ...

Derived from mel command maya.cmds.blendShape

setOrigin(space)

Sets the origin space. It defines the point around which the differences in the geometry are calculated.

Parameters :
space : BlendShape.Origin

origin space

values: ‘localOrigin’, ‘worldOrigin’

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.setOrigin

setTarget(val=True, **kwargs)

Set target object as the index target shape for the base shape base object. The full influence of target shape takes effect when its shape weight is targetValue.Parameter list: string: the base objectint: indexstring: the target objectdouble: target value

Derived from mel command maya.cmds.blendShape

setWeight(index, weight)

Set the weight value at the given index.

Parameters :
index : int

index of weight value

weight : float

new weight value

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.setWeight

setWeightCount(val=True, **kwargs)

Set the number of shape weight values.

Derived from mel command maya.cmds.blendShape

targetItemIndexList(weightIndex, baseObject)

A base object may have more than one target using the same element of the blendShape’s ‘weights’ array. We refer to these as the base object’s “target items” for that weight index.

Parameters :
weightIndex : int

‘weights’ array index.

baseObject : PyNode

The deformed object of interest

Return type:

int list

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.targetItemIndexList

weightIndexList()

Return the array index numbers corresponding to the targets. The resulting index list will be the length of MFnBlendShape::numWeights. This method exists because the indices of the targets can be sparse. For example, if a target has been removed using Deform -> Edit BlendShape -> Remove.

Return type:int list

Derived from api method maya.OpenMayaAnim.MFnBlendShapeDeformer.weightIndexList

Previous topic

pymel.core.nodetypes.BlendDevice

Next topic

pymel.core.nodetypes.BlendTwoAttr

Core

Core Modules

Other Modules

This Page