Guest User

Untitled

a guest
Nov 9th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. from PyQt4 import QtCore, QtGui, uic
  2. from maya import cmds
  3. import maya.OpenMayaUI as mui
  4. import os
  5. import sip
  6. import sys
  7.  
  8.  
  9.  
  10. # getMayaWindow() - leave it as it is.
  11. def getMayaWindow():
  12.     ptr = mui.MQtUtil.mainWindow()
  13.     return sip.wrapinstance( long(ptr), QtCore.QObject )
  14.      
  15. #sys.path.append(('Z:/maya/scripts/RF_Tools/Beta'))
  16. sys.path.append(('Z:/maya/scripts/RF_Tools/Beta/New Folder'))
  17. syspaths = sys.path
  18. # get path of our script file
  19. baseUI  = "C:\Users\dmakowski\Desktop\PyQTtests\My\ui\ui4.ui"
  20. # load with uic
  21. from_class, base_class = uic.loadUiType( baseUI )
  22.  
  23.  
  24.  
  25. #Def and Imports!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  26.  
  27. import settings_Lights
  28. reload(settings_Lights)
  29.  
  30.  
  31. # main class of your application
  32. class dazUI( base_class, from_class ):
  33.  
  34.      
  35.     def __init__( self, parent=getMayaWindow() ):
  36.          
  37.         super( base_class, self ).__init__( parent )
  38.  
  39.         self.setupUi( self )
  40.  
  41.         # when click this button, run function "btallClicked"
  42.         self.btnAllLightSettings.clicked.connect( self.btnAllLightSettingsClicked )
  43.         self.btnCut.clicked.connect( self.btnCutClicked )
  44.  
  45.         # show the UI
  46.         self.show()
  47.  
  48.      
  49.     def btnAllLightSettingsClicked( self ):
  50.         #anything you want. Let's say, create a sphere
  51.         settings_Lights.allSettings()
  52.    
  53.     def btnCutClicked(self):
  54.         settings_Lights.sampleMax  
  55.  
  56.        
  57.  
  58.  
  59.  
  60. # starting function. You call this from maya
  61. def launch():
  62.  
  63.     global Daz
  64.  
  65.     try:
  66.         Daz.close()
  67.     except:
  68.         pass
  69.  
  70.     # start the UI
  71.     Daz = dazUI()
  72.    
  73. Daz=dazUI()
Advertisement
Add Comment
Please, Sign In to add comment