I am pretty new to MEL and as I was exploring around this MEL script, I found out that the user have write some lines that I totally do not get it. And yet I am interested to know why this person done it..
Anyway, can someone kindly explain why does the following code, first indicate an empty MEL then it goes on to call a Python? Wouldn't it be easier to just put in the Python?
I also tried to disable the command and sourceType, and the script works fine too, it is just that I do not get what is the purpose of command
and sourceType
doing in this case...
-command ""
-sourceType "mel"
-actionIsSubstitute 0
-commandRepeatable 1
("shelfBtn_" + $parent + "_AOV");
python("import aovsFunction as aovs; aovs.MenuFuncs.aovMenu('"+"shelfBtn_" + $parent + "_AOV"+"')");
By the way, $parent
is derived from:
global proc apkg2dnc(string $parent)
Then I tried to change the code into the following, it works as like the one above but...
-command ("import aovsFunction as aovs; aovs.MenuFuncs.aovMenu('"+"shelfBtn_" + $parent + "_AOV"+"')")
-sourceType "python"
When I tried removing the brackets, I was given the Syntax Error message, indicating the first plus sign +
that it encounters.
Did tried to add in the ;
at the end of the line, it is still giving the Syntax Error, this time indicating at the start of the line
-command "import aovsFunction as aovs; aovs.MenuFuncs.aovMenu('" + "shelfBtn_" + $parent + "_AOV" + "')"
-sourceType "python"
And so, does brackets play a big part in how it is being read in MEL?