View Full Version : How to add mel code to *ma
Irakli 05-28-2009, 12:13 PM How to add mel code to MAYA ASCII file? When I do this with text editor and the open and save scene maya deletes that code.
The code contains procedure and scriptJob command which executes that procedure.
|
|
Robert Bateman
05-28-2009, 04:56 PM
you can't. ma files are not mel scripts, and should not be treated as such. Only 11 commands are allowed (as per the file format spec viewable in the docs Developer Resources->File Formats->Maya Ascii). You can in theory add mel script as a scriptnode to be executed on file open - but I can't help thinking you are probably doing something very wrong indeed.
Irakli
05-28-2009, 07:14 PM
Thank you! Your advice was very helpful. A've just reed documentation and found this :
Note It is possible to edit a Maya ASCII file and add MEL commands to it. However, we advise you against doing this.
If you do decide to add custom MEL code directly to a Maya ASCII file, keep the following in mind:
If you do decide to add custom MEL code directly to a Maya ASCII file, keep the following in mind:
* If you edit a Maya ASCII file and add arbitrary MEL commands to it, these commands will not be saved out after you read in the file.
Instead, they will be replaced by the explicit descriptions of the nodes, attributes, and connections that resulted from executing the commands. If you wish to add commands that will stay the way they are, you must put them in a file with a .mel extension, and reference that file (using Create Reference... in the File menu, or the file -r command.)
* There are other limitations when you are adding arbitrary MEL commands directly into a Maya ASCII file.
There is no guarantee that all commands will execute successfully. For example, for performance reasons we suspend all undo operations during loading of Maya ASCII and binary files. Some commands rely on undo capability internally to perform their work; these commands will only work from within .mel files (since loading of such files does not turn off the undo capability).
In my case create reference is what I need.
Thanks!
CGTalk Moderation
05-28-2009, 07:14 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.