FORUMS: list search recent posts

MEL Cannot find procedure writeExternalAnimation

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Alex Jørgensen
MEL Cannot find procedure writeExternalAnimation
on Mar 24, 2014 at 8:22:31 pm

Short Version:
Trying to write animation clips to disk using this function

writeExternalAnimation($startingDir, $item);

But I get this error,
// Error: line 33: Cannot find procedure "writeExternalAnimation".

and I cannot for the life of me figure out how to deal with it.

please help!

---------------------------------------------------------------

Long Version
So I've been trying to automate parts of my pipeline. In this particular example I've been trying to export all my animation clips from the visor to disk, you know for backups.
I found someone who was trying to do basically the same thing in this thread: http://www.creativecrash.com/forums/mel/topics/import-and-export-of-animati...

So I "borrowed" part of his code and ended up with the following

string $originalSelection[] = `ls -sl`;
string $buffer[];
int $numberOfTokens = `tokenize $originalSelection[0] "_" $buffer`;
string $rootName = "";

int $t;
for($t = 0; $t < `size $buffer`; $t++)
{
if($buffer[$t] != "")
{
if($rootName == "")
{
$rootName = $buffer[$t];
}
else
{
$rootName = $rootName + " " + $buffer[$t];
}
}
}

string $startingDir = "C:/Users/Documents/maya/projects/default/clips/" + $rootName + " BackUp AnimationClips/";

sysFile -makeDir $startingDir;

string $selection[] = `ls -sl`;
stringArrayRemoveAtIndex(0, $selection);

for($item in $selection)
{
writeExternalAnimation($startingDir, $item);
}

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);
}

It worked brilliantly... for a day... when I opened maya up this morning and tried to put the script to use, this error log suddenly fired back at me.

// Error: line 33: Cannot find procedure "writeExternalAnimation".

Line 33 is this line:
writeExternalAnimation($startingDir, $item);

I looked around on the web for a while and found this guy who seemed to have a similar problem
http://www.vrsets.com/maya/cannot-find-procedure-'clipeditorexportclip/

Solution seemed to be sourcing the file like so:
source "C:/Program Files/Autodesk/Maya2009/scripts/others/doExportClipArgList.mel";

However it didn't really work for me. (Oh and yea, I did update the Maya2009 part to Maya2014)

Soo... I'm hoping someone here has an idea.
Any help is much appreciated.

- Alex


Return to posts index

James Peres
Re: MEL Cannot find procedure writeExternalAnimation
on Apr 8, 2014 at 3:13:07 am

It seems that you did not include the part of the original script that begins with

global proc writeExternalAnimation( string $startingDir, string $item) or something similar.

-
James

Mac Pro 4,1 Quad Core 2.66


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]