Target weights can be set with the path blendShape1.inputTarget[0].inputTargetGroup[0].targetWeights[].*
I manage to get to here blendShape1.inputTarget[0].inputTargetGroup[0].targetWeights but when I try and access the individual elements for the array I am unable to. The only way I can access the individual elements is if I run getAttr and setAttr on every target weight, which seems to open them up to being accessed by the api? Is there a way around this? I linked the relevant sections of my script below.
bsDepFn = om.MFnDependencyNode(bsNode)
bsInputTarget = bsDepFn.findPlug('inputTarget',False) #blendShape1.inputTarget
bsInputTarget = bsInputTarget.elementByPhysicalIndex(0) #blendShape1.inputTarget[0]
bsInputTargetGroups = bsInputTarget.child(0) #blendShape1.inputTarget[0].inputTargetGroup
inputTargetGroups = []
for i in range(bsInputTargetGroups.numElements()): #blendShape1.inputTarget[0].inputTargetGroup[*]
targetGroup = bsInputTargetGroups.elementByPhysicalIndex(i)
inputTargetGroups.append(targetGroup)
targetWeights = inputTargetGroups[0].child(1) #blendShape1.inputTarget[0].inputTargetGroup[0].targetWeights
targetWeights.elementByPhysicalIndex(0) #causes error unless attr previously set with mel