PDA

View Full Version : MEL query question


bentllama
05-31-2002, 10:50 PM
I am in the midst of writing a MEL script and I need some help.

What I want to happen in the script is this:

File import
Copy animation to new skeleton and IK rig
Export .ma file with same name as the imported file

I have most of the script done…but I need to query the imported filename so I can use that string for the exported filename.

I have a few ideas about how to query the filename.

How would you go about it?

bigfatMELon
05-31-2002, 11:50 PM
I assume you mean that the user has imported a file, no?

Problem with this is that MEL has no way of looking up past events to find out which file was imported. The thing to do here is to take control of this process much earlier and have your script do the importing part so that it can know the name of the file and also control other aspects import process like how clashing nodes might be renamed.

look up the file command for something like:

file -i -pmt 0 "myPath";

you'll also need to prompt the user for a file with something like:

string $fileDialogResult = `fileDialog`;

Then you'll need to chop up the returned path to get the name of the file. I prefer to use my stringTools for that, which would look like:

string $fileName = `stringLastWord $fileDialogResult "/"`;

-jl

CGTalk Moderation
01-13-2006, 07:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.