Description
A blendshape deformer implemented with the CUBLAS GPU library. The CUDA libraries will need to be installed on any machine that uses this plug-in. You can download the CUDA libraries from NVIDIA.
Node Reference
| Long Name | Type | Default |
|---|---|---|
| deltas Target deltas. |
vectorArray | 0 |
| weight Animated weight values. |
multi-float | 0 |
| initialized Internal initialization flag. Do not set. |
bool | false |
| run Set to true to allow deformer to run. Since copying data to the GPU can be expensive, adding many targets at once can take a long time since each time a target is added, the existing targets are cleared from the GPU and then the new target list is copied to the GPU . This flag allows you to defer the GPU memory copy until all the targets have been added. |
bool | false |
| paintMode Painting targets is enabled by painting the paintMap attribute. Since all the target deltas are stored on the GPU, painting target maps requires that painted target deltas be transferred to the GPU. This can be an expensive operation, so a paintMode attribute is available on the node. When painting, this should be set to true. When finished painting, paintMode should be set to false. |
bool | false |
| targetMap The per-target painted maps. |
doubleArray | null |
| inInput Parent compound attribute for paintable attribute. |
compound array | N/A |
| paintMap Paintable attribute. |
doubleArray | null |
Usage Notes
The UI

Open the UI by running:
import cvCudaBlendShape cvCudaBlendShape.ui()
The UI allows access to the cvCudaBlendShape commands as well as painting the targets of a node. To paint a specific target, select the radio button next to the target weight slider.
Painting targets is enabled by painting the paintMap attribute. Since all the target deltas are stored on the GPU, painting target maps requires that painted target deltas be transferred to the GPU. This can be an expensive operation, so a paintMode attribute is available on the node. When painting, this should be set to true. When finished painting, paintMode should be set to false.
Create the Deformer
Select the targets mesh, shift select the base mesh. Don’t forget to set the run flag to true!
import cvCudaBlendShape
deformer = cvCudaBlendShape.create(baseMesh=None, targets=[], name='cvCudaBlendShape#')
def create(baseMesh=None, targets=[], name='cvCudaBlendShape#'):
"""
Creates a cvCudaBlendShape deformer.
Parameters:
baseMesh - baseMesh snaps to snapMesh
targets - list of targets
name - Name of the deformer to create.
Returns:
The name of the created cvCudaBlendShape node.
"""
Add additional targets
# Select target then base
import cvCudaBlendShape
cvCudaBlendShape.addTarget()
def addTarget(cvCudaBlendShapeNode=None, target=None, base=None):
"""
Adds a new target to the cvCudaBlendShape node.
Parameters:
cvCudaBlendShapeNode - cvCudaBlendShape node
target - Name of the new target
base - Name of the base mesh.
Returns:
Nothing
"""
Update existing targets
# Select target then base
import cvCudaBlendShape
cvCudaBlendShape.updateTarget()
def updateTarget(cvCudaBlendShapeNode=None, target=None, base=None):
"""
Updates an existing target if the target has been updated.
Parameters:
cvCudaBlendShapeNode - cvCudaBlendShape node
target - Name of the new target
base - Name of the base mesh.
Returns:
Nothing
"""

