wrap.blendShapesDialog

wrap.blendShapesDialog(neutralGeom, targetGeoms, targetNames = [], neutralTexture = [], targetTextures = [])

Shows interactive blendshape dialog with sliders

Parameters:

neutralGeom : wrap.Geom

Neutral geometry.

targetGeoms : list of wrap.Geom

List of target geometries. Number of vertices of each target must match to the number of vertices of neutral geometry.

targetNames : list of string

List of target names which will be displayed with sliders to corresponding targets. If empty then names are are numbered as “Target 1”,”Target 2”, etc.

neutralTexture : wrap.Image

Texture of neutral geometry.

targetTextures : list of wrap.Image

List of target textures. Format and dimensions of each target texture must match to neutral texture.

Returns:

result: wrap.Geom

Computed blendshape with last sliders positions. If textures are passed then result has assigned texture.

Examples

To compute blendshape with textures interpolated:

# specify names
neutralGeomFilename = 'Neutral.obj'
neutralTextureFilename = 'Neutral.jpg'
targetGeomFilenames = ['Fear.obj','Pain.obj','Smile.obj']
targetTextureFilenames = ['Fear.jpg','Pain.jpg','Smile.jpg']
targetNames = ['Fear','Pain','Smile']

# loading models
neutralGeom = wrap.Geom(wrap.demoModelsPath + '/Blendshapes/' + neutralGeomFilename)
neutralGeom.texture = wrap.Image(wrap.demoModelsPath + '/Blendshapes/' + neutralTextureFilename)
targetGeoms = [ wrap.Geom(wrap.demoModelsPath + '/Blendshapes/' + filename) for filename in targetGeomFilenames ]
targetTextures = [ wrap.Image(wrap.demoModelsPath + '/Blendshapes/' + filename) for filename in targetTextureFilenames ]

# hiding neutral and target geoms to make visible only blendshape
neutralGeom.hide()
for targetGeom in targetGeoms: targetGeom.hide()

# computing blendshape
blendshapeGeom = wrap.blendShapeDialog(neutralGeom, targetGeoms, targetNames, neutralGeom.texture, targetTextures)

And if you need only geometry without textures just not pass texture parameters:

# computing blendshape
blendshapeGeom = wrap.blendShapeDialog(neutralGeom, targetGeoms, targetNames)

When you don’t want to generate blendshaped texture and see in the viewport just one texture then pass only neutralTexture parameter:

# computing blendshape
blendshapeGeom = wrap.blendShapeDialog(neutralGeom, targetGeoms, targetNames, neutralGeom.texture)