So I'd remember that there was a way (before HIK in maya) to link motion capture files to rigs that could be different sizes/builds etc.
After much hunting I found this:
http://tech-artists.org/forum/showthread.php?2155-retargeting-animation-rigs
The video from this discussion used the HIK system, as well as a lengthy script - something that wasn't really suitable for me to explore.
I must also point out that I've had (and have heard other people having) bad experiences with the HIK rig setup in maya - leaving hidden keys and constraints within the rig - meaning editing gets messy and screws up very easily.
So with this in mind I remembered something from an Autodesk talk in Rave a while back, which was that in each edition of Maya they store legacy options (old functions and features). These are hidden away somewhere within the build - and have no menu options to access them.
This is where my hunt took me.
http://download.autodesk.com/us/maya/2009help/index.html?url=Skeleton__Retargeting__Retarget_Skeleton.htm,topicNumber=d0e335174
This is the link to some old autodesk wiki pages. This is exactly the option box i need to transfer the mocap to another skeleton. I also found this:
http://mayastation.typepad.com/maya-station/2010/04/fbik-or-hik.html
This was perfect! The exact code i needed!!
using this:
http://www.3dtrue.com/maya/5.html
I managed to fashion a menu bar (not a shelf button) so that the function would permanently be there.
I tried it out and got an error on the most important part.
The RetargetCharacterOptions; Didn't work. Giving me a // Error: Cannot find procedure "RetargetCharacterOptions". //
This wasn't great. Even after trying the WhatIs command i found here:
http://area.autodesk.com/forum/autodesk-maya/mel/cannot-find-procedure-clipeditorexportclip/
It wouldn't get found.
Not ready to admit defeat (despite spending about 3 hours trying to find out how to get this working) I went back to another autodesk wiki.
file:///C:/Program%20Files/Autodesk/Maya2011/docs/Maya2011/en_US/PyMel/generated/functions/pymel.core.animation/pymel.core.animation.retarget.html
I don't quite remember how I found this link - but it made me suspicious that all i was really looking for was a .mel file in the maya source (in my C: drive).
I found a retarget.mel file and opened it with notepad. Now, I'm not too great at coding, so a lot of what was in there I skipped - however RIGHT at the bottom I found a single string that led to the function I needed:
//
// Procedure Name:
// performRetarget
//
// Description:
// Create a clip and add the animatable attributes from the
// selected nodes. This procedure will also show the option box
// window if necessary as well as construct the command string
// that will create a clip with the current option box values.
//
// Input Arguments:
// 0 - Execute the command.
// 1 - Show the option box dialog.
// 2 - Return the command.
//
// Return Value:
// None.
From this I had to understand I didn't want to simply execute the command, nor get a return but to open the options box. So instead of "RetargetCharacterOptions;" I had to use "performRetarget(1);"
This worked beautifully, and once saved as a .mel and popped in maya's starup folder it always loads.
Hunt finished!!
No comments:
Post a Comment