Thanks Eduardo, that's pretty much what I ended up with but the point
though is that replacing / updating a target shouldn't be so hard, I mean,
look at the command string you've just done in the connect command to
update that target, could it be any more convoluted ;)

thanks

Mark

On 21 November 2014 at 22:52, Eduardo Grana <[email protected]> wrote:

> Hello Mark,
>
> Not sure if this is what you are looking for,
> I'm writing this very quickly hope it makes sense,
>
> #remove an existing blend
> blendNode = 'blendShape1'
> 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 = 'blendShape1'
> meshIn = 'pSphereShape4'
> geoIndex = 0
> index = 1
> mc.connectAttr( '%s.worldMesh[0]' % meshIn,
>
> '%s.inputTarget[%s].inputTargetGroup[%s].inputTargetItem[6000].inputGeomTarget'
> % (blendNode, geoIndex, index), f=1 )
>
> Hope it's usefull.
> Cheers!
> Eduardo
>
> On Fri, Nov 21, 2014 at 3:58 PM, Mark Jackson <[email protected]> wrote:
>
>>
>> I'm in the middle of writing a new facial pipeline for Red9 clients and
>> and trying to get a solid corrective sculpt pipeline up and running, but
>> I'm hitting issues with blendshapes, or rather, the god awful support that
>> Maya has for actually editing them in code.
>>
>> So case in point, I'm sculpted the 'jaw_open' shape already and I want to
>> re-sculpt it, and replace that target in the blendshape, but try as I might
>> I'll be damned if I can get the blendshape command to behave as I want.
>> Adding new targets is easy, but replacing them feels like pulling teeth.
>>
>> cmds.blendShape(sculptBlend, edit=True, t=(faceMesh, activeTargetIndex,
>> activeSculpt, 1))
>>
>> Anybody got any good pointers for this, I'd assumed that something like
>> the above would work, where sculptBlend is the blend node, faceMesh is the
>> baseMesh,  targetIndex is the current index of the target I want to update
>> and activeSculpt is the new sculpt to replace it with, but it doesn't seem
>> to have the effect.
>>
>> Neither does removing a target from the blend. Surely there has to be
>> better support for this stuff as at the moment the safest way seems to be
>> just to recreate the blendNode each time. I know we've done it like this in
>> the past because of similar issues managing the blendShape node. The issue
>> I have with this project is that we're sculpting ontop of a pretty heavy
>> mesh and keeping all the targets in the scene is bloating it massively.
>>
>> Any pointers guys??
>>
>> thanks
>>
>> Mark
>>
>>
>> -------------------------------------
>> Mark Jackson
>> CEO / Technical Director
>> red9consultancy.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAGQH2FH99yw4YbHvvc7PODtvfbzxT3ydM5uggjFfkbp%2BE3WXMg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAGQH2FH99yw4YbHvvc7PODtvfbzxT3ydM5uggjFfkbp%2BE3WXMg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Eduardo GraƱa
> www.eduardograna.com.ar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CACt6Grkpo3UuCvAOk1YYT1%3Dzv2OY-4ZnbOLppiifJvwfwr4wnA%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CACt6Grkpo3UuCvAOk1YYT1%3Dzv2OY-4ZnbOLppiifJvwfwr4wnA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-------------------------------------
Mark Jackson
CEO / Technical Director
red9consultancy.com

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAGQH2FFG%2BWT8Z5bx6KH74WyLJpxxcJtWvGNOkUDsDx%3D8CJn-Mw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to