This page describes how to install the Maya NIF plug-in from the download package. It also describes the process of building the plug-in from source on platforms and Maya versions for which a binary is not availiable.
Using your Operating System:
- Run the installer program for Windows. This should copy all the files to the proper location automatically.
From within Maya:
- From the menu, choose: Window > Settings/Preferences > Plug-in Manager...
- Look for nifTranslator.mll in the list of available plug-ins and check the two boxes next to loaded and auto load.
You should now be able to use the File > Open Scene..., File > Import..., and File > Export All... commands with NIF files. You can access the configuration options by choosing the option box () rather than clicking the words.
If you've put the script in some other location before, it may take precedence over your new copy. If you're having trouble getting a new version to work, you can get a list of all the paths that Maya is looking for scripts by entering this command in Maya's command line:
Check each one to make sure there isn't another copy of nifTranslatorOpts.mel somewhere preventing your new one from working. Delete any extra copies you find.
Just as an example of how many places Maya might look for scripts, my output from this command shows the following locations:
C:/Documents and Settings/UserName/My Documents/maya/projects/CurrentProject/mel C:/Documents and Settings/UserName/My Documents/maya/7.0/scripts C:/Documents and Settings/UserName/My Documents/maya/scripts C:/Documents and Settings/UserName/My Documents/maya/7.0/presets C:/Documents and Settings/UserName/My Documents/maya/7.0/prefs/shelves C:/Documents and Settings/UserName/My Documents/maya/7.0/prefs/markingMenus C:/Program Files/Alias/Maya7.0/scripts/startup C:/Program Files/Alias/Maya7.0/scripts/others C:/Program Files/Alias/Maya7.0/scripts/AETemplates C:/Program Files/Alias/Maya7.0/scripts/paintEffects C:/Program Files/Alias/Maya7.0/scripts/fluidEffects C:/Program Files/Alias/Maya7.0/scripts/hair C:/Program Files/Alias/Maya7.0/scripts/cloth C:/Program Files/Alias/Maya7.0/scripts/live C:/Program Files/Alias/Maya7.0/scripts/fur
Compiling from Source
If you have Maya for Windows version 6.5, 7.0, 8.0, or 8.5, the above is all you need to worry about since you can use the pre-compiled version. But if you have a different version, or you want to use the latest unreleased code from git, you're going to have to compile the MLL plug-in file from the source code.
See using git for how to configure your system to check in/out source code.
- On your C: drive, add a folder called niftools.
- Inside the niftools folder, do a git checkout of niflib and maya_nif_plugin.
Compiling the code
To to compile the most current code, you will need to check out both Niflib and the Maya plug-in source code from git, as described above. You should then first compile Niflib as a dynamic library. On Windows, using MSVC, you can open the Niflib solution and choose the Release - DLL configuration from the drop-down on the tool bar, and then select Build > Build Solution from the menu. This will create the niflib.dll file in the bin folder within the folder where you downloaded the Niflib code.
If you haven't already, you should also add the location of the include and lib folders within this same folder to your compiler's search paths so that your other projects which use Niflib will be able to include the code. This is done in MSVC by selecting Tools > Options... from the menu, and then expanding "Projects and Solutions" and selecting "VC++ Directories" in the left pane. Then in the right pane, you should select Include Files from the Show directories for drop down box, and then add the location of the Niflib include folder. Next do the same thing for Library Files and add the Niflib lib folder.
Finally, you will compile the Maya Plug-in code. This process requires that your compiler be aware of the location of both Niflib and the Maya SDK include and lib files. On Windows, using MSVC, you can open the Maya Plug-in solution and select the version of Maya you have from the configuration drop down. If your version is not listed, or if you installed Maya in a non-standard location, however, you will need to add the correct paths similar to the way the Niflib paths were added above. Or, if you know what you're doing, you can create a new configuration with the proper path or edit an existing configuration to correct the path. Once you have the path configured correctly, you can select Build > Build Solution and the result will be the nifTranslator.mll file being created in the bin folder within the folder where the Plug-in code was downloaded. It should be located in a sub-folder that indicates the version of Maya that was selected in the configuration drop-down when the solution was built.
If you have any problems at this phase, such as code errors involving functions not being found or having the wrong number of parameters, Niflib may have been changed in ways that break the Maya plug-in. The version of Niflib that was current when the plug-in was last worked on was 0.7.2, so using that version may fix the problems.
Once you have everything compiled, you will have to move the resulting files to their proper locations. On Windows, the niflib.dll file can be moved to the Maya folder, while the nifTranslator.mll file can be moved to the plug-ins folder within the Maya folder. The nifTranslatorOpts.mel options script should also be placed in a location where Maya can find it, such as the scripts/others folder within the Maya folder. You should now be able to activate the plug-in from within Maya as described at the beginning of this page.
This code should be compatible with multiple versions of Maya on multiple operating systems, but only the above mentioned versions for Windows have been tested. If you successfully compile this code for another version of Maya, please post a link to your build on the niftools forum so others can use it!
Want to Help?
If you can program in C++, have Maya, and want to help make this plug-in better, we can always use more people working on the project. Just let us know you're interested on the NifTools forum.