PDA

View Full Version : Urgent:How to create a .exe file from a MEL script ?



hnf
11-13-2005, 04:44 PM
I would like to ask you for a help in answering my urgent question.
Q: how to create a .exe file that would automatically install a MEL script (how to create a stand-alone .exe file that would automatically execute a MEL script) ...?

but I don’t want the code (script) to be shown. To be more precise, I want my script to be a stand-alone .exe file that once opened it is executed (and if possibly, I want the Maya to be loaded simultaneously)

sunder
11-13-2005, 09:29 PM
I'm not sure if it's possible (for a Maya end-user) to pass MEL code to Maya from an external program. You might be able to start Maya up from another program but I doubt you can directly send MEL commands to it.
If you just want to hide your code from others, you should consider coding a plugin instead of a script. You'll need good knowledge of C++ and the Maya API.
An idea is to write a Maya plugin that can read files that your executable program writes MEL code to. Not a recommendable tactic but it might work :p

papa
11-14-2005, 01:51 PM
Sunder is right,
If you don't want to share your code you need to build the script as a plugin so it is precompiled prior to launching in Maya. You could build in a piece of code to execute Maya.exe but from then you would need Maya to run your plugin. I know if you are to just test things as a script you could add it to the start up scripts dir/ and from there you could add a line in your initial script sequence to run that procedure.

I am not sure how to launch those from a plugin. It has to be able to be done because when you run a plugin like Syflex you get a menu which is a simple mel command each time you launch.

One little thing to think about is to make sure the user loads the plugin.

laxman
10-01-2007, 12:53 AM
The good news is that you can make plugins for free. Get VSC++ from the microsoft site and then install the mayaPluginWizard. That will let you create maya project from with VS, and it will let you compile straight to a plugin format. You just set it to compile into the plugins folder, and then you can load the plugin from the plugin manager. I used this to create a quick hello world app just to see if it would work. I didn't get much farther than that because I didn't know enough about C++ at the time. I might give it a try again. Check this out:
http://www.highend3d.com/maya/tutorials/development_api/Build-plugins-with-Visual-C---Express-Edition-268.html

Note, you will need to know about C++ classes as other advanced stuff you may not know if you programming experience only includes MEL.

sunder
10-01-2007, 10:39 AM
If you have the newer versions of maya, you can write python-script plugins instead of C++. It's easier in my opinion.