Advanced MEL questions

Hi guys!

I'have a couple of questions for you.

1) How is it possible to create custom scene file like some MEL script deal with, for instance Skeleton works.

2) What's the way to call a script located in a directory from a script running in Maya.

Any clues?

1) aaah. sorry it took me a while. Yes you write out some rule thet your loop sunderstand and then let your code do it in reverse.

2) source, then possibly call its global prc unless the file itself has a non proc entrypoint to take care of this.

maybe i'm not so clear.

I've watched the Fast animation rigs video from JS and he is talking about a script, jsEeferenceRig, that handles a specific file format, *.rig.

My question is: How could I create my own scene file format with MEL?

File format is only data, so if you want a own file format you need a system to parse that data.

lets say youd want bones psoitions in your file then you could for example write a buch of vectors in your file corresponding to the bones directions for example. Then all you need to do is wirte a proc that extracts this vectorfrom exisiting bones (save) and one that remakes the bone based on this vector (load). Then youd need some index to tell what bone the bone is connected for example. Then just write that data to your file.

You can go bonkers about this offourse. I just suggest convertig data to pure mel and evallinbg it later in atleast its simple enough.

ITs moore of a api thing.

I havn't seen what you're tallking about, but I'm guessing he's just making an arbitrary text file with an arbitrary extension, so it's easeir to find. Using Maya's fopen command for example, when you create a file, you can give it any extension you'd like:

$fileId=fopen "c:/temp/myFile.myExtension;

It's still a text file regardless of the extension. I do it all the time when I write text files... I may call one .smoothWeight, or .pose, or whatever. Just a way to organize your data.