There are two attributes that hold the delta information of a blendshape. The inputPointsTarget
holds all the deltas, and the inputComponentsTarget
holds the vertex indices that get each delta.
If you have more than one geometry being controlled by a single blendshape node, the index of the geometry goes into the brackets of inputTarget[]
, but most of the time that’s probably gonna be 0
The index of your current blendshape goes in the brackets of inputTargetGroup[]
The [6000]
thing is because the maya blendshape has the ability to have sub-shapes in between 0.0 and 1.0. So if you wanted an in-between shape to trigger at 0.5, you would use index 3000. I’ve never actually used this, I just know it exists.
Getting the data:
pt = cmds.getAttr('blendShape1.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputPointsTarget')
ct = cmds.getAttr('blendShape1.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputComponentsTarget')
Setting the data:
cmds.setAttr('blendShape2.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputPointsTarget', len(pt), *pt, type='pointArray')
cmds.setAttr('blendShape2.inputTarget[0].inputTargetGroup[0].inputTargetItem[6000].inputComponentsTarget', len(ct), *ct, type='componentList')