NOTE: The old pages, that were appliable until 0.4.2c have been replaced by this page when porting the building system to CMake. They are still available in the following links:
NOTE: This page is kept up to date with SVN code of Maya2OSG. For instructions regarding a specific release, look in the README file.
To build and install the Maya2OSG plug-in, the following dependencies must be installed in the system:
The software has been tested on the following environments, although not all of these project files are currently included or maintained:
To generate the project for your system, you need a recent version of CMake. I am currently using 2.8.4 in Windows and 2.8.0 in Linux. It may work with previous versions, however.
CMake has a command line version (cmake) and a GUI (cmake-gui). For detailed instructions about using CMake, consult its documentation in http://www.cmake.org/cmake/help/documentation.html.
1. Launch the CMake GUI and set the location of all dependencies: OSG and OpenThreads libraries can be easily located if OSG_DIR environment variable is defined before calling cmake-gui.
2. Check the Maya version you want the plug-in installed into and set it and the directories needed to create the project.
* MAYA_ARCH - This is currently unused in 32-bit. You can safely let it to x64.
* MAYA_VERSION - Maya version you want to install the plug-in into.
* MAYA_ROOT - Maya installation directory. This is the location where to look for the Maya SDK.
* MAYA_PLUGINS_DIR - Destination directory to install the plug-in into.
* MAYA_USER_DIR - Directory where the Maya user configuration is stored. By default, the maya folder at the home directory or [My ]Documents.
3. Press Configure. Select the kind the project for your favourite development environment.
4. Press Generate. The selected projects will be generated.
Open the solution created by CMake:
Maya2OSG.sln
. Select a configuration for the build. Release configuration is OK unless you want to develop or debug the plug-in. In this case, a better choice is Debug.
Build the project (maya2osg or the default selection ALL_BUILD).
You can install the built plug-in in your system by building the target INSTALL.
Visual Studio project will try to install the plug-in (
maya2osg.mll
) in the Maya plug-ins directory (its default location is
C:\Program Files\Autodesk\Maya 2011\bin\plug-ins
) unless you have specified otherwise in the CMake options. The plug-in installation may fail in modern systems (such as Windows Vista or Windows 7) because of file permissions. Additional files (MEL scripts, shelf buttons, ...) will also be automatically installed in the current user Maya default directory.
A fast workaround to the above mentioned permission problem is to give modification access to the plug-ins directory for the user that is doing the compilation. You can also run Visual Studio as superuser when installing.
Open the project generated by CMake in the corresponding IDE (e.g., Codeblocks) or execute GNU Make to build the plug-in.
You have a Makefile target called
install
to install the plug-in and configuration files in your system. The user invoking make install must have write permissions in the Maya plug-ins directory. You can 'su' to root to install the plug-in.
$ sudo make install
This will put each file in the right place to use the plug-in inside Maya.
**WARNING: Some Maya versions have a bug in
maya/MFnDependencyNode.h
header file that prevented compilation with g++ (it works perfectly with Visual C++). It is a missing semicolon (;) after the line reading**
declareMFn(MFnDependencyNode, MFnBase)
This issue was solved in Maya 2011.
If Maya2OSG plug-in does not work, check the following:
maya2osg.mll
or
maya2osg.so
) is placed in the right directory, where Maya can find it, and with the right file permissions. If it is not, Maya will show a message like this one:
// Error: Plug-in, "maya2osg.mll", was not found on MAYA_PLUG_IN_PATH.
// Error: The specified module could not be found.
Check also that the OSG version installed in your system is the same version used to compile the plug-in.
3. Check the Output Window (or the standard output in Linux) for error messages or debugging information during the execution of the Maya2OSG plug-in.
Wiki: Compilation_instructions
Wiki: Installation_instructions
Wiki: Main_Page