Set driven keys Driver and driven export and import setup

Set driven keys Driver and driven export and import setup

davidtorresmonteiro
Enthusiast Enthusiast
1,327 Views
2 Replies
Message 1 of 3

Set driven keys Driver and driven export and import setup

davidtorresmonteiro
Enthusiast
Enthusiast

I have made a Facial UI with a bunch of controllers driving many Blendshapes, via set driven keys

 

Now i have another character with the same Facial UI and blendshape names.

 

I would like to "transfer the driver/driven" relationship without havibng to re connect everything manually.

 

Any ideas about how to do this within Maya, or do i need an external script for this?

 

Thanks for any help!

 

D

0 Likes
1,328 Views
2 Replies
Replies (2)
Message 2 of 3

hamsterHamster
Advisor
Advisor

It would be nice to have a single buffer node between the anim curve nodes and the blendshape inputs, which you can then merge with another rig and reconnect with relative ease manually, in connectionEditor.

Otherwise you need to record (Node editor) all the incoming connections to the blendshape and do reconnecting by the batch MEL script, which will look something like:

connectAttr -f ctrlCurve1_translateX.o blendShapeNew.w[0]
connectAttr -f ctrlCurve1_translateY.o blendShapeNew.w[1]
...

Or you can go with this Python script (not tested), however you need to have both blendshapes in one scene, and the order of the blendshape targets should be identical:

# NH : connects controls to another blendshape
import maya.mel as mm
sbs = 'sourceBlendshapeName'      # change name, keep the quotes
dbs = 'destinationBlendshapeName' # change name, keep the quotes
wc = mm.eval('blendShape -q -wc '+ sbs)
for i in range(0, wc):
    sf = mm.eval('connectionInfo -dsf '+ sbs +'.w['+ i +']')
    mm.eval('connectAttr -f '+ sf +' '+ dbs +'.w['+ i +']')

After executing this, the same controls will drive both blendshapes, i guess, it is safe to delete the old one. If you find errors and manage to correct them, please, post back the updated version.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 3 of 3

davidtorresmonteiro
Enthusiast
Enthusiast

Thanks a lot!

 

I will give it a try

0 Likes