Tags

, , ,

Now maya uses a customized version of Qt libraries.So if you want to built PyQt libraries for maya 2012.Here is how to do that,

Things to download

  1. Microsoft 2008 Express Edition with SP1
  2. Microsoft Windows SDK for Windows 7 (Windows 7 64bit Only)
  3. Qt 4.7.1 Modified for Maya from Autodesk
  4. Original Qt 4.7 from Nokia
  5. Sip 4.1.3
  6. PyQt 4.8.6

Building Qt

  1. Extract the Original Qt 4.7 from Nokia to c:\qt-adsk-4.7.1
  2. If you’re building for 64-bit Maya, select ‘Visual Studio 2008 x64 Win64 Command Prompt’.
  3. Run the commands below

cd c:\qt-adsk-4.7.1
configure -debug-and-release -no-qt3support

4. Now Qt is configured.To build run this command

c:\qt\2010.05\bin\jom

More detailed instruction can be found inside the Qt 4.7.1 Modified for Maya from Autodesk archive.

Building Sip

1.Extract Sip 4.1.3 to c:\sip-4.13

2.Run ‘Visual Studio 2008 x64 Win64 Command Prompt’ as administrator

3.Lets set the env variable for library and configure sip.Execute following commands

cd c:\sip-4.13
set LIB=%LIB%;C:\Program Files\Autodesk\Maya2012\lib
"C:\Program Files\Autodesk\Maya2012\bin\mayapy" configure.py

4.Set the include file location and build sip

set INCLUDE=%INCLUDE%;C:\Program Files\Autodesk\Maya2012\include\python2.6
nmake
nmake install

Buiding PyQt

1.Extract PyQt 4.8.6 to c:\PyQt-win-gpl-4.8.6

2.Run ‘Visual Studio 2008 x64 Win64 Command Prompt’ as administrator

3.Change to PyQt directory and Set the following Environment variable

cd c:\PyQt-win-gpl-4.8.6
set QTDIR= C:\qt-adsk-4.7.1
set PATH=C:\qt-adsk-4.7.1\bin;%PATH%
set QMAKESPEC=C:\qt-adsk-4.7.1\mkspecs\win32‐msvc2008
set INCLUDE=%INCLUDE%;C:\Program Files\Autodesk\Maya2012\include\python2.6;C:\qt-adsk-4.7.1\include

4.Configure and Bulit

"C:\Program Files\Autodesk\Maya2012\bin\mayapy" configure.py ‐w LIBDIR_QT=C:\qt-adsk-4.7.1\lib INCDIR_QT=C:\qt-adsk-4.7.1\include
nmake
nmake install

Now Sip and PyQt4 will be installed in maya’s site‐packages directory located at C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages

Testing the Installation

Now you can test the installation.Using the below code in maya’s script editor.

from PyQt4 import QtGui,QtCore
button=QtGui.QPushButton("Hello There")
button.show()

Advertisement