Menu

Building_and_installing

Javier Taibo
Attachments
Cmake.jpg (121204 bytes)

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.

Prerequisites

To build and install the Maya2OSG plug-in, the following dependencies must be installed in the system:

  • Maya SDK (installs automatically with Maya).
  • OpenSceneGraph libraries and headers.
  • CMake 2.8 or later.

The software has been tested on the following environments, although not all of these project files are currently included or maintained:

  • Maya 6.0
  • Maya 7.0
  • Maya 8.5
  • Maya 2008
  • Maya 2009
  • Maya 2010
  • Maya 2011
  • Windows XP
  • Windows Vista
  • Windows 7
  • GNU/Linux (at least Debian and Ubuntu distributions)
  • Microsoft Visual Studio 2005
  • Microsoft Visual Studio 2008
  • Microsoft Visual Studio 2008 Express Edition
  • Microsoft Visual Studio 2010 Express Edition
  • OpenSceneGraph 2.6.x
  • OpenSceneGraph 2.8.x
  • OpenSceneGraph 2.9.x

Generating the project

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.

Compiling and installing

Windows (Visual Studio)

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.

Linux

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.

Troubleshooting

If Maya2OSG plug-in does not work, check the following:

  1. Make sure the plug-in (
    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.
  1. Make sure all the libraries the plug-in depends on are available in the system or user PATH. Otherwise, Maya will show a message like this one:
    // 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.


Related

Wiki: Compilation_instructions
Wiki: Installation_instructions
Wiki: Main_Page

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.