SHARE
TWEET

basic_plugin

a guest Jul 31st, 2015 201 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import maya.OpenMayaUI as omui
  2. import System.QTutils as QTutils
  3. reload(QTutils)
  4. from PySide import QtCore as qc
  5. from PySide import QtGui as qg
  6. from shiboken import wrapInstance
  7.  
  8. PLUGIN_NAME = "Tools"
  9. PLUGIN_INFO = "Test plugin info"
  10.  
  11.  
  12. def maya_main_window():
  13.     main_window_ptr = omui.MQtUtil.mainWindow()
  14.     return wrapInstance(long(main_window_ptr), qg.QWidget)
  15.  
  16. class toolBox_UI(qg.QDialog):
  17.         def __init__(self, parent=maya_main_window()):
  18.                 super(toolBox_UI, self).__init__(parent)
  19.        
  20.                 self.setWindowTitle("testFileUI")
  21.                 self.setWindowFlags(qc.Qt.Tool)
  22.                
  23.                 self.setFixedWidth(300)
  24.                 self.setFixedHeight(485)
  25.                 self.setAttribute(qc.Qt.WA_DeleteOnClose) #!
  26.                 self.setContentsMargins(0,0,0,0)
  27.                 self.create_layout()
  28.  
  29.         def create_layout(self):
  30.         #main layout
  31.                 main_layout = qg.QVBoxLayout()
  32.                 main_layout.setContentsMargins(0,0,0,0)
  33.                 main_layout.setSpacing(0)
  34.                 main_layout.setAlignment(qc.Qt.AlignTop)
  35.        
  36.                 top = QTutils.header("plugin name")    
  37.                 main_layout.layout().addWidget(top)            
  38.                
  39.                 self.setLayout(main_layout)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top