Mirror set driven key


#1

Hello guys, hope you’re doing well.
I have a question regarding mirroring set driven keys, i did not find any threads on that or any free scripts online.

I have a face with master controllers on the left and on the right, and other micro controllers in each side as well. After a while setting all the driven keys now I am in the situation where i need to mirror those set driven keys from the left to the right, the thing is that i dont have a middle controller do drive both micro controllers, the driver is on each side like this:

Any help is more than welcome !!!

](http://img683.imageshack.us/i/80801290.jpg/) Uploaded with ImageShack.us[/IMG]


#2

One way would be to manually duplicate the set driven keyframe nodes that were created when you did the left side and then connect them to the equivalent right side controller.attributes of the rig. I’d do this within the hypergraph. In some instances, you might have to tweak the keys from within the graph editor if you need certain keyframe nodes to have a negative value (mostly the case if you are dealing with translate or rotate keyframe nodes).


#3

isnt there somehting in bonus tools which addresses this? may be old. never really used it but im may be worth a look


#4

I think is better use a mel script, and just change names and + - for the other side…
I dont have a good experience with SDK


#5

From my experience, the controller and controlled need to mirrored separately and then the SDK needs to be created/updated.

I’ve been working on a couple scripts to streamline setup of an SDK-based facial rig. The scripts work but are still in development. I have a Python script for quick mirroring and PyMel script for updating SDK connections. The latter is very useful as I haven’t found anything like it. The initial SDK relationship needs to be setup using Maya or another script, but once it’s setup, my script will parse all the SKD relationships on a selected controller and update them using the current values of the objects.
So the procedure goes something like this:

  1. Setup the SDK relationships
  2. Reposition the controller and controlled (mirror, tweak, etc.)
  3. Use my script to update them. The updating will add new keys if an object isn’t on a keyed value, so you have to pay attention (this is good).

I halted development for awhile because of other commitments, but I’m about ready to pick them back up. I’ll post them if you’re interested in kicking the tires.

The rig I’m working on is joint driven. Another tool which I developed while working on this “challenge” adds parents above selected objects. This can be downloaded here, though I also have an update that permits giving the top object a different name. I haven’t had a chance to update the upload at CC, but I can pass it along if it will be useful.


#6

Thanks for replying ! Actually I am still stuck with that particular issue.
Did you mean that you have a script that would help me in mirroring my set driven keys ?
Cheers


#7

Alessio, how the hell you doing :wink:
Set Drivens are just an anim curve, with input/outputs, can you not just select the keys on the curve once re-wired and scale them by *-1 either in time or value depending on how they’re wired? Thats all we do here for animation mirroring across the pipeline?


#8

Or in Hypergraph connect it via +/- node?? You can than edit both in same time :slight_smile:
But still, Idont like SDK
why not just write a mal script?
like for examlpe
DRIVEN_L.translateX =DRIVER_L.translateX2;
DRIVEN_L.translateY =DRIVER_L.translateY
2;
etc… or so…
and on the other side
DRIVEN_R.translateX = -DRIVER_R.translateX2;
DRIVEN_R.translateY = -DRIVER_R.translateY
2;


#9

I had used some of this script in a script I wrote for dealing with mirroring SDK. It was pretty handy. You may need to modify the results once you output it.

http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/oa-export-sdk


#10

Maaaaark ! I am doing good ! How’s you ? :slight_smile:

Well, that was the first thing I thought, but also I was wondering if there was some existing scripts here and there, you know I am lazy :).
Also I have so many curves… I’ll give it a go and maybe I’ll be able to figure out how to write a script .

Cheers Mark :).


#11

Hi, thanks for replying, I’ve tried that already and it doesn’t work…

Is it possible because I have blendWeighted nodes ? that’s mean I have multiples driven keys.
Im worried it might be that the reason why your script doesnt work …

Is it possible to convert those bloody blendWeighted nodes ???
I have to say that I hate set driven keys…

Thanks everyone !


#12

Actually works pretty good, but as I said, if there are blendWeighted nodes, it gets screwed… shame…


#13

My scripts do mirroring and updating the SDK’s separately, but its a great idea to add mirroring to the update script.
So at this point, these are the steps:

  1. Setup SDK relationships
  2. Adjust the keys for 1 half of the controlled objects
  3. Use mirroring script (mine or another) to mirror the the keys to corresponding objects on other side
  4. Use my SDK update script to create/update the SDK relationship between driver and all its driven objects at the current frame.

#14

Shoot, those pesky blendWeighted nodes. I’m pretty sure that the script doesn’t handle those. You’d have to put in a check somewhere in the code to look to see if these are connected and then follow the stream up to the control object. A bit more of a hassle but doable.

I agree, SDK’s are a pain. I used them when setting up joint driven face setups. My process was to create 1 control object that had all the attributes that drove the shapes then the attributes where connected to sliders. At times the SDK shapes would get messed up so I would keep a library of shapes just in case I needed to go back and recreate them.


#15

My script will parse all the blendWeighted nodes, it’s attached if you want to give it whirl. It requires PyMel, which is built into 2011.
I’ve been reading the third edition of Stop Staring. He suggests the same approach described by Sean. The next iteration of SDK Monger will work with that approach. I’ll also add mirroring. Also, it will probably be straight Python. Also included is my mirroring script, which, as I recall, only works with translation at this point. It’s straight Python.


#16

Thanks Sean, yep SDK are a pain in the arse …

8Bit, i tried your script, but I had an error, looks like a variable is not declared or something…
What’s the correct use of that script ?

Thank you guys. :slight_smile:


#17

The script is definitely a work in progress, but it can still be useful for rigging a joint driven face. What’s the error?
Note that there is a pretty extensive help file.


#18

Here’s a python script that could do this:
http://www.creativecrash.com/maya/downloads/scripts-plugins/character/c/copysdk-py

Select your source driven object, then your destination. Run:

copySDK()

To access the doc tag for more options, run:

copySDK.doc

It will handle the blendWeighted issue, as it copies this as well. This script is undergoing some revisions, but should work out for you.

Cheers.


#19

Thanks, that looks very useful.
The link is incorrect, here’s the correct one:
http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/kz_copysetdrivenkey--2


#20

Hi ! This is actually working pretty good, except for one thing, the values on the other side are a bit different … but is really good tho ! thanks a lot.