Re: [Maya2osg-users] Discussion of next changes
Status: Alpha
Brought to you by:
jtaibo
|
From: Javier T. <jav...@gm...> - 2011-05-19 15:41:31
|
Hi J-S,
On Thu, May 19, 2011 at 4:19 PM, Jean-Sébastien Guay
<jea...@cm...> wrote:
> Hi guys,
>
> I've started looking at what you've done Peter for the pre/post-export
> script, it's cool that it's a MEL command. Is it possible from this
> field to call a function in a separate MEL script? Say I have a function
> called doPreExportStuff() in a file called preExport.mel, can I do
> something like (pseudocode)
>
> loadMEL("preExport.mel"); doPreExportStuff();
When you call a MEL function that is not defined, first Maya will
look in the scripts search path for a script with the same name and
.mel extension, so in this case you just need to call the function and
everything works automagically. If function name and file name do not
match, you can still load the file explicitly with
source "my_script_file.mel";
You can omit the extension if it is ".mel". What you must be sure is
to define the function as global to be available outside this script
file. Example:
global proc maya2osg_removeOptionVars()
{
...
}
Regards,
--
Javier Taibo
|