- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone, I have tried for a couple days to create a blendshape target correctly and I can't seem to find a way to do it. The help documentation on this is not very clear. I think because I am not making a separate object as a target I am just wanting to use the original shape and edit it just like you do when you hit the "add target" button in the Shape Editor. I think maya is doing some very tricky stuff.
I was mostly trying to use this option but it never made the connections correctly.
BlendFix_01 is the name of my primary blendshape
mc.blendShape( "pSphereShape2", edit=True, t=("pSphereShape2", 1, "pSphere2", 1) )
I have found this to work with multiple objects but can't seem to do it without creating multiple objects. Surly there is a much simpler solution? Also I understand what most of this code is doing except the last line. This I don't understand. I am not a newbie to Maya but I am pretty new to scripting.
any help and I would soooo Grateful!
#remove an existing blend
blendNode = 'BlendFix_01'
base = 'pSphere2'
target = 'pSphere3'
index = 1
maxValue = 1.0
mc.blendShape( blendNode, edit=True, rm=True, t=[(base, index, target, maxValue),(base, index, target, maxValue)] )
#add blend (must be an empty slot, if its used, you have to remove it first)
target = 'pSphere1'
index = 2
mc.blendShape( blendNode, edit=True, t=(base, index, target, maxValue) )
#replace blend via connection
blendNode = 'BlendFix_01'
meshIn = 'pSphereShape4'
geoIndex = 0
index = 1
mc.connectAttr( '%s.pSphere1[0]' % meshIn,
'%s.inputTarget[%s].inputTargetGroup[%s].inputTargetItem[6000].inputGeomTarget' % (blendNode, geoIndex, index), f=1 )
Solved! Go to Solution.