| Tool Server |
I developed a system years ago in order to solve tool installation problems. It was loading Mel script and Mll plug-in files automatically when Maya runs. However, with Python integrated version of Maya it was necessary to add Python plug-in and Python script support to my tool beside existing Mel script and Mll plug-in support. I have added Python script/plug-in support to new structure of my tool. I call it "Tool Server". I am releasing latest version of "Tool Server" which contains upgrades that I mentioned above. "Tool Server" allows you to manage your script and plug-in files easily. You can keep your files well organized and distribute them without any problem. You can easily place "Tool Server" folder in a shared place and use provided tool to make it work efficiently just in few minutes. |
| Installation |
Download Tool Server | 36 Kb. | .rar Copy "Tool Server" folder wherever you want on your hard drive or somewhere on the network. For demonstration purpose I will copy it to D drive. Close Maya if it is running. Run "ToolServerSetup.exe" under "ToolServer\ServerInstall" folder. It will automatically display "Maya\Version" path in your machine. Please be sure that the path is correct, if it is not, use browse button in order to define correct location. It must look like this; "C:\Documents and Settings\UserName\My Documents\maya\2008" It loads default path for Maya 2008. If you are using different version, you can use tools menu to set the path for version of Maya you have. Use browse button in order to define the path of the "ToolServer". It must look like this; "D:\ToolServer" Please click the image below to see an example screenshot. Warning: Last step will delete existing "Maya.env" and "userSetup.mel" files. It would be good move to copy them to another place for backup purpose. Click "Create and Close" button. If everything's fine Maya.env file will be created under "My Documents\Maya\version" folder. Run Maya and open script editor. Several scripts and plug-in files should have been loaded. It must look like the image below. In this case I am using Maya 2008 which has Python support so Python paths and plug-in files have been loaded as well. If your version of Maya does not support Python, "Tool Server" will detect that. The image has been taken from Maya 7.0.1. As you can see here just Mel script and Mll plug-in files have been loaded. |
| Structure |
Let's take a look at the structure.
"Data" and "Graphic" folders have been created for special purposes. We will work on them later. "Tools Server" offers you more! "ServerExecutable" folder contains several tools in order to load the script and plug-ins files. "ServerInstall" folder contains a tool for installation which I have explained it in previous section. Please follow given installation instructions for different files below. |
| Installing Mll Plug-in Files |
"Tool Server" loads the plug-in files depends on what version of Maya in use. Let's say we are using Maya 2008. In this case "Tool Server" will be looking for Mll files under folders which created by user under version folder in "Plugin_mll" folder. Let's give an example. I got a plug-in in order to drive displacement maps based on surface tension called "Wrinkle" which contains two different Mll files. So I need to create a folder for them. I like to name the folder "Wrinkle". I have to create this folder under version folder which is 2008 in this case. So final path would look like this. "D:\ToolServer\Plugin_mll\2008\Wrinkle" Now I can copy my Mll files under this folder. When I start Maya they will be automatically loaded. I can see the result in script editor. If I have a compatible version of my plug-in for version 7.0.1, I can create another folder for this version as well. So path would look like this. "D:\ToolServer\Plugin_mll\7.0.1\Wrinkle" "Tool Server" loads your Mel and Python script files (if Python support available in your version of Maya) as well as Mll and Python plug-in files based on running version of Maya. You can create unlimited subfolders in order to keep your files well organised. Even if there is a syntax problem with the files, it won't break loading process because "Tool Server" will load them one by one. So you do not need to worry about tool installation any more. I hope you like "Tool Server". Please do not hesitate to contact me for bug reports, suggestions or questions. If "Plugin_mll" folder does not contain a folder for your version of Maya, you can create it. In order to do that execute about -v; Mel command. The result would look like this in feedback line. //Result: 2009 That means you need to create a folder called "2009" under "Plugin_mll" folder. You can put your "Wrinkle" plug-in files under related folder which would be; "D:\ToolServer\Plugin_mll\2009\Wrinkle" Regardless what version of Maya in use as long as you create a correct structure, related plug-in files will be loaded automatically. |
| Installing Mel and Python Script Files |
Some of my tool packages contain both Mel and Python scripts. I like to keep those files under one structure instead of separating them under two folders like "Script_mel" and "Script_python". In order to keep them working, I have added cross loading system as an additional capability. With cross loading system you can copy your Mel and Python script files under one folder called "Script". However, you can create unlimited subfolders under this folder in order to keep your files organized. Every Mel script file will be loaded under "Script" folder. Similarly, "Script" folder and all folders under this folder will be added to system path for your Python scripts. You can check script editor for details. |
| Installing Python Plug-in Files |
Installation of Python plug-in files is exactly the same as installing Mll plug-in files. So you can follow "Installing Mll Plug-in Files" instruction for Python plug-in installation. You just need to put your Python plug-in files under "D:\ToolServer\Plugin_py" folder. |
| Executing Commands |
I will show you the ways to execute commands if you are not familiar with. Execute Mel Script Command Execute Mll Plug-in Command Execute Python Script Command import ToolServerPythonScript Result would look like this; Additionally "Tool Server" imports Maya commands by using import maya.cmds as mc command; You can use mc in order to call Maya commands. Let's execute given command in Python tab. mc.sphere() Maya Mel module will be loaded as mel by using import maya.mel as mel command. You can use this module in order to call Mel commands from Python. Execute following code in Python tab. mel.eval("joint;") Execute Python Plug-in Command |
| Conclusion |
"Tool Server" loads your Mel and Python script files (if Python support available in your version of Maya) as well as Mll and Python plug-in files based on running version of Maya. You can create unlimited subfolders in order to keep your files well organised. Even if there is a syntax problem with the files, it won't break loading process because "Tool Server" will load them one by one. So you do not need to worry about tool installation any more. I hope you like "Tool Server". Please do not hesitate to contact me for bug reports, suggestions or questions. |