Posts

Showing posts from April, 2011
PyQt : Developing PyQt applications for Maya is basically divided into three parts : 1. Interface - developed in QT Designer. 2. Framework / Application code - written in Python editor. 3. Maya Code - written in Maya to call framework/application. 1. Interface - create desired interface in QT Designer and save it as "interfaceUI.ui" 2. Framework: save following code as - "filename.py" from PyQt4 import QtGui, QtCore, uic from pymel.core import * import pymel.core as pm # Path to the Qt Designer UI file ui_filename = 'C:/QtSDK/interfaceFile.ui' form_class, base_class = uic.loadUiType(ui_filename) # Interface Class class Exporter(base_class, form_class): def __init__(self): super(base_class,self).__init__() self.setupUi(self) self.setObjectName('WindowName') self.setDockNestingEnabled(True) # Main def main (): global ui ui = Exporter() ui.show() if
#if #if <value> /* code to execute if this value is true */ #elsif lt;value> /* code to execute if this value is true */ #else /* code to execute otherwise #endif #if checks whether the value is true (in the C and C++ sense of everything but 0) and if so, includes the code until the closing #endif. If not, that code is removed from the copy of the file given to the compiler prior to compilation (but it has no effect on the original source code file). There may be nested #if statements. It is common to comment out a block of code using the following construction because you cannot nest multi-line comments in C or C++. #if 0 /* code */ #endif http://www.cprogramming.com/reference/preprocessor/if.html #ifndef #ifndef <token> /* code */ #else /* code to include if the token is defined */ #endif #ifndef checks whether the given token has been #defined earlier in the file or in an included file; if not, it includes the code between it and the closing #else or, if no #else is