Hello,
I want to read/write the animation clips in the trax editor. The trax editor window offers the command in the menu "Import Animation Clips to Character.." but i need to have it in MEL.
global proc int writeExternalAnimation( string $path, string $aniClip )
{
string $filename = $path + $aniClip;
print("write external animation: " + $filename + "\n");
select $aniClip;
int $result = clipEditorExportClip($filename, "ma");
select -cl;
print("result: " + $result + "\n");
print("write external animation finish\n");
return ($result == 1);
}
global proc int readExternalAnimation( string $path, string $aniClip )
{
if (!endsWith( $aniClip, ".ma"))
$aniClip = $aniClip + ".ma";
string $filename = $path + $aniClip;
print("read external animation: " + $filename + "\n");
string $character = "pump1"; // test
select -r $character;
int $result = clipEditorImportClip($filename, "ma");
//select $aniClip;
print("result: " + $result + "\n");
print("read external animation finish\n");
return ($result == 1);
}
So, the writing works perfect, but the reading not. It compiles and runs, and Maya seems to do something, but the clips doesn't appear in the trax editor. Do i have to set some connections between character, aniclips and trax editor?
Thanks for help
Chris